Meshtastic-Android/app/build.gradle

193 lines
6.7 KiB
Groovy
Raw Normal View History

2020-01-20 15:53:22 -08:00
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlinx-serialization'
2020-01-22 09:28:59 -08:00
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.github.triplet.play'
apply plugin: 'de.mobilej.unmock'
// apply plugin: "app.brant.amazonappstorepublisher"
2020-01-20 15:53:22 -08:00
2020-01-22 13:40:57 -08:00
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
2020-01-22 18:32:21 -08:00
// protobuf
apply plugin: 'com.google.protobuf'
2020-09-23 22:47:45 -04:00
apply plugin: 'kotlin-kapt'
unMock {
keep "android.net.Uri"
keep "android.util.Base64"
}
2020-01-20 15:53:22 -08:00
android {
/*
signingConfigs {
release {
storeFile "$meshtasticKeystoreFile"
keyAlias 'upload'
storePassword "$meshtasticKeystorePassword"
keyPassword "$meshtasticKeyPassword"
}
} */
2021-03-20 01:28:55 +08:00
compileSdkVersion 30
2021-01-03 10:29:40 +08:00
// leave undefined to use version plugin wants
// buildToolsVersion "30.0.2" // Note: 30.0.2 doesn't yet work on Github actions CI
2020-01-20 15:53:22 -08:00
defaultConfig {
2020-01-22 21:46:41 -08:00
applicationId "com.geeksville.mesh"
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
2021-06-10 09:29:14 -07:00
targetSdkVersion 30 // 30 can't work until an explicit location permissions dialog is added
versionCode 20240 // format is Mmmss (where M is 1+the numeric major number
versionName "1.2.40"
2020-01-20 15:53:22 -08:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2021-01-30 14:44:55 +08:00
// per https://developer.android.com/studio/write/vector-asset-studio
vectorDrawables.useSupportLibrary = true
2020-01-20 15:53:22 -08:00
}
buildTypes {
release {
2020-04-13 17:01:29 -07:00
minifyEnabled true
shrinkResources true
2020-01-20 15:53:22 -08:00
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
2020-04-10 17:25:55 -07:00
debug {
pseudoLocalesEnabled true
}
2020-01-20 15:53:22 -08:00
}
2020-04-11 10:21:26 -07:00
defaultConfig {
// We have to list all translated languages here, because some of our libs have bogus languages that google play
// doesn't like and we need to strip them (gr)
resConfigs "cs", "de", "el", "en", "es", "fi", "fr", "ga", "ht", "it", "ja", "ko", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sq", "sv", "tr", "zh"
2020-04-11 13:20:30 -07:00
// Needed to make mapbox work inside the firebase testlab - FIXME, alas, still doesn't work
ndk {
// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
2020-04-11 10:21:26 -07:00
}
buildFeatures {
viewBinding true
}
// Set both the Java and Kotlin compilers to target Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
2020-02-10 07:40:45 -08:00
2021-02-21 10:59:51 +08:00
lintOptions {
abortOnError false
2020-02-10 07:40:45 -08:00
}
2020-01-20 15:53:22 -08:00
}
play {
// configure per https://github.com/Triple-T/gradle-play-publisher#authenticating-gradle-play-publisher
track = 'internal'
defaultToAppBundles = true
serviceAccountCredentials = file("../../play-credentials.json")
}
2020-02-09 07:28:24 -08:00
2020-01-22 18:32:21 -08:00
// per protobuf-gradle-plugin docs, this is recommended for android
protobuf {
protoc {
2021-02-27 09:49:25 +08:00
artifact = 'com.google.protobuf:protoc:3.15.3'
2020-01-22 18:32:21 -08:00
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
// turned off for now so I can use json printing in debug panel
2020-05-10 21:39:59 -07:00
// use the smaller android version of the library
//option "lite"
2020-01-22 18:32:21 -08:00
}
}
}
}
}
2020-01-20 15:53:22 -08:00
dependencies {
2020-09-23 22:47:45 -04:00
2021-05-09 09:02:53 +08:00
def room_version = '2.3.0'
2020-09-23 22:47:45 -04:00
2020-01-20 15:53:22 -08:00
implementation fileTree(dir: 'libs', include: ['*.jar'])
2021-06-10 09:29:14 -07:00
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.core:core-ktx:1.5.0'
2021-06-23 11:40:15 -07:00
implementation 'androidx.fragment:fragment-ktx:1.3.5'
2020-04-08 15:25:57 -07:00
implementation 'androidx.cardview:cardview:1.0.0'
2021-06-10 09:29:14 -07:00
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
2021-02-08 13:27:55 +08:00
implementation 'com.google.android.material:material:1.3.0'
2020-04-07 09:36:12 -07:00
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
2021-04-02 13:56:19 +08:00
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
2020-09-23 22:47:45 -04:00
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
2020-08-24 13:28:59 -07:00
2020-09-23 22:47:45 -04:00
// optional - Test helpers
testImplementation "androidx.room:room-testing:$room_version"
2021-03-02 14:19:44 +08:00
testImplementation 'junit:junit:4.13.2'
2020-08-30 12:27:10 -07:00
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// kotlin serialization
2020-08-18 11:25:16 -07:00
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:1.0-M1-1.4.0-rc"
2020-04-11 09:39:34 -07:00
// rate this app
implementation "com.vorlonsoft:androidrate:1.2.1"
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
2020-01-24 20:35:42 -08:00
// For now I'm not using javalite, because I want JSON printing
2021-04-15 12:17:23 +08:00
implementation ('com.google.protobuf:protobuf-java:3.15.8')
2020-03-11 18:13:44 -07:00
2020-06-05 11:53:50 -07:00
// For UART access
// implementation 'com.google.android.things:androidthings:1.0'
2020-08-18 11:34:25 -07:00
implementation 'com.github.mik3y:usb-serial-for-android:v3.0.0'
2020-06-05 11:53:50 -07:00
2020-03-11 14:45:49 -07:00
// mapbox
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.0'
2020-01-22 18:32:21 -08:00
// mapbox specifies a really old version of okhttp3 which causes lots of API warnings. trying a newer version
2020-09-20 20:40:15 -07:00
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
// location services
2021-02-27 09:49:25 +08:00
implementation 'com.google.android.gms:play-services-location:18.0.0'
2020-02-14 07:47:20 -08:00
// For Google Sign-In (owner name accesss)
implementation 'com.google.android.gms:play-services-auth:19.0.0'
2020-02-14 07:47:20 -08:00
2020-01-22 13:40:57 -08:00
// Add the Firebase SDK for Crashlytics.
2021-06-10 09:29:14 -07:00
implementation 'com.google.firebase:firebase-crashlytics:18.0.1'
2020-01-22 09:28:59 -08:00
// alas implementation bug deep in the bowels when I tried it for my SyncBluetoothDevice class
// implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3"
2020-01-22 09:28:59 -08:00
// add SDKs for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries
// barcode support
// per https://github.com/journeyapps/zxing-android-embedded for support of android version 22
implementation('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false }
2020-11-28 08:24:32 +08:00
implementation 'com.google.zxing:core:3.4.1'
2021-01-29 13:44:30 +08:00
def work_version = '2.5.0'
// Work Request - used to delay boot event handling
// implementation "androidx.work:work-runtime:$work_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
2020-01-21 20:32:19 -08:00
implementation project(':geeksville-androidlib')
2020-01-20 15:53:22 -08:00
}