SDL: various build script improvements

This commit is contained in:
pelya
2023-05-17 20:30:37 +03:00
parent 956660cd30
commit a8e98dd68b
5 changed files with 27 additions and 6 deletions

View File

@@ -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

View File

@@ -8,7 +8,7 @@ android {
defaultConfig {
applicationId "net.olofson.ballfield"
minSdk 16
minSdk 19
targetSdk 31
}

View File

@@ -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
# 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

View File

@@ -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/

View File

@@ -1,3 +1,10 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {