meshtastic-android/app/build.gradle

277 wiersze
9.9 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlinx-serialization'
id 'com.google.dagger.hilt.android'
id 'de.mobilej.unmock'
id 'com.google.protobuf'
id "com.google.devtools.ksp"
}
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))
}
android {
namespace 'com.geeksville.mesh'
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
compileSdk 34
defaultConfig {
applicationId "com.geeksville.mesh"
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
targetSdk 33
versionCode 30310 // format is Mmmss (where M is 1+the numeric major number
versionName "2.3.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// per https://developer.android.com/studio/write/vector-asset-studio
vectorDrawables.useSupportLibrary = true
}
flavorDimensions = ['default']
productFlavors {
fdroid {
dimension = 'default'
dependenciesInfo {
includeInApk = false
}
}
google {
dimension = 'default'
if (useCrashlytics) {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
}
}
}
buildTypes {
release {
if (keystoreProperties['storeFile']) {
signingConfig signingConfigs.release
}
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
pseudoLocalesEnabled true
}
}
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 "bg", "cs", "de", "el", "en", "es", "fi", "fr", "fr-rHT", "ga", "hr", "hu", "is", "it", "iw", "ja", "ko", "lt", "nl", "nb", "pl", "pt", "pt-rBR", "ro", "ru", "sk", "sl", "sq", "sv", "tr", "zh-rCN", "zh-rTW", "uk"
ndk {
// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
bundle {
language {
enableSplit false
}
}
buildFeatures {
viewBinding true
compose true
aidl true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
// 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.
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn']
}
lint {
abortOnError false
}
}
// per protobuf-gradle-plugin docs, this is recommended for android
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobuf_version"
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
// turned off for now so I can use json printing in debug panel
// use the smaller android version of the library
//option "lite"
}
kotlin {
}
}
}
}
}
// 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)
}
}
})
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
def appcompat_version = '1.6.1'
implementation "androidx.appcompat:appcompat:$appcompat_version"
// For loading and tinting drawables on older versions of the platform
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
implementation "androidx.emoji2:emoji2-emojipicker:1.4.0"
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.fragment:fragment-ktx:1.7.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0'
implementation 'androidx.datastore:datastore:1.1.1'
// Lifecycle
def lifecycle_version = '2.7.0'
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-runtime-compose:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
// Room
def room_version = '2.6.1'
implementation "androidx.room:room-runtime:$room_version"
ksp "androidx.room:room-compiler:$room_version"
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
// optional - Test helpers
testImplementation "androidx.room:room-testing:$room_version"
// Hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
implementation "androidx.hilt:hilt-navigation-compose:1.2.0"
ksp "com.google.dagger:hilt-compiler:$hilt_version"
// Navigation
def nav_version = "2.7.7"
implementation "androidx.navigation:navigation-compose:$nav_version"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
// Compose
def composeBom = platform('androidx.compose:compose-bom:2024.05.00')
implementation composeBom
androidTestImplementation composeBom
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation 'androidx.compose.material:material'
implementation 'androidx.activity:activity-compose'
implementation 'androidx.compose.runtime:runtime-livedata'
implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.34.0"
// 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'
// Osmdroid & Maps
def osmdroid_version = '6.1.14'
implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
implementation "org.osmdroid:osmdroid-wms:$osmdroid_version"
implementation("org.osmdroid:osmdroid-geopackage:$osmdroid_version") {
exclude group: 'com.j256.ormlite'
}
implementation 'com.github.MKergall:osmbonuspack:6.9.0'
implementation "mil.nga:mgrs:2.1.3"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// kotlin serialization
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
// rate this app
googleImplementation 'com.suddenh4x.ratingdialog:awesome-app-rating:2.7.0'
// Coroutines
def coroutines_version = '1.8.1'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version"
// For now I'm not using javalite, because I want JSON printing
implementation "com.google.protobuf:protobuf-kotlin:$protobuf_version"
// For UART access
implementation 'com.github.mik3y:usb-serial-for-android:3.7.2'
// For Firebase Crashlytics & Analytics
googleImplementation platform('com.google.firebase:firebase-bom:33.0.0')
googleImplementation 'com.google.firebase:firebase-crashlytics'
googleImplementation 'com.google.firebase:firebase-analytics'
// 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 }
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.0' // <-- don't update
def work_version = '2.9.0'
// Work Request - used to delay boot event handling
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "androidx.core:core-splashscreen:1.0.1"
// CompletableFuture backport for API 14+
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
// App intro
implementation 'com.github.AppIntro:AppIntro:6.3.1'
// MQTT
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5"
}
ksp {
// arg("room.generateKotlin", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}
repositories {
maven { url "https://jitpack.io" }
}