mirror of
https://github.com/yuliskov/LeanKeyboard.git
synced 2025-12-23 22:17:44 -05:00
87 lines
3.2 KiB
Groovy
87 lines
3.2 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
// Latest gradle fix: https://stackoverflow.com/questions/76300671/android-getting-error-namespace-not-specified
|
|
namespace 'com.liskovsoft.leankeykeyboard'
|
|
|
|
// Latest gradle fix: https://stackoverflow.com/questions/22604627/gradle-buildconfigfield-buildconfig-cannot-resolve-symbol
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
// FIX: Default interface methods are only supported starting with Android N (--min-api 24)
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
compileSdkVersion project.properties.compileSdkVersion
|
|
buildToolsVersion project.properties.buildToolsVersion
|
|
|
|
defaultConfig {
|
|
applicationId "org.liskovsoft.leankeykeyboard.pro"
|
|
minSdkVersion project.properties.minSdkVersion
|
|
targetSdkVersion project.properties.targetSdkVersion
|
|
versionCode 203
|
|
versionName "6.1.33"
|
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
buildTypes {
|
|
release {
|
|
// https://medium.com/@angelhiadefiesta/how-to-obfuscate-in-android-with-proguard-acab47701577
|
|
minifyEnabled true // enable obfuscation
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
// naming example: SmartYouTubeTV_Xwalk_v6.8.12_r.apk
|
|
// https://stackoverflow.com/questions/18332474/how-to-set-versionname-in-apk-filename-using-gradle
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.each { output ->
|
|
def project = "LeanKeyboard"
|
|
// Latest gradle fix: https://stackoverflow.com/questions/62075122/no-such-property-variantconfiguration-for-class
|
|
def buildType = variant.buildType.name.take(1)
|
|
def version = variant.versionName
|
|
def flavor = variant.productFlavors[-1].name
|
|
|
|
def newApkName = sprintf("%s_v%s_%s_%s.apk", [project, version, flavor, buildType])
|
|
|
|
output.outputFileName = new File(newApkName)
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
abortOnError true
|
|
disable 'MissingTranslation'
|
|
disable 'NewApi'
|
|
}
|
|
|
|
// gradle 4.6 migration: disable dimensions mechanism
|
|
// more: https://proandroiddev.com/advanced-android-flavors-part-4-a-new-version-fc2ad80c01bb
|
|
flavorDimensions "default"
|
|
|
|
productFlavors {
|
|
playstore {
|
|
applicationId "org.liskovsoft.androidtv.rukeyboard"
|
|
}
|
|
origin {
|
|
applicationId "com.liskovsoft.leankeyboard"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
androidTestImplementation(project.properties.espressoCoreVersion, {
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
})
|
|
testImplementation project.properties.junitVersion
|
|
implementation project.properties.appCompatXVersion
|
|
implementation project.properties.leanbackCompatXVersion
|
|
implementation project.properties.constraintXVersion
|
|
implementation project.properties.designXVersion
|
|
implementation project.properties.voiceOverlayVersion
|
|
}
|