Magic_Ling_Pixel_Dungeon/android/build.gradle

130 lines
4.8 KiB
Groovy
Raw Permalink Normal View History

apply plugin: 'com.android.application'
2022-08-18 14:20:37 +00:00
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
2023-08-22 13:27:52 +00:00
compileSdkVersion 30
buildToolsVersion "30.0.2"
// compileSdkVersion appAndroidCompileSDK
compileOptions.sourceCompatibility = compileOptions.targetCompatibility = appJavaCompatibility
sourceSets.main.assets.srcDirs = [new File(project(':core').projectDir, "/src/main/assets")]
defaultConfig {
manifestPlaceholders = [appName:appName]
applicationId appPackageName
2023-04-26 16:57:28 +00:00
//接入多Dex,解决代码方法超过65535的问题
multiDexEnabled true
versionCode appVersionCode
versionName appVersionName
//noinspection MinSdkTooLow
minSdkVersion appAndroidMinSDK
targetSdkVersion appAndroidTargetSDK
resConfigs "en_US", "cs", "tr", "ca", "ko", "pl", "it", "ja",
"eo", "ru", "zh_CN", "de", "fr", "es", "pt", "fi", "hu", "in"
}
buildTypes {
debug {
applicationIdSuffix ".indev"
versionNameSuffix '-INDEV'
dependencies {
2023-04-26 16:57:28 +00:00
releaseImplementation project(':services:news:shatteredNews')
}
}
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'
dependencies {
2020-07-03 23:17:54 +00:00
releaseImplementation project(':services:news:shatteredNews')
}
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
configurations { natives }
dependencies {
implementation project(':core')
2022-08-18 14:20:37 +00:00
// Import the Firebase BoM
2023-07-22 19:11:00 +00:00
implementation platform('com.google.firebase:firebase-bom:31.4.0')
2022-08-18 14:20:37 +00:00
// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries
2023-04-26 16:57:28 +00:00
//接入多DEX
implementation 'com.android.support:multidex:1.0.3'
2022-09-25 04:27:19 +00:00
//noinspection GradleDependency
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
2023-07-16 09:54:35 +00:00
2023-04-26 16:57:28 +00:00
implementation project(path: ':services:news:shatteredNews')
2023-07-22 19:11:00 +00:00
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"
2023-07-08 18:34:58 +00:00
//noinspection GradleDependency
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
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"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
2023-06-18 07:22:34 +00:00
//修复小米手表与低安卓系统的WebView冲突兼容问题
2023-07-22 19:11:00 +00:00
//noinspection GradleDependency
2023-07-09 06:17:01 +00:00
implementation 'androidx.appcompat:appcompat:1.0.2'
}
// 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()
file("libs/x86_64/").mkdirs()
configurations.natives.copy().files.each { jar ->
def outputDir = null
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
2022-06-15 16:50:53 +00:00
}
repositories {
mavenCentral()
}