sforkowany z mirror/meshtastic-android
				
			
		
			
				
	
	
		
			202 wiersze
		
	
	
		
			6.9 KiB
		
	
	
	
		
			Groovy
		
	
	
			
		
		
	
	
			202 wiersze
		
	
	
		
			6.9 KiB
		
	
	
	
		
			Groovy
		
	
	
apply plugin: 'com.android.application'
 | 
						|
apply plugin: 'kotlin-android'
 | 
						|
apply plugin: 'kotlin-parcelize'
 | 
						|
apply plugin: 'kotlinx-serialization'
 | 
						|
apply plugin: 'dagger.hilt.android.plugin'
 | 
						|
apply plugin: 'com.github.triplet.play'
 | 
						|
apply plugin: 'de.mobilej.unmock'
 | 
						|
// apply plugin: "app.brant.amazonappstorepublisher"
 | 
						|
 | 
						|
// Firebase Crashlytics
 | 
						|
apply plugin: 'com.google.gms.google-services'
 | 
						|
apply plugin: 'com.google.firebase.crashlytics'
 | 
						|
 | 
						|
// protobuf
 | 
						|
apply plugin: 'com.google.protobuf'
 | 
						|
 | 
						|
apply plugin: 'kotlin-kapt'
 | 
						|
 | 
						|
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 {
 | 
						|
    signingConfigs {
 | 
						|
        release {
 | 
						|
            keyAlias keystoreProperties['keyAlias']
 | 
						|
            keyPassword keystoreProperties['keyPassword']
 | 
						|
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
 | 
						|
            storePassword keystoreProperties['storePassword']
 | 
						|
        }
 | 
						|
    }
 | 
						|
    compileSdkVersion 32
 | 
						|
    // leave undefined to use version plugin wants
 | 
						|
    defaultConfig {
 | 
						|
        applicationId "com.geeksville.mesh"
 | 
						|
        minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
 | 
						|
        targetSdkVersion 30
 | 
						|
        versionCode 20341 // format is Mmmss (where M is 1+the numeric major number
 | 
						|
        versionName "1.3.41"
 | 
						|
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 | 
						|
 | 
						|
        // per https://developer.android.com/studio/write/vector-asset-studio
 | 
						|
        vectorDrawables.useSupportLibrary = true
 | 
						|
    }
 | 
						|
    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 "cs", "de", "el", "en", "es", "fi", "fr", "ga", "ht", "it", "ja", "ko-rKR", "nl", "no", "pl", "pt", "pt-rBR", "ro", "ru", "sk", "sl", "sq", "sv", "tr", "zh"
 | 
						|
 | 
						|
        ndk {
 | 
						|
            // abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    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"
 | 
						|
        freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn']
 | 
						|
    }
 | 
						|
    lint {
 | 
						|
        abortOnError false
 | 
						|
    }
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
play {
 | 
						|
    // configure per https://github.com/Triple-T/gradle-play-publisher#authenticating-gradle-play-publisher
 | 
						|
    track = 'internal'
 | 
						|
    defaultToAppBundles = true
 | 
						|
    serviceAccountCredentials = file("../../play-credentials.json")
 | 
						|
}
 | 
						|
 | 
						|
// per protobuf-gradle-plugin docs, this is recommended for android
 | 
						|
protobuf {
 | 
						|
    protoc {
 | 
						|
        artifact = 'com.google.protobuf:protoc:3.21.1'
 | 
						|
    }
 | 
						|
    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 {
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
dependencies {
 | 
						|
 | 
						|
    implementation fileTree(dir: 'libs', include: ['*.jar'])
 | 
						|
    implementation 'androidx.appcompat:appcompat:1.5.0'
 | 
						|
    implementation 'androidx.core:core-ktx:1.8.0'
 | 
						|
    implementation 'androidx.fragment:fragment-ktx:1.5.2'
 | 
						|
    implementation 'androidx.cardview:cardview:1.0.0'
 | 
						|
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
 | 
						|
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
 | 
						|
    implementation 'com.google.android.material:material:1.6.1'
 | 
						|
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
 | 
						|
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
 | 
						|
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
 | 
						|
    implementation "androidx.room:room-runtime:$room_version"
 | 
						|
    implementation "com.google.dagger:hilt-android:$hilt_version"
 | 
						|
    implementation "androidx.datastore:datastore:$datastore_version"
 | 
						|
    kapt "androidx.room:room-compiler:$room_version"
 | 
						|
    kapt "com.google.dagger:hilt-compiler:$hilt_version"
 | 
						|
 | 
						|
    //OSMDROID, mgrs,
 | 
						|
    implementation 'org.osmdroid:osmdroid-android:6.1.14'
 | 
						|
    implementation 'com.github.MKergall:osmbonuspack:6.9.0'
 | 
						|
    implementation 'mil.nga:mgrs:2.0.0'
 | 
						|
    implementation 'org.osmdroid:osmdroid-geopackage:6.1.14'
 | 
						|
 | 
						|
    // 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"
 | 
						|
    testImplementation 'junit:junit:4.13.2'
 | 
						|
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
 | 
						|
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
 | 
						|
 | 
						|
    // kotlin serialization
 | 
						|
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:1.0-M1-1.4.0-rc"
 | 
						|
 | 
						|
    // rate this app
 | 
						|
    implementation 'com.suddenh4x.ratingdialog:awesome-app-rating:2.4.0'
 | 
						|
 | 
						|
    // Coroutines
 | 
						|
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
 | 
						|
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
 | 
						|
 | 
						|
    // For now I'm not using javalite, because I want JSON printing
 | 
						|
    implementation 'com.google.protobuf:protobuf-kotlin:3.21.5'
 | 
						|
 | 
						|
    // For UART access
 | 
						|
    // implementation 'com.google.android.things:androidthings:1.0'
 | 
						|
    implementation 'com.github.mik3y:usb-serial-for-android:3.4.6'
 | 
						|
 | 
						|
    // Add the Firebase SDK for Crashlytics.
 | 
						|
    implementation 'com.google.firebase:firebase-crashlytics:18.2.6'
 | 
						|
    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 }
 | 
						|
    //noinspection GradleDependency
 | 
						|
    implementation 'com.google.zxing:core:3.3.0' // <-- don't update
 | 
						|
 | 
						|
    def work_version = '2.7.1'
 | 
						|
    // Work Request - used to delay boot event handling
 | 
						|
    implementation "androidx.work:work-runtime-ktx:$work_version"
 | 
						|
 | 
						|
    implementation "androidx.core:core-splashscreen:1.0.0-beta02"
 | 
						|
 | 
						|
    // App intro
 | 
						|
    implementation 'com.github.AppIntro:AppIntro:6.2.0'
 | 
						|
}
 | 
						|
 | 
						|
kapt {
 | 
						|
    correctErrorTypes true
 | 
						|
}
 | 
						|
 | 
						|
repositories {
 | 
						|
    maven { url "https://jitpack.io" }
 | 
						|
}
 |