2019-08-01 19:35:27 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion appAndroidCompileSDK
|
2019-10-26 17:21:05 +00:00
|
|
|
compileOptions.sourceCompatibility = compileOptions.targetCompatibility = appJavaCompatibility
|
|
|
|
|
|
|
|
sourceSets.main.assets.srcDirs = [new File(project(':core').projectDir, "/src/main/assets")]
|
2019-08-01 19:35:27 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
manifestPlaceholders = [appName:appName]
|
|
|
|
applicationId appPackageName
|
|
|
|
|
|
|
|
versionCode appVersionCode
|
|
|
|
versionName appVersionName
|
|
|
|
|
|
|
|
//noinspection MinSdkTooLow
|
|
|
|
minSdkVersion appAndroidMinSDK
|
|
|
|
targetSdkVersion appAndroidTargetSDK
|
|
|
|
|
2019-10-01 04:14:44 +00:00
|
|
|
resConfigs "en_US", "cs", "tr", "ca", "ko", "pl", "it", "ja",
|
2019-08-01 19:35:27 +00:00
|
|
|
"eo", "ru", "zh_CN", "de", "fr", "es", "pt", "fi", "hu", "in"
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix ".indev"
|
|
|
|
versionNameSuffix '-INDEV'
|
2019-11-22 20:05:47 +00:00
|
|
|
dependencies {
|
|
|
|
debugImplementation project(':services:updates:debugUpdates')
|
2020-07-03 23:17:54 +00:00
|
|
|
debugImplementation project(':services:news:debugNews')
|
2019-11-22 20:05:47 +00:00
|
|
|
}
|
2019-08-01 19:35:27 +00:00
|
|
|
}
|
|
|
|
release {
|
|
|
|
|
|
|
|
//These lines enable R8, which is a code shrinker/optimizer/obfuscator.
|
|
|
|
//This makes release APKs smaller and more efficient, but also makes debugging trickier
|
|
|
|
//as the information produced in stack traces must be de-obfuscated.
|
|
|
|
//See here: https://developer.android.com/studio/build/shrink-code#decode-stack-trace
|
|
|
|
shrinkResources true
|
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2019-11-22 20:05:47 +00:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
releaseImplementation project(':services:updates:githubUpdates')
|
2020-07-03 23:17:54 +00:00
|
|
|
releaseImplementation project(':services:news:shatteredNews')
|
2019-11-22 20:05:47 +00:00
|
|
|
}
|
2019-08-01 19:35:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
jniLibs.srcDirs = ['libs']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations { natives }
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation project(':core')
|
|
|
|
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
|
2021-06-24 00:29:13 +00:00
|
|
|
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
2019-10-11 02:20:23 +00:00
|
|
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
|
2022-02-18 17:08:27 +00:00
|
|
|
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
|
2019-08-01 19:35:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// called every time gradle gets executed, takes the native dependencies of
|
|
|
|
// the natives configuration, and extracts them to the proper libs/ folders
|
|
|
|
// so they get packed with the APK.
|
|
|
|
task copyAndroidNatives() {
|
|
|
|
file("libs/armeabi-v7a/").mkdirs()
|
|
|
|
file("libs/arm64-v8a/").mkdirs()
|
|
|
|
file("libs/x86/").mkdirs()
|
2021-06-24 00:29:13 +00:00
|
|
|
file("libs/x86_64/").mkdirs()
|
2019-08-01 19:35:27 +00:00
|
|
|
|
2020-06-10 20:25:44 +00:00
|
|
|
configurations.natives.copy().files.each { jar ->
|
2019-08-01 19:35:27 +00:00
|
|
|
def outputDir = null
|
|
|
|
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
|
2021-06-24 00:29:13 +00:00
|
|
|
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
|
2019-08-01 19:35:27 +00:00
|
|
|
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
|
2021-06-24 00:29:13 +00:00
|
|
|
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
|
2019-08-01 19:35:27 +00:00
|
|
|
if(outputDir != null) {
|
|
|
|
copy {
|
|
|
|
from zipTree(jar)
|
|
|
|
into outputDir
|
|
|
|
include "*.so"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|