Play-/build_android/build.gradle

131 lines
2.7 KiB
Groovy
Raw Permalink Normal View History

2024-07-29 16:53:23 -04:00
import org.ajoberstar.grgit.Grgit
2016-07-13 21:33:59 -04:00
apply plugin: 'com.android.application'
buildscript {
repositories {
2018-10-24 17:56:07 -04:00
google()
2016-07-13 21:33:59 -04:00
mavenCentral()
}
2017-02-09 01:37:25 +00:00
2016-07-13 21:33:59 -04:00
dependencies {
2025-01-18 12:36:53 -05:00
classpath 'com.android.tools.build:gradle:8.8.0'
2022-01-12 12:56:10 -05:00
classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1'
2016-07-13 21:33:59 -04:00
}
}
project.ext {
2025-02-04 11:14:31 -05:00
signingEnabled = project.hasProperty("PLAY_RELEASE_STORE_FILE")
2024-07-29 16:53:23 -04:00
git = Grgit.open(currentDir: project.rootDir)
gitVersionCode = git.tag.list().size()
gitVersionName = "${git.describe()}"
}
2016-07-13 21:33:59 -04:00
project.afterEvaluate {
2017-10-24 08:01:32 -04:00
preBuild.dependsOn 'copyPatchesFile'
2016-07-13 21:33:59 -04:00
}
android {
repositories {
2018-07-24 13:01:03 -04:00
google()
2016-07-13 21:33:59 -04:00
mavenCentral()
}
2017-02-09 01:37:25 +00:00
2023-03-02 15:34:04 -05:00
namespace 'com.virtualapplications.play'
2024-07-29 16:53:23 -04:00
compileSdk 34
2017-02-09 01:37:25 +00:00
2024-02-07 14:39:06 -05:00
buildFeatures {
buildConfig true
}
2016-07-13 21:33:59 -04:00
defaultConfig {
versionCode (100 + gitVersionCode)
versionName gitVersionName
2016-07-13 21:33:59 -04:00
minSdkVersion 19
2024-07-29 16:53:23 -04:00
targetSdkVersion 34
2017-02-09 01:37:25 +00:00
externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang",
2017-02-09 01:37:25 +00:00
"-DANDROID_CPP_FEATURES=exceptions rtti", "-DANDROID_STL=c++_static"
cppFlags "-frtti"
targets "Play"
2017-02-09 01:37:25 +00:00
}
2023-04-24 14:24:24 -04:00
ndkVersion "25.2.9519653"
2017-02-09 01:37:25 +00:00
ndk {
2017-03-11 21:31:21 -05:00
abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'
2017-02-09 01:37:25 +00:00
}
}
2016-07-13 21:33:59 -04:00
}
2017-02-09 01:37:25 +00:00
2016-07-13 21:33:59 -04:00
dependencies {
2023-08-17 12:01:31 -04:00
api 'androidx.appcompat:appcompat:1.6.1'
api 'androidx.preference:preference:1.2.1'
implementation 'androidx.documentfile:documentfile:1.0.1'
2018-07-24 13:01:03 -04:00
api 'org.apache.commons:commons-lang3:3.4'
2024-07-29 16:53:23 -04:00
api 'commons-io:commons-io:2.13.0'
2016-07-13 21:33:59 -04:00
}
2017-02-09 01:37:25 +00:00
signingConfigs {
2022-02-11 11:13:39 -05:00
if(project.ext.signingEnabled) {
release {
storeFile file(PLAY_RELEASE_STORE_FILE)
storePassword PLAY_RELEASE_STORE_PASSWORD
keyAlias PLAY_RELEASE_KEY_ALIAS
keyPassword PLAY_RELEASE_KEY_PASSWORD
}
} else {
release {
}
}
}
2017-02-09 01:37:25 +00:00
2016-07-13 21:33:59 -04:00
buildTypes {
debug {
debuggable true
jniDebuggable true
2017-05-01 16:57:40 +01:00
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
2016-07-13 21:33:59 -04:00
}
release {
proguardFile getDefaultProguardFile('proguard-android.txt')
if(project.ext.signingEnabled) {
signingConfig signingConfigs.release
}
2017-05-01 16:57:40 +01:00
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
2023-07-24 17:02:30 -04:00
externalNativeBuild {
cmake {
cppFlags += "-flto=full"
}
}
2016-07-13 21:33:59 -04:00
}
}
packagingOptions {
2022-02-11 11:13:39 -05:00
resources {
excludes += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt']
}
2016-07-13 21:33:59 -04:00
}
2017-02-09 01:37:25 +00:00
2017-10-24 08:01:32 -04:00
task copyPatchesFile(type: Copy) {
2025-01-14 15:33:56 -05:00
from '../GameConfig.xml'
into 'src/main/assets'
}
2017-02-09 01:37:25 +00:00
sourceSets.main {
java.srcDirs = [ '../Source/ui_android/java' ]
2021-08-11 08:04:58 -04:00
jniLibs.srcDir 'src/main/libs'
2016-07-13 21:33:59 -04:00
}
2017-02-09 01:37:25 +00:00
externalNativeBuild {
cmake {
2018-01-11 00:51:49 +00:00
path '../CMakeLists.txt'
version "3.31.1"
2017-02-09 01:37:25 +00:00
}
2016-07-13 21:33:59 -04:00
}
2021-05-31 16:36:10 -04:00
compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2016-07-13 21:33:59 -04:00
}