spiegel-keyman/oem/firstvoices/android/app/build.gradle
2024-01-16 09:26:24 +07:00

128 lines
3.9 KiB
Groovy

plugins {
id 'com.android.application'
id 'io.sentry.android.gradle'
id 'com.github.triplet.play' version '3.8.1' apply false
}
ext.rootPath = '../../../../android'
apply from: "$rootPath/version.gradle"
android {
compileSdk 34
namespace="com.firstvoices.keyboards"
defaultConfig {
applicationId "com.firstvoices.keyboards"
minSdkVersion 21
targetSdkVersion 34
// VERSION_CODE and VERSION_NAME from version.gradle
versionCode VERSION_CODE as Integer
versionName VERSION_NAME
buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\""
buildConfigField "String", "VERSION_GIT_TAG", "\""+VERSION_GIT_TAG+"\""
}
String env_release_store_file = System.getenv("oem_firstvoices_release_store_file")
String env_release_store_password = System.getenv("oem_firstvoices_release_store_password")
String env_release_key_alias = System.getenv("oem_firstvoices_release_key_alias")
String env_release_key_password = System.getenv("oem_firstvoices_release_key_password")
if (env_release_store_file != null && file(env_release_store_file).exists()) {
signingConfigs {
release {
println "Using signing from environment"
storeFile file(String.valueOf(env_release_store_file))
storePassword env_release_store_password
keyAlias env_release_key_alias
keyPassword env_release_key_password
}
}
}
buildTypes {
/*debug {
applicationIdSuffix ".debug"
}*/
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (env_release_store_file != null && file(env_release_store_file).exists()) {
signingConfig signingConfigs.release
}
}
}
productFlavors {
}
applicationVariants.all { variant ->
// Adjust output name to "firstvoices-${VERSION_MD}.apk"
variant.outputs.all {
outputFileName = "firstvoices-" + VERSION_MD + ".apk"
}
}
lintOptions {
disable 'MissingTranslation'
lintConfig file("lint.xml")
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
// how to configure the sentry android gradle plugin
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true
// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
}
String env_keys_json_file = System.getenv("oem_firstvoices_keys_json_file")
if (env_keys_json_file != null && file(env_keys_json_file).exists()) {
apply plugin: 'com.github.triplet.play'
play {
serviceAccountCredentials = file(String.valueOf(env_keys_json_file))
// Deactivate lower conflicting version APKs
resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE)
switch (System.env.TIER) {
case 'beta':
track.set("beta")
println "TIER set to beta"
break
case 'stable':
track.set("production")
println "TIER set to production"
break
default:
track.set("alpha")
println "TIER set to alpha"
}
}
}
repositories {
flatDir {
dirs 'libs'
}
google()
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.0-rc01'
implementation 'com.google.android.material:material:1.6.0'
api(name: 'keyman-engine', ext: 'aar')
implementation 'io.sentry:sentry-android:6.9.2'
implementation 'androidx.preference:preference:1.2.0'
}
apply plugin: 'com.android.application'