2022-10-04 03:12:39 +00:00
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
2024-06-30 14:11:11 +00:00
|
|
|
id "org.jetbrains.kotlin.android"
|
|
|
|
id "org.jetbrains.kotlin.plugin.compose"
|
|
|
|
id "org.jetbrains.kotlin.plugin.parcelize"
|
2022-10-04 03:12:39 +00:00
|
|
|
id 'kotlinx-serialization'
|
2023-02-13 21:30:10 +00:00
|
|
|
id 'com.google.dagger.hilt.android'
|
2022-10-04 03:12:39 +00:00
|
|
|
id 'com.google.protobuf'
|
2023-09-05 09:21:08 +00:00
|
|
|
id "com.google.devtools.ksp"
|
2024-09-08 17:11:14 +00:00
|
|
|
id "io.gitlab.arturbosch.detekt" version "1.23.7"
|
2022-10-04 03:12:39 +00:00
|
|
|
}
|
2020-09-24 02:47:45 +00:00
|
|
|
|
2021-12-09 17:53:33 +00:00
|
|
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
|
|
}
|
|
|
|
|
2020-01-20 23:53:22 +00:00
|
|
|
android {
|
2023-08-27 09:38:36 +00:00
|
|
|
namespace 'com.geeksville.mesh'
|
|
|
|
|
2020-07-20 19:07:55 +00:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2021-12-09 17:53:33 +00:00
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|
keyPassword keystoreProperties['keyPassword']
|
|
|
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
|
|
storePassword keystoreProperties['storePassword']
|
2020-07-20 19:07:55 +00:00
|
|
|
}
|
2021-12-09 17:53:33 +00:00
|
|
|
}
|
2024-11-04 16:00:04 +00:00
|
|
|
compileSdk 35
|
2020-01-20 23:53:22 +00:00
|
|
|
defaultConfig {
|
2020-01-23 05:46:41 +00:00
|
|
|
applicationId "com.geeksville.mesh"
|
2020-06-11 00:13:26 +00:00
|
|
|
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
|
2024-07-21 12:59:37 +00:00
|
|
|
targetSdk 34
|
2025-02-16 23:59:36 +00:00
|
|
|
versionCode 30517 // format is Mmmss (where M is 1+the numeric major number
|
|
|
|
versionName "2.5.17"
|
2024-07-28 12:02:17 +00:00
|
|
|
testInstrumentationRunner "com.geeksville.mesh.TestRunner"
|
2021-01-30 06:44:55 +00:00
|
|
|
|
|
|
|
// per https://developer.android.com/studio/write/vector-asset-studio
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
2020-01-20 23:53:22 +00:00
|
|
|
}
|
2023-08-27 09:38:36 +00:00
|
|
|
flavorDimensions = ['default']
|
2023-01-19 14:24:42 +00:00
|
|
|
productFlavors {
|
|
|
|
fdroid {
|
|
|
|
dimension = 'default'
|
2024-02-12 21:24:32 +00:00
|
|
|
dependenciesInfo {
|
|
|
|
includeInApk = false
|
|
|
|
}
|
2023-01-19 14:24:42 +00:00
|
|
|
}
|
|
|
|
google {
|
|
|
|
dimension = 'default'
|
2023-11-28 22:59:27 +00:00
|
|
|
if (useCrashlytics) {
|
2023-01-19 14:24:42 +00:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
apply plugin: 'com.google.firebase.crashlytics'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-20 23:53:22 +00:00
|
|
|
buildTypes {
|
|
|
|
release {
|
2021-12-09 17:53:33 +00:00
|
|
|
if (keystoreProperties['storeFile']) {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
2020-04-14 00:01:29 +00:00
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true
|
2020-01-20 23:53:22 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
2020-04-11 00:25:55 +00:00
|
|
|
debug {
|
|
|
|
pseudoLocalesEnabled true
|
|
|
|
}
|
2020-01-20 23:53:22 +00:00
|
|
|
}
|
2020-04-11 17:21:26 +00: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)
|
2024-12-22 09:47:54 +00:00
|
|
|
resConfigs "bg", "ca", "cs", "de", "el", "en", "es", "et", "fi", "fr", "fr-rHT", "ga", "gl", "hr", "hu", "is", "it", "iw", "ja", "ko", "lt", "nl", "nb", "pl", "pt", "pt-rBR", "ro", "ru", "sk", "sl", "sq", "sr", "sv", "tr", "zh-rCN", "zh-rTW", "uk"
|
2020-04-11 20:20:30 +00:00
|
|
|
|
|
|
|
ndk {
|
|
|
|
// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
|
|
}
|
2020-04-11 17:21:26 +00:00
|
|
|
}
|
2023-10-08 22:06:13 +00:00
|
|
|
bundle {
|
|
|
|
language {
|
|
|
|
enableSplit false
|
|
|
|
}
|
|
|
|
}
|
2020-01-22 03:16:03 +00:00
|
|
|
buildFeatures {
|
2020-12-07 12:33:29 +00:00
|
|
|
viewBinding true
|
2022-11-02 18:34:56 +00:00
|
|
|
compose true
|
2023-07-27 09:08:30 +00:00
|
|
|
aidl true
|
2024-01-10 21:52:05 +00:00
|
|
|
buildConfig true
|
2022-11-02 18:34:56 +00:00
|
|
|
}
|
2023-07-27 09:08:30 +00:00
|
|
|
// Configure the build-logic plugins to target JDK 17
|
|
|
|
// This matches the JDK used to build the project, and is not related to what is running on device.
|
2020-01-22 03:16:03 +00:00
|
|
|
compileOptions {
|
2023-07-27 09:08:30 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2020-01-22 03:16:03 +00:00
|
|
|
}
|
|
|
|
kotlinOptions {
|
2023-07-27 09:08:30 +00:00
|
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
2022-08-24 00:05:19 +00:00
|
|
|
freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn']
|
2020-01-22 03:16:03 +00:00
|
|
|
}
|
2022-02-01 01:01:33 +00:00
|
|
|
lint {
|
2021-02-21 02:59:51 +00:00
|
|
|
abortOnError false
|
2020-02-10 15:40:45 +00:00
|
|
|
}
|
2024-08-04 14:40:33 +00:00
|
|
|
sourceSets {
|
|
|
|
// Adds exported schema location as test app assets.
|
|
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
|
|
}
|
2020-01-20 23:53:22 +00:00
|
|
|
}
|
|
|
|
|
2020-01-23 02:32:21 +00:00
|
|
|
// per protobuf-gradle-plugin docs, this is recommended for android
|
|
|
|
protobuf {
|
|
|
|
protoc {
|
2023-02-07 21:07:33 +00:00
|
|
|
artifact = "com.google.protobuf:protoc:$protobuf_version"
|
2020-01-23 02:32:21 +00:00
|
|
|
}
|
|
|
|
generateProtoTasks {
|
|
|
|
all().each { task ->
|
|
|
|
task.builtins {
|
|
|
|
java {
|
2020-10-01 20:59:34 +00:00
|
|
|
// turned off for now so I can use json printing in debug panel
|
2020-05-11 04:39:59 +00:00
|
|
|
// use the smaller android version of the library
|
2020-10-01 20:59:34 +00:00
|
|
|
//option "lite"
|
2020-01-23 02:32:21 +00:00
|
|
|
}
|
2022-09-12 02:50:07 +00:00
|
|
|
kotlin {
|
|
|
|
}
|
2020-01-23 02:32:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-10 20:19:23 +00:00
|
|
|
// workaround for https://github.com/google/ksp/issues/1590
|
|
|
|
androidComponents {
|
|
|
|
onVariants(selector().all(), { variant ->
|
|
|
|
afterEvaluate {
|
|
|
|
def capName = variant.name.capitalize()
|
|
|
|
tasks.getByName("ksp${capName}Kotlin") {
|
|
|
|
setSource(tasks.getByName("generate${capName}Proto").outputs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-01-20 23:53:22 +00:00
|
|
|
dependencies {
|
2020-09-24 02:47:45 +00:00
|
|
|
|
2020-01-20 23:53:22 +00:00
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
2024-05-29 19:10:39 +00:00
|
|
|
def appcompat_version = '1.7.0'
|
2022-12-10 14:03:14 +00:00
|
|
|
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
|
|
|
// For loading and tinting drawables on older versions of the platform
|
|
|
|
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
|
2024-09-05 01:07:50 +00:00
|
|
|
implementation "androidx.emoji2:emoji2-emojipicker:1.5.0"
|
2022-12-10 14:03:14 +00:00
|
|
|
|
2024-11-04 16:04:38 +00:00
|
|
|
implementation 'androidx.core:core-ktx:1.15.0'
|
2024-10-16 18:20:11 +00:00
|
|
|
implementation 'androidx.core:core-location-altitude:1.0.0-alpha03'
|
2025-02-16 03:01:04 +00:00
|
|
|
implementation 'androidx.fragment:fragment-ktx:1.8.6'
|
2020-04-08 22:25:57 +00:00
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
2024-10-30 21:10:18 +00:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
2024-05-02 19:10:25 +00:00
|
|
|
implementation 'com.google.android.material:material:1.12.0'
|
2024-05-15 03:30:43 +00:00
|
|
|
implementation 'androidx.viewpager2:viewpager2:1.1.0'
|
2025-02-16 02:51:38 +00:00
|
|
|
implementation 'androidx.datastore:datastore:1.1.2'
|
2022-11-02 18:16:30 +00:00
|
|
|
|
|
|
|
// Lifecycle
|
2024-10-30 18:32:25 +00:00
|
|
|
def lifecycle_version = '2.8.7'
|
2022-11-02 18:16:30 +00:00
|
|
|
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"
|
2023-04-10 23:29:47 +00:00
|
|
|
implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycle_version"
|
2022-11-02 18:16:30 +00:00
|
|
|
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
|
|
|
|
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
|
|
|
|
|
2023-02-13 21:30:10 +00:00
|
|
|
// Room
|
2023-11-29 20:14:52 +00:00
|
|
|
def room_version = '2.6.1'
|
2020-09-24 02:47:45 +00:00
|
|
|
implementation "androidx.room:room-runtime:$room_version"
|
2023-09-05 09:21:08 +00:00
|
|
|
ksp "androidx.room:room-compiler:$room_version"
|
2023-02-13 21:30:10 +00:00
|
|
|
// optional - Kotlin Extensions and Coroutines support for Room
|
|
|
|
implementation "androidx.room:room-ktx:$room_version"
|
|
|
|
// optional - Test helpers
|
2024-08-04 14:40:33 +00:00
|
|
|
androidTestImplementation "androidx.room:room-testing:$room_version"
|
2023-02-13 21:30:10 +00:00
|
|
|
|
|
|
|
// Hilt
|
2022-11-02 18:16:30 +00:00
|
|
|
implementation "com.google.dagger:hilt-android:$hilt_version"
|
2024-02-21 21:17:48 +00:00
|
|
|
implementation "androidx.hilt:hilt-navigation-compose:1.2.0"
|
2023-09-05 09:21:08 +00:00
|
|
|
ksp "com.google.dagger:hilt-compiler:$hilt_version"
|
2024-07-28 12:02:17 +00:00
|
|
|
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
|
|
|
|
kspAndroidTest "com.google.dagger:hilt-compiler:$hilt_version"
|
2020-09-24 02:47:45 +00:00
|
|
|
|
2023-04-17 20:13:26 +00:00
|
|
|
// Navigation
|
2025-02-16 02:20:15 +00:00
|
|
|
def nav_version = "2.8.7"
|
2023-04-17 20:13:26 +00:00
|
|
|
implementation "androidx.navigation:navigation-compose:$nav_version"
|
|
|
|
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
|
|
|
|
|
2022-11-02 18:34:56 +00:00
|
|
|
// Compose
|
2025-02-15 18:26:01 +00:00
|
|
|
def composeBom = platform('androidx.compose:compose-bom:2025.02.00')
|
2023-02-08 12:39:47 +00:00
|
|
|
implementation composeBom
|
|
|
|
androidTestImplementation composeBom
|
|
|
|
|
|
|
|
implementation 'androidx.compose.material:material'
|
2024-09-21 01:05:51 +00:00
|
|
|
implementation 'androidx.compose.material:material-icons-extended'
|
2023-04-07 15:43:29 +00:00
|
|
|
implementation 'androidx.activity:activity-compose'
|
2023-02-08 12:39:47 +00:00
|
|
|
implementation 'androidx.compose.runtime:runtime-livedata'
|
|
|
|
|
2025-02-16 12:09:41 +00:00
|
|
|
// Immutable Collections (for Compose UI State)
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.8")
|
|
|
|
|
2023-02-08 12:39:47 +00:00
|
|
|
// Android Studio Preview support
|
|
|
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
|
|
|
debugImplementation 'androidx.compose.ui:ui-tooling'
|
|
|
|
|
|
|
|
// UI Tests
|
|
|
|
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
|
|
|
|
debugImplementation 'androidx.compose.ui:ui-test-manifest'
|
2022-11-02 18:34:56 +00:00
|
|
|
|
2022-11-02 18:16:30 +00:00
|
|
|
// Osmdroid & Maps
|
2023-02-07 21:07:33 +00:00
|
|
|
def osmdroid_version = '6.1.14'
|
|
|
|
implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
|
|
|
|
implementation "org.osmdroid:osmdroid-wms:$osmdroid_version"
|
2023-07-09 11:15:00 +00:00
|
|
|
implementation("org.osmdroid:osmdroid-geopackage:$osmdroid_version") {
|
2023-06-24 10:58:01 +00:00
|
|
|
exclude group: 'com.j256.ormlite'
|
|
|
|
}
|
2022-09-22 12:35:33 +00:00
|
|
|
implementation 'com.github.MKergall:osmbonuspack:6.9.0'
|
2024-04-04 02:14:34 +00:00
|
|
|
implementation "mil.nga:mgrs:2.1.3"
|
2022-08-24 00:05:19 +00:00
|
|
|
|
2021-03-02 06:19:44 +00:00
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2024-06-30 10:33:04 +00:00
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
2024-06-27 01:42:10 +00:00
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
2020-01-22 03:16:03 +00:00
|
|
|
|
2020-04-20 00:25:20 +00:00
|
|
|
// kotlin serialization
|
2025-02-15 23:24:13 +00:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0"
|
2020-04-20 00:25:20 +00:00
|
|
|
|
2020-04-11 16:39:34 +00:00
|
|
|
// rate this app
|
2025-02-16 02:01:47 +00:00
|
|
|
googleImplementation 'com.suddenh4x.ratingdialog:awesome-app-rating:2.8.0'
|
2020-04-11 16:39:34 +00:00
|
|
|
|
2020-04-04 21:37:44 +00:00
|
|
|
// Coroutines
|
2025-02-15 23:41:48 +00:00
|
|
|
def coroutines_version = '1.10.1'
|
2020-04-04 21:37:44 +00:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
2023-06-24 10:58:01 +00:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version"
|
2020-04-04 21:37:44 +00:00
|
|
|
|
2020-01-25 04:35:42 +00:00
|
|
|
// For now I'm not using javalite, because I want JSON printing
|
2023-02-07 21:07:33 +00:00
|
|
|
implementation "com.google.protobuf:protobuf-kotlin:$protobuf_version"
|
2020-03-12 01:13:44 +00:00
|
|
|
|
2020-06-05 18:53:50 +00:00
|
|
|
// For UART access
|
2024-10-30 16:03:21 +00:00
|
|
|
implementation 'com.github.mik3y:usb-serial-for-android:3.8.1'
|
2020-06-05 18:53:50 +00:00
|
|
|
|
2023-01-19 14:24:42 +00:00
|
|
|
// For Firebase Crashlytics & Analytics
|
2025-02-15 22:40:30 +00:00
|
|
|
googleImplementation platform('com.google.firebase:firebase-bom:33.9.0')
|
2024-02-08 19:45:28 +00:00
|
|
|
googleImplementation 'com.google.firebase:firebase-crashlytics'
|
|
|
|
googleImplementation 'com.google.firebase:firebase-analytics'
|
2022-09-05 01:52:40 +00:00
|
|
|
|
2020-03-02 15:46:03 +00:00
|
|
|
// barcode support
|
2022-01-10 03:33:26 +00:00
|
|
|
// 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-10 01:48:59 +00:00
|
|
|
//noinspection GradleDependency
|
2022-01-10 03:33:26 +00:00
|
|
|
implementation 'com.google.zxing:core:3.3.0' // <-- don't update
|
2020-03-02 15:46:03 +00:00
|
|
|
|
2024-11-04 16:04:41 +00:00
|
|
|
def work_version = '2.10.0'
|
2020-05-11 20:12:44 +00:00
|
|
|
// Work Request - used to delay boot event handling
|
|
|
|
implementation "androidx.work:work-runtime-ktx:$work_version"
|
|
|
|
|
2023-05-08 20:35:10 +00:00
|
|
|
implementation "androidx.core:core-splashscreen:1.0.1"
|
2022-02-04 03:57:27 +00:00
|
|
|
|
2023-01-27 01:41:58 +00:00
|
|
|
// CompletableFuture backport for API 14+
|
|
|
|
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
|
|
|
|
|
2022-08-10 16:12:49 +00:00
|
|
|
// App intro
|
2023-08-31 02:34:40 +00:00
|
|
|
implementation 'com.github.AppIntro:AppIntro:6.3.1'
|
2023-10-12 20:52:52 +00:00
|
|
|
|
|
|
|
// MQTT
|
|
|
|
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5"
|
2024-07-03 02:01:51 +00:00
|
|
|
|
2024-09-09 09:15:27 +00:00
|
|
|
// detekt ktlint formatting
|
2025-02-22 17:07:10 +00:00
|
|
|
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
|
2020-01-20 23:53:22 +00:00
|
|
|
}
|
2022-02-08 21:50:21 +00:00
|
|
|
|
2023-09-05 09:21:08 +00:00
|
|
|
ksp {
|
|
|
|
// arg("room.generateKotlin", "true")
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
2022-04-08 22:37:53 +00:00
|
|
|
}
|
2022-08-10 16:12:49 +00:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven { url "https://jitpack.io" }
|
2022-08-16 23:07:39 +00:00
|
|
|
}
|
2024-07-03 02:01:51 +00:00
|
|
|
|
|
|
|
detekt {
|
|
|
|
config.setFrom("../config/detekt/detekt.yml")
|
|
|
|
baseline = file("../config/detekt/detekt-baseline.xml")
|
2024-09-21 01:05:51 +00:00
|
|
|
}
|