btelman96/letsrobot-android

View on GitHub
app/build.gradle

Summary

Maintainability
Test Coverage
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    buildToolsVersion = globalBuildToolsVersion
    defaultConfig {
        buildConfigField "String", "GitHash", "\"${gitHash}\""
        applicationId "tv.letsrobot.controller.android"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode buildNumber
        versionName versionSemantic
        versionNameSuffix '(' + versionCode + ')-' + gitHash
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            def buildTypeName = variant.buildType.name
            if (buildTypeName == "debug") {
                //we want newer debug builds to overwrite old ones. We also don't care about version code
                outputFileName = output.outputFile.name.replace(".apk", "-${versionSemantic}.apk").replace("app", "LetsRobotController")
            } else {
                outputFileName = output.outputFile.name.replace(".apk", "-${variant.versionName}.apk").replace("app", "LetsRobotController")
            }
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    // Required for instrumented tests
    androidTestImplementation 'androidx.annotation:annotation:1.0.2'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test:rules:1.1.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1"

    def nav_version = "2.0.0"
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    // For Kotlin use navigation-fragment-ktx
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
    // For Kotlin use navigation-ui-ktx
    implementation "androidx.preference:preference-ktx:1.1.0-alpha04"

    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    androidTestImplementation "androidx.test.ext:junit:1.1.0"
    implementation 'com.google.zxing:core:3.3.3'

    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
    // Optional, if you use support library fragments:
    debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
    implementation project(path: ':licensehelper')

    implementation project(':letsrobotandroid-api')
}
repositories {
    google()
    mavenCentral()
}