meshtastic-android/app/build.gradle

244 wiersze
8.8 KiB
Groovy
Czysty Zwykły widok Historia

2022-10-04 03:12:39 +00:00
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
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 'de.mobilej.unmock'
id 'com.google.protobuf'
id 'kotlin-kapt'
2022-10-04 03:12:39 +00:00
}
2020-09-24 02:47:45 +00: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 23:53:22 +00:00
android {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
2022-12-10 14:03:14 +00:00
compileSdkVersion 33
2020-01-20 23:53:22 +00:00
defaultConfig {
2020-01-23 05:46:41 +00:00
applicationId "com.geeksville.mesh"
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
2022-11-04 21:31:18 +00:00
targetSdkVersion 31
2023-04-01 10:12:43 +00:00
versionCode 30105 // format is Mmmss (where M is 1+the numeric major number
versionName "2.1.5"
2020-01-20 23:53:22 +00:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
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-01-19 14:24:42 +00:00
flavorDimensions 'default'
productFlavors {
fdroid {
dimension = 'default'
}
google {
dimension = 'default'
if (project.findProperty("useCrashlytics") == true) {
println("useCrashlytics plugins $useCrashlytics")
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
}
}
}
2020-01-20 23:53:22 +00:00
buildTypes {
release {
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)
resConfigs "cs", "de", "el", "en", "es", "fi", "fr", "fr-rHT", "ga", "hu", "is", "it", "ja", "ko", "nl", "nb", "pl", "pt", "pt-rBR", "ro", "ru", "sk", "sl", "sq", "sv", "tr", "zh", "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
}
buildFeatures {
viewBinding true
}
2022-11-02 18:34:56 +00:00
buildFeatures {
compose true
}
2023-02-07 21:07:33 +00:00
composeOptions {
kotlinCompilerExtensionVersion = "1.4.4"
2023-02-07 21:07:33 +00:00
}
// 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-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
}
2022-11-02 18:38:26 +00:00
namespace 'com.geeksville.mesh'
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 {
// 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
//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
}
}
}
}
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'])
2023-02-13 21:30:10 +00:00
def appcompat_version = '1.6.1'
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"
2023-02-13 21:30:10 +00:00
implementation 'androidx.core:core-ktx:1.9.0'
2023-03-22 20:46:26 +00:00
implementation 'androidx.fragment:fragment-ktx:1.5.6'
2020-04-08 22:25:57 +00:00
implementation 'androidx.cardview:cardview:1.0.0'
2023-03-19 10:31:47 +00:00
implementation 'androidx.recyclerview:recyclerview:1.3.0'
2022-07-12 03:05:47 +00:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
2023-02-13 21:30:10 +00:00
implementation 'com.google.android.material:material:1.8.0'
2020-04-07 16:36:12 +00:00
implementation 'androidx.viewpager2:viewpager2:1.0.0'
2023-02-13 21:30:10 +00:00
implementation 'androidx.datastore:datastore:1.0.0'
2022-11-02 18:16:30 +00:00
// Lifecycle
2023-03-22 20:45:47 +00:00
def lifecycle_version = '2.6.1'
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"
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-03-22 20:45:19 +00:00
def room_version = '2.5.1'
2020-09-24 02:47:45 +00:00
implementation "androidx.room:room-runtime:$room_version"
2023-02-13 21:30:10 +00:00
annotationProcessor "androidx.room:room-compiler:$room_version"
2020-09-24 02:47:45 +00:00
kapt "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
testImplementation "androidx.room:room-testing:$room_version"
// Hilt
2022-11-02 18:16:30 +00:00
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
2020-09-24 02:47:45 +00:00
2022-11-02 18:34:56 +00:00
// Compose
2023-03-12 15:41:05 +00:00
def composeBom = platform('androidx.compose:compose-bom:2023.01.00')
2023-02-08 12:39:47 +00:00
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.runtime:runtime-livedata'
2023-03-12 15:41:05 +00:00
implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.29.2-rc"
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"
implementation "org.osmdroid:osmdroid-geopackage:$osmdroid_version"
2022-09-22 12:35:33 +00:00
implementation 'com.github.MKergall:osmbonuspack:6.9.0'
implementation('mil.nga.mgrs:mgrs-android:2.2.1') { exclude group: 'com.google.android.gms' }
2021-03-02 06:19:44 +00:00
testImplementation 'junit:junit:4.13.2'
2023-02-07 21:07:33 +00:00
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// kotlin serialization
2023-02-18 11:22:07 +00:00
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
2020-04-11 16:39:34 +00:00
// rate this app
googleImplementation 'com.suddenh4x.ratingdialog:awesome-app-rating:2.4.0'
2020-04-11 16:39:34 +00:00
// Coroutines
2023-02-13 21:30:10 +00:00
def coroutines_version = '1.6.4'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
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
// implementation 'com.google.android.things:androidthings:1.0'
implementation 'com.github.mik3y:usb-serial-for-android:3.4.6'
2020-06-05 18:53:50 +00:00
// location services
googleImplementation 'com.google.android.gms:play-services-location:19.0.1'
2023-01-19 14:24:42 +00:00
// For Firebase Crashlytics & Analytics
googleImplementation 'com.google.firebase:firebase-crashlytics:18.3.6'
googleImplementation 'com.google.firebase:firebase-analytics:21.2.1'
2022-09-05 01:52:40 +00:00
// 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-10 01:48:59 +00:00
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.0' // <-- don't update
2023-03-22 20:44:47 +00:00
def work_version = '2.8.1'
// Work Request - used to delay boot event handling
implementation "androidx.work:work-runtime-ktx:$work_version"
2023-03-27 18:28:09 +00:00
implementation "androidx.core:core-splashscreen:1.0.0"
2022-02-04 03:57:27 +00:00
// CompletableFuture backport for API 14+
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
// App intro
implementation 'com.github.AppIntro:AppIntro:6.2.0'
2020-01-20 23:53:22 +00:00
}
kapt {
correctErrorTypes true
2022-04-08 22:37:53 +00:00
}
repositories {
maven { url "https://jitpack.io" }
2022-08-16 23:07:39 +00:00
}