mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-19 06:47:41 +00:00
Addresses Android for #1535 Add QR Codes to the keyman.com keyboard page. If the main app doesn't include the QRGen libraries, the QR Code isn't generated/displayed. Also update the list of dependencies in README.md
99 lines
3.5 KiB
Groovy
99 lines
3.5 KiB
Groovy
plugins {
|
|
id 'name.remal.default-plugins'
|
|
id 'com.android.library'
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 29
|
|
buildToolsVersion "29.0.2"
|
|
|
|
defaultConfig {
|
|
minSdkVersion 16
|
|
targetSdkVersion 29
|
|
|
|
String env_build_number = System.getenv("BUILD_NUMBER") //assigned by TeamCity, so all caps
|
|
String env_build_counter = System.getenv("build_counter")
|
|
if (env_build_number != null) {
|
|
println "Using build number $env_build_number and counter $env_build_counter from environment"
|
|
versionCode env_build_counter as Integer
|
|
versionName env_build_number
|
|
} else {
|
|
String majorMinorVersion = file('$projectDir/../../../../resources/VERSION.md').text.trim()
|
|
versionCode 100
|
|
versionName majorMinorVersion + '.0.0'
|
|
println "Using build $majorMinorVersion from project VERSION.md"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
|
}
|
|
}
|
|
|
|
// TODO: Remove this when SDK > 17
|
|
lintOptions {
|
|
disable 'ResourceType'
|
|
}
|
|
|
|
testOptions {
|
|
unitTests {
|
|
// Allows use of a simulated Android API for tests. (Thanks, roboelectric!)
|
|
includeAndroidResources = true
|
|
}
|
|
unitTests.all {
|
|
testLogging {
|
|
// May also add "passed", "skipped".
|
|
events "failed"//, "standardOut", "standardError" if we want them to show in builds.
|
|
outputs.upToDateWhen {false}
|
|
//showStandardStreams = true // If we want test console log output to show during builds.
|
|
}
|
|
systemProperty 'kmeaTestMode', 'true'
|
|
workingDir = "../" // Defaults to the `app` subdirectory, which is different from Android Studio's default.
|
|
|
|
//Avoid Warning: an illegal reflective access operation has occurred
|
|
//Change argument jdk.module.illegalAccess=warn for detailed information which module needs to be opened
|
|
//Problem is caused by robolectric: see https://github.com/robolectric/robolectric/issues/4776
|
|
if(JavaVersion.current().isJava9Compatible()){
|
|
jvmArgs ('-Djdk.module.illegalAccess=permit')
|
|
jvmArgs('--add-opens', 'java.base/java.lang=ALL-UNNAMED')
|
|
jvmArgs('--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED')
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
implementation 'com.google.android.material:material:1.0.0'
|
|
implementation 'commons-io:commons-io:2.6'
|
|
|
|
// Robolectric
|
|
testImplementation 'androidx.test:core:1.2.0'
|
|
testImplementation 'androidx.test.ext:junit:1.1.1'
|
|
testImplementation 'org.robolectric:robolectric:4.3.1'
|
|
|
|
/* We only want these Firebase Crashlytics dependencies for KMEA */
|
|
implementation 'com.google.firebase:firebase-analytics:17.2.1'
|
|
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
|
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
|
|
transitive = true
|
|
}
|
|
|
|
// Generate QR Codes
|
|
implementation ('com.github.kenglxn.QRGen:android:2.6.0') {
|
|
transitive = true
|
|
}
|
|
|
|
// Assign the annotation processor for tests.
|
|
testAnnotationProcessor 'com.google.auto.service:auto-service:1.0-rc4'
|
|
}
|
|
//Show deprecation compiler warnings
|
|
/*
|
|
allprojects {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << "-Xlint:deprecation"
|
|
}
|
|
}*/
|