mirror of
https://github.com/markusfisch/BinaryEye.git
synced 2024-09-20 03:52:16 +02:00
867dc36811
Add desugaring support to reverse translate Java 8 language features
in order to use the latest ZXing without having to increase minSdk.
ZXing 3.4 doesn't work on SDK levels below 24 anymore, see:
https://github.com/zxing/zxing/issues/1170
Many thanks to @TheLastProject for showing me the way:
cbcf1bcd99
102 lines
2.9 KiB
Groovy
102 lines
2.9 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
|
|
android {
|
|
compileSdkVersion sdk_version
|
|
|
|
defaultConfig {
|
|
minSdkVersion 9
|
|
targetSdkVersion sdk_version
|
|
|
|
versionCode 93
|
|
versionName '1.48.1'
|
|
|
|
// Required for desugaring.
|
|
multiDexEnabled true
|
|
|
|
// It's recommended to set this value to the lowest API level
|
|
// able to provide all the functionality.
|
|
renderscriptTargetApi 24
|
|
renderscriptSupportModeEnabled true
|
|
renderscriptSupportModeBlasEnabled true
|
|
|
|
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
keyAlias System.getenv('ANDROID_KEY_ALIAS')
|
|
keyPassword System.getenv('ANDROID_KEY_PASSWORD')
|
|
storePassword System.getenv('ANDROID_STORE_PASSWORD')
|
|
def filePath = System.getenv('ANDROID_KEYFILE')
|
|
storeFile filePath ? file(filePath) : null
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
androidTest.java.srcDirs += 'src/androidTest/kotlin'
|
|
test.java.srcDirs += 'src/test/kotlin'
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix '.debug'
|
|
}
|
|
|
|
release {
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
signingConfig signingConfigs.release
|
|
}
|
|
}
|
|
|
|
bundle {
|
|
language {
|
|
// To make the app bundle contain all language resources
|
|
// so the in-app language setting works. Another solution
|
|
// would be to use the PlayCore API to download language
|
|
// resources on demand, but it makes much more sense to
|
|
// simply include the ~60 kb than adding fragile code and
|
|
// dependencies.
|
|
enableSplit = false
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
// To desugar fancy Java features in ZXing 3.4.+ that don't
|
|
// work on SDK < 24. See:
|
|
// https://github.com/zxing/zxing/issues/1170
|
|
coreLibraryDesugaringEnabled true
|
|
}
|
|
|
|
lintOptions {
|
|
// Because at the time of writing, even the latest version
|
|
// of RenderScript is raising this error no matter if
|
|
// renderscriptTargetApi matches targetSdkVersion.
|
|
disable 'GradleCompatible'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
androidTestImplementation('com.android.support.test:runner:1.0.2') {
|
|
exclude module: 'support-annotations'
|
|
}
|
|
androidTestImplementation('com.android.support.test:rules:1.0.2') {
|
|
exclude module: 'support-annotations'
|
|
}
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
|
|
implementation "com.android.support:appcompat-v7:$support_version"
|
|
implementation "com.android.support:design:$support_version"
|
|
implementation "com.android.support:preference-v7:$support_version"
|
|
implementation "com.android.support:preference-v14:$support_version"
|
|
implementation 'com.google.zxing:core:3.4.1'
|
|
implementation 'com.github.markusfisch:CameraView:1.9.1'
|
|
implementation 'com.github.markusfisch:ScalingImageView:1.3.0'
|
|
}
|