Meshtastic-Android/app/build.gradle

225 lines
8.2 KiB
Groovy
Raw Normal View History

2022-10-04 00:12:39 -03:00
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-parcelize'
id 'kotlinx-serialization'
id 'dagger.hilt.android.plugin'
id 'com.github.triplet.play'
id 'de.mobilej.unmock'
// id "app.brant.amazonappstorepublisher"
2020-01-20 15:53:22 -08:00
2022-10-04 00:12:39 -03:00
// protobufs
id 'com.google.protobuf'
2020-01-22 13:40:57 -08:00
2022-10-04 00:12:39 -03:00
// Firebase Crashlytics
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
2020-09-23 22:47:45 -04:00
unMock {
keep "android.net.Uri"
keep "android.util.Base64"
}
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
2020-01-20 15:53:22 -08:00
android {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
2022-12-10 11:03:14 -03:00
compileSdkVersion 33
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)
2022-11-04 18:31:18 -03:00
targetSdkVersion 31
2023-01-12 18:06:07 -03:00
versionCode 30012 // format is Mmmss (where M is 1+the numeric major number
versionName "2.0.12"
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 {
if (keystoreProperties['storeFile']) {
signingConfig signingConfigs.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)
2022-12-10 11:03:14 -03:00
resConfigs "cs", "de", "el", "en", "es", "fi", "fr", "fr-rHT", "ga", "hu", "it", "ja", "ko", "nl", "nb", "pl", "pt", "pt-rBR", "ro", "ru", "sk", "sl", "sq", "sv", "tr", "zh", "uk"
2020-04-11 13:20:30 -07:00
ndk {
// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
2020-04-11 10:21:26 -07:00
}
buildFeatures {
viewBinding true
}
2022-11-02 15:34:56 -03:00
buildFeatures {
compose 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"
freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn']
}
2022-11-02 15:34:56 -03:00
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
2022-01-31 22:01:33 -03:00
lint {
2021-02-21 10:59:51 +08:00
abortOnError false
2020-02-10 07:40:45 -08:00
}
2022-11-02 15:38:26 -03:00
namespace 'com.geeksville.mesh'
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 {
artifact = 'com.google.protobuf:protoc:3.21.1'
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
}
2022-09-11 23:50:07 -03:00
kotlin {
}
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
2020-01-20 15:53:22 -08:00
implementation fileTree(dir: 'libs', include: ['*.jar'])
2022-12-10 11:03:14 -03:00
def appcompat_version = '1.6.0-rc01'
implementation "androidx.appcompat:appcompat:$appcompat_version"
// For loading and tinting drawables on older versions of the platform
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
2022-07-12 00:05:47 -03:00
implementation 'androidx.core:core-ktx:1.8.0'
2022-09-06 18:33:26 -03:00
implementation 'androidx.fragment:fragment-ktx:1.5.2'
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'
2022-07-12 00:05:47 -03:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.6.1'
2020-04-07 09:36:12 -07:00
implementation 'androidx.viewpager2:viewpager2:1.0.0'
2022-11-02 15:16:30 -03:00
// Lifecycle
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
2020-09-23 22:47:45 -04:00
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
2022-11-02 15:16:30 -03:00
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
2022-11-02 15:16:30 -03:00
implementation "androidx.datastore:datastore:$datastore_version"
2020-09-23 22:47:45 -04:00
2022-11-02 15:34:56 -03:00
// Compose
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "com.google.android.material:compose-theme-adapter:1.1.14"
2022-11-02 15:16:30 -03:00
// Osmdroid & Maps
implementation 'org.osmdroid:osmdroid-android:6.1.14'
2022-09-22 08:35:33 -04:00
implementation 'com.github.MKergall:osmbonuspack:6.9.0'
implementation 'org.osmdroid:osmdroid-wms:6.1.14'
api 'mil.nga.mgrs:mgrs-android:2.2.0'
2022-09-22 08:35:33 -04:00
implementation 'org.osmdroid:osmdroid-geopackage:6.1.14'
2020-09-23 22:47:45 -04:00
// 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'
2021-07-26 09:30:02 -07:00
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.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
2022-09-05 01:01:13 -03:00
implementation 'com.suddenh4x.ratingdialog:awesome-app-rating:2.4.0'
2020-04-11 09:39:34 -07:00
// 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
2022-09-11 23:50:07 -03:00
implementation 'com.google.protobuf:protobuf-kotlin:3.21.5'
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'
implementation 'com.github.mik3y:usb-serial-for-android:3.4.6'
2020-06-05 11:53:50 -07:00
2020-01-22 13:40:57 -08:00
// Add the Firebase SDK for Crashlytics.
2021-12-15 12:42:12 -03:00
implementation 'com.google.firebase:firebase-crashlytics:18.2.6'
2022-09-04 22:52:40 -03:00
implementation 'com.google.firebase:firebase-analytics:20.1.0'
// barcode support
// per https://github.com/journeyapps/zxing-android-embedded#older-sdk-versions for minSdkVersion 21
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
2022-02-09 22:48:59 -03:00
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.0' // <-- don't update
2021-12-26 23:25:38 -03:00
def work_version = '2.7.1'
// Work Request - used to delay boot event handling
implementation "androidx.work:work-runtime-ktx:$work_version"
2022-04-19 16:41:34 -03:00
implementation "androidx.core:core-splashscreen:1.0.0-beta02"
2022-02-04 00:57:27 -03:00
// App intro
implementation 'com.github.AppIntro:AppIntro:6.2.0'
2020-01-20 15:53:22 -08:00
}
kapt {
correctErrorTypes true
2022-04-08 19:37:53 -03:00
}
repositories {
maven { url "https://jitpack.io" }
2022-08-16 20:07:39 -03:00
}