milosmns/silly-android

View on GitHub
demo/build.gradle

Summary

Maintainability
Test Coverage
apply plugin: 'com.android.application'
// apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'checkstyle'
apply plugin: 'jacoco-android'

android {
    compileSdkVersion COMPILE_SDK
    buildToolsVersion BUILD_TOOLS

    defaultConfig {
        applicationId 'me.angrybyte.sillyandroid.demo'
        minSdkVersion MINIMUM_SDK
        targetSdkVersion TARGET_SDK
        versionCode VERSION_CODE
        versionName VERSION_NAME
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    // this is a demo app, don't worry about signing :)
    signingConfigs {
        release {
            keyAlias 'sillyandroid'
            keyPassword 'sillyandroid'
            storeFile file('../signing/keystore.jks')
            storePassword 'sillyandroid'
        }
    }

    // specific options for TravisCI emulators (they take a while to start)
    adbOptions {
        timeOutInMs 20 * 60 * 1000 // 20 minutes
        installOptions "-d", "-t"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    lintOptions {
        quiet false // turn off analysis progress reporting by lint
        abortOnError true // stop the gradle build if errors are found
        ignoreWarnings false // report all issues
        absolutePaths true // emit full/absolute paths to files with errors
        checkAllWarnings false // don't check all issues, including those that are off by default
        warningsAsErrors true // treat all warnings as errors
        disable 'UnusedResources', 'UnusedIds' // turn off checking for these
        // enable 'RtlHardcoded','RtlCompat', 'RtlEnabled' # don't re-enable anything, keep default config
        // check 'NewApi', 'InlinedApi' # don't check *only* these issues
        noLines false // include source code lines in the error output
        showAll true // show all locations for an error, do not truncate lists, etc.
        // lintConfig file("default-lint.xml") # don't use fallback lint configuration (default severities, etc.)
        textReport true // generate a text report of issues
        textOutput 'stdout' // location to write the output; can be a file or 'stdout'
        xmlReport false // don't generate an XML report for use by for example Jenkins
        // xmlOutput file("lint-report.xml") # don't change the file to write report to (if not specified, defaults to lint-results.xml)
        htmlReport true // generate an HTML report (with issue explanations, sourcecode, etc)
        // htmlOutput file("lint-report.html") # don't change the path to report (default will be lint-results.html in the build_dir)

        checkReleaseBuilds true // run lint on all release builds for issues with severity=fatal; abort the build (check 'abortOnError') if any are found
        // fatal 'NewApi', 'InlineApi' # don't change issue severities
        // error 'Wakelock', 'TextViewEdits' # don't change issue severities
        // warning 'ResourceAsColor' # don't change issue severities
        // ignore 'TypographyQuotes' # don't change issue severities
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    productFlavors {}
}

jacocoAndroidUnitTestReport {
    csv.enabled false
    html.enabled true
    xml.enabled true
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "com.android.support:appcompat-v7:$APPCOMPAT"

    // implementation "me.angrybyte.sillyandroid:sillyandroid:$VERSION_NAME" // global
    implementation project(':sillyandroid') // local all

    androidTestImplementation("com.android.support.test.espresso:espresso-core:$ESPRESSO", {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    testImplementation "junit:junit:$JUNIT"
    testImplementation "org.robolectric:robolectric:$ROBOLECTRIC"
    testImplementation "com.android.support:appcompat-v7:$APPCOMPAT"
    testImplementation "org.robolectric:shadows-supportv4:$ROBOLECTRIC"
}