diff --git a/changeAppSettings.sh b/changeAppSettings.sh index 328e85016..535d9fb6d 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -896,8 +896,18 @@ else cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/Advertisement.java fi +if [ -z "$ANDROID_NDK_HOME" ]; then + export ANDROID_NDK_HOME="$(which ndk-build | sed 's@/ndk-build@@')" +fi +if [ -z "$ANDROID_NDK_HOME" ]; then + echo "Set ANDROID_NDK_HOME env variable, or put ndk-build into your PATH" + exit 1 +fi +NDK_VER=$(echo ${ANDROID_NDK_HOME} | grep -Eo '[^/]+$') + cat project/app/build-template.gradle | \ - sed 's/applicationId .*/applicationId "'"$AppFullName"'"/' > \ + sed 's/applicationId .*/applicationId "'"${AppFullName}"'"/' | \ + sed 's/ndkVersion .*/ndkVersion "'"${NDK_VER}"'"/' > \ project/app/build.gradle echo "-keep class $AppFullName.** { *; }" > project/proguard-local.cfg diff --git a/project/app/build-template.gradle b/project/app/build-template.gradle index ff24888b2..888f5d514 100644 --- a/project/app/build-template.gradle +++ b/project/app/build-template.gradle @@ -8,7 +8,7 @@ android { defaultConfig { applicationId "net.olofson.ballfield" - minSdk 16 + minSdk 19 targetSdk 31 } diff --git a/project/gradle.properties b/project/gradle.properties index 52f5917cb..3c5031eb7 100644 --- a/project/gradle.properties +++ b/project/gradle.properties @@ -12,8 +12,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK +# Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -# Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true \ No newline at end of file +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/project/jni/application/openttd/AndroidBuild.sh b/project/jni/application/openttd/AndroidBuild.sh index e90766c10..123564837 100755 --- a/project/jni/application/openttd/AndroidBuild.sh +++ b/project/jni/application/openttd/AndroidBuild.sh @@ -109,7 +109,7 @@ mkdir -p staging-openttd-$VER-$1 set -e ${CMAKE_BIN_LOC}cmake --build openttd-$VER-$1 --parallel $BUILD_NUM_CPUS --verbose; -${CMAKE_BIN_LOC}cmake --install openttd-$VER-$1 --parallel $BUILD_NUM_CPUS --prefix ./staging-openttd-$VER-$1; +${CMAKE_BIN_LOC}cmake --install openttd-$VER-$1 --prefix ./staging-openttd-$VER-$1; cp staging-openttd-$VER-$1/games/libapplication.so libapplication-$1.so; mkdir -p ./data cp -r staging-openttd-$VER-$1/share/games/application/* data/ diff --git a/project/settings.gradle b/project/settings.gradle index ea1f3c29c..a548bfdea 100644 --- a/project/settings.gradle +++ b/project/settings.gradle @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories {