Skip to content

Commit

Permalink
Improved build properties
Browse files Browse the repository at this point in the history
  • Loading branch information
DrBeef committed Apr 8, 2024
1 parent 5711fe3 commit 6e119d9
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 293 deletions.
5 changes: 3 additions & 2 deletions Projects/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.jkxr"
android:versionCode="69"
android:versionName="1.1.27" android:installLocation="auto" >
android:versionCode="70"
android:versionName="1.1.28" android:installLocation="auto" >

<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
Expand All @@ -17,6 +17,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />


<application android:allowBackup="false"
android:icon="@mipmap/teambeef"
android:label="@string/jkxr"
Expand Down
105 changes: 94 additions & 11 deletions Projects/Android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
buildscript {
repositories {
google() // For Gradle 4.0+
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
}
}

apply plugin: 'com.android.application'
apply from: "${rootProject.projectDir}/XrApp.gradle"

android {
// This is the name of the generated apk file, which will have
Expand All @@ -14,12 +24,13 @@ android {
// will replace an older one.
applicationId "com.drbeef." + project.archivesBaseName

// override app plugin abiFilters for both 32 and 64-bit support
externalNativeBuild {
ndk {
abiFilters 'arm64-v8a'
}
ndkBuild {
def numProcs = Runtime.runtime.availableProcessors()
arguments "V=0", "-j$numProcs", "-C$project.buildDir.parent", "APP_PLATFORM=android-29", "NDK_TOOLCHAIN_VERSION=clang", "APP_STL=c++_static"
abiFilters 'arm64-v8a'
}
}
Expand All @@ -28,26 +39,95 @@ android {
targetSdkVersion 29
}

sourceSets {
main {
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
}
}

signingConfigs {
def keystorePath = (project.hasProperty('key.store')) ?
new File(project.getProperty('key.store')) :
project.file('android.debug.keystore')

def keystorePassword = (project.hasProperty('key.store.password')) ?
project.getProperty('key.store.password') : 'android'

def keystoreKeyAlias = (project.hasProperty('key.alias')) ?
project.getProperty('key.alias') : 'androiddebugkey'

def keystoreKeyPassword = (project.hasProperty('key.alias.password')) ?
project.getProperty('key.alias.password') : 'android'

debug {
storeFile keystorePath
storePassword keystorePassword
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
v2SigningEnabled true
}

release {
storeFile keystorePath
storePassword keystorePassword
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
v2SigningEnabled true
}
}

buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable true
jniDebuggable true

externalNativeBuild {
ndkBuild {
arguments "NDK_DEBUG=1","USE_ASAN=1"
}
}
}

release {
signingConfig signingConfigs.release
debuggable false
jniDebuggable false

externalNativeBuild {
ndkBuild {
arguments "NDK_DEBUG=0","USE_ASAN=0"
}
}
}
}

sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['../../java']
jniLibs.srcDir 'libs'
res.srcDirs = ['../../res']
assets.srcDirs = ['../../assets']
}
jni.srcDirs = ['jni']

}

packagingOptions {
exclude 'lib/arm64-v8a/libopenxr_loader.so'
lintOptions {
checkReleaseBuilds false
disable 'ExpiredTargetSdkVersion'
}

//packagingOptions {
// exclude 'lib/arm64-v8a/libopenxr_loader.so'
//}

compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
compileSdkVersion = 29
buildToolsVersion = '29.0.3'
ndkVersion '21.1.6352462'
}

dependencies {
Expand All @@ -59,12 +139,15 @@ dependencies {
repositories {
google()
}
buildscript {
repositories {
google()
}

// Workaround to fix issue in Android Studio Chipmunk 2021.2.1 and later
// where opening a project would result in a 'prepareKotlinBuildScriptModel'
// not found error
if (!tasks.findByName("prepareKotlinBuildScriptModel")) {
tasks.register("prepareKotlinBuildScriptModel") {}
}


task packBaseResources(type: Zip) {
from "../../z_vr_assets_base/"
destinationDir file("../../assets/")
Expand Down
8 changes: 8 additions & 0 deletions Projects/Android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
org.gradle.caching=true
org.gradle.configureondemand=true
5 changes: 2 additions & 3 deletions Projects/Android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Sep 04 16:36:21 BST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion Projects/Android/jni/OpenJK/code/qcommon/stv_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// Current version of the single player game
#include "../win32/AutoVersion.h"

#define JKXR_VERSION "1.1.27"
#define JKXR_VERSION "1.1.28"

#ifdef _DEBUG
#define Q3_VERSION "(debug)OpenJK: v" VERSION_STRING_DOTTED " JKXR: " JKXR_VERSION
Expand Down
1 change: 0 additions & 1 deletion Projects/Android/local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
# For customization when using a Version Control System, please read the
# header note.
#Thu Dec 12 20:21:11 GMT 2019
ndk.dir=C\:\\Users\\Simon\\AppData\\Local\\Android\\Sdk\\ndk\\21.1.6352462
sdk.dir=C\:\\Users\\Simon\\AppData\\Local\\Android\\Sdk
4 changes: 1 addition & 3 deletions Projects/Android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
rootProject.projectDir = new File(settingsDir, '../..')
//rootProject.projectDir = settingsDir
rootProject.name = "JKXR"

include ':', 'Projects:Android'
Binary file modified Projects/AndroidPrebuilt/jni/libopenxr_loader.so
Binary file not shown.
Loading

0 comments on commit 6e119d9

Please sign in to comment.