mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
222 lines
7.5 KiB
Groovy
222 lines
7.5 KiB
Groovy
plugins {
|
|
id 'com.android.application' version '8.2.0'
|
|
id 'org.jetbrains.kotlin.android' version '1.9.20'
|
|
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.20'
|
|
id 'com.android.library' version '8.2.0' apply false
|
|
}
|
|
|
|
def getVersionCode = { ->
|
|
try {
|
|
def stdout = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'rev-list', '--first-parent', '--count', 'master'
|
|
standardOutput = stdout
|
|
}
|
|
return Integer.parseInt(stdout.toString().trim())
|
|
} catch (ignored) {
|
|
project.logger.lifecycle("Failed to get rev-list count from git!")
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
def getVersionName = { ->
|
|
try {
|
|
def stdout = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'describe', '--tags', '--dirty'
|
|
standardOutput = stdout
|
|
}
|
|
return stdout.toString().trim()
|
|
} catch (ignored) {
|
|
project.logger.lifecycle("Failed to get version name tag from git!")
|
|
return "0.0.0";
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace 'org.futo.inputmethod.latin'
|
|
|
|
compileSdk 34
|
|
|
|
// Required if using classes in android.test.runner
|
|
useLibrary 'android.test.runner'
|
|
|
|
// Required if using classes in android.test.base
|
|
useLibrary 'android.test.base'
|
|
|
|
// Required if using classes in android.test.mock
|
|
useLibrary 'android.test.mock'
|
|
|
|
defaultConfig {
|
|
minSdk 24
|
|
targetSdk 34
|
|
versionName getVersionName()
|
|
versionCode getVersionCode()
|
|
|
|
applicationId 'org.futo.inputmethod.latin'
|
|
testApplicationId 'org.futo.inputmethod.latin.tests'
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables.useSupportLibrary = false
|
|
}
|
|
|
|
signingConfigs {
|
|
debug {
|
|
storeFile file("java/shared.keystore")
|
|
}
|
|
}
|
|
|
|
final def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
def releaseSigning = signingConfigs.debug
|
|
if (keystorePropertiesFile.exists()) {
|
|
final def keystoreProperties = new Properties()
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
releaseSigning = signingConfigs.create("release") {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile rootProject.file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
} else {
|
|
project.logger.lifecycle('keystore.properties not found, APK may not be signed')
|
|
}
|
|
|
|
|
|
final def crashReportPropertiesFile = rootProject.file("crashreporting.properties")
|
|
final def crashReportProperties = new Properties()
|
|
if (crashReportPropertiesFile.exists()) {
|
|
crashReportProperties.load(new FileInputStream(crashReportPropertiesFile))
|
|
} else {
|
|
project.logger.lifecycle('crashreporting.properties not found, crash reporting will be disabled')
|
|
}
|
|
|
|
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
signingConfig signingConfigs.debug
|
|
}
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig releaseSigning
|
|
}
|
|
|
|
buildTypes.each {
|
|
if (crashReportPropertiesFile.exists()) {
|
|
it.buildConfigField "boolean", "ENABLE_ACRA", crashReportProperties['acraEnabled']
|
|
it.buildConfigField "String", "ACRA_URL", crashReportProperties['acraUrl']
|
|
it.buildConfigField "String", "ACRA_USER", crashReportProperties['acraUser']
|
|
it.buildConfigField "String", "ACRA_PASSWORD", crashReportProperties['acraPassword']
|
|
} else {
|
|
it.buildConfigField "boolean", "ENABLE_ACRA", "false"
|
|
it.buildConfigField "String", "ACRA_URL", "\"\""
|
|
it.buildConfigField "String", "ACRA_USER", "\"\""
|
|
it.buildConfigField "String", "ACRA_PASSWORD", "\"\""
|
|
}
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
flavorDimensions "default"
|
|
|
|
sourceSets {
|
|
main {
|
|
res.srcDirs = ['java/res']
|
|
java.srcDirs = ['common/src', 'java/src']
|
|
manifest.srcFile 'java/AndroidManifest.xml'
|
|
}
|
|
|
|
androidTest {
|
|
res.srcDirs = ['tests/res']
|
|
java.srcDirs = ['tests/src']
|
|
manifest.srcFile "tests/AndroidManifest.xml"
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
checkReleaseBuilds false
|
|
}
|
|
|
|
aaptOptions {
|
|
noCompress 'dict'
|
|
}
|
|
|
|
externalNativeBuild {
|
|
ndkBuild {
|
|
path 'native/jni/Android.mk'
|
|
}
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
buildFeatures {
|
|
compose true
|
|
viewBinding true
|
|
mlModelBinding true
|
|
}
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion '1.5.5'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.core:core-ktx:1.12.0'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime:2.7.0'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-compose:2.7.0'
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0'
|
|
implementation 'androidx.activity:activity-compose:1.8.2'
|
|
implementation platform('androidx.compose:compose-bom:2024.02.02')
|
|
implementation 'androidx.compose.ui:ui'
|
|
implementation 'androidx.compose.ui:ui-graphics'
|
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
|
implementation 'androidx.compose.material3:material3'
|
|
implementation 'com.google.android.material:material:1.11.0'
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
implementation 'androidx.navigation:navigation-compose:2.7.7'
|
|
|
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
|
|
|
implementation 'androidx.datastore:datastore-preferences:1.0.0'
|
|
implementation 'androidx.autofill:autofill:1.1.0'
|
|
|
|
implementation 'ch.acra:acra-http:5.11.1'
|
|
implementation 'ch.acra:acra-dialog:5.11.1'
|
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.5.1'
|
|
|
|
def work_version = "2.9.0"
|
|
implementation "androidx.work:work-runtime-ktx:$work_version"
|
|
implementation "androidx.work:work-runtime:$work_version"
|
|
|
|
implementation project(":voiceinput-shared")
|
|
|
|
debugImplementation 'androidx.compose.ui:ui-tooling'
|
|
debugImplementation 'androidx.compose.ui:ui-test-manifest'
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation "org.mockito:mockito-core:1.9.5"
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
androidTestImplementation 'androidx.test:rules:1.5.0'
|
|
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
|
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
|
|
}
|
|
|
|
project.logger.lifecycle("versionCode = ${android.defaultConfig.versionCode}")
|
|
project.logger.lifecycle("versionName = ${android.defaultConfig.versionName}") |