Panda3DS/src/pandroid/app/build.gradle.kts
2024-06-08 12:12:11 +05:30

78 lines
2.1 KiB
Kotlin

plugins {
id("com.android.application")
}
android {
namespace = "com.panda3ds.pandroid"
compileSdk = 33
defaultConfig {
applicationId = "com.panda3ds.pandroid"
minSdk = 24
targetSdk = 33
versionCode = getVersionCode()
versionName = getVersion()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters += listOf("x86_64", "arm64-v8a")
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
signingConfig = signingConfigs.getByName("debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
getByName("debug") {
isMinifyEnabled = false
isShrinkResources = false
isDebuggable = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("com.google.code.gson:gson:2.10.1")
}
def getVersionName() {
def tag = '1.0'
try {
def process = 'git describe --tags --abbrev=0'.execute()
tag = process.text.trim()
if (tag.startsWith('v')) {
tag = tag.substring(1)
}
} catch (Exception e) {
println "Failed to get latest Git tag: ${e.message}"
}
return tag
}
def getVersionCode() {
def versionCode = 1
if (getVersionName() && getVersionName()[0].isDigit()) {
versionCode = getVersionName()[0].toInteger()
}
return versionCode
}