mobile/android/geckoview_example/build.gradle
author Ryan VanderMeulen <ryanvm@gmail.com>
Wed, 17 Jan 2018 15:55:38 -0500
changeset 451521 ef04f3ad847540c876c130b7d140a960d922a024
parent 451132 01836fd98c6351667c70cfd187cf1e3c437e1f94
child 454422 bc47964180063422d7c81e1d71aeac9946fa25b3
permissions -rw-r--r--
Backed out 20 changesets (bug 1411654) for incorrect android:debuggable. r=nalexander, a=RyanVM Backed out changeset cfad693be918 (bug 1411654) Backed out changeset 55776829a744 (bug 1411654) Backed out changeset c5bf85d56fed (bug 1411654) Backed out changeset c270f97bb0da (bug 1411654) Backed out changeset fde9bf9c14c3 (bug 1411654) Backed out changeset 01836fd98c63 (bug 1411654) Backed out changeset 730a70767743 (bug 1411654) Backed out changeset 690e265c684c (bug 1411654) Backed out changeset f918500d9cf5 (bug 1411654) Backed out changeset cec2b8828cc8 (bug 1411654) Backed out changeset 76085ddd5ac7 (bug 1411654) Backed out changeset 2b37201606f5 (bug 1411654) Backed out changeset d0d513d1c379 (bug 1411654) Backed out changeset e7b0cc801cf1 (bug 1411654) Backed out changeset 901b304603d9 (bug 1411654) Backed out changeset 373c9a71d945 (bug 1411654) Backed out changeset 3dc3beab95f8 (bug 1411654) Backed out changeset 22a861db1573 (bug 1411654) Backed out changeset 0850b319efd4 (bug 1411654) Backed out changeset d276d3deba05 (bug 1411654)

buildDir "${topobjdir}/gradle/build/mobile/android/geckoview_example"

apply plugin: 'com.android.application'

android {
    compileSdkVersion project.ext.compileSdkVersion
    buildToolsVersion project.ext.buildToolsVersion

    defaultConfig {
        targetSdkVersion project.ext.targetSdkVersion
        minSdkVersion project.ext.minSdkVersion
        manifestPlaceholders = project.ext.manifestPlaceholders

        applicationId "org.mozilla.geckoview_example"
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    // This is extremely frustrating, but the only way to do it automation for
    // now.  Without this, we only get a "debugAndroidTest" configuration; we
    // have no "withoutGeckoBinariesAndroidTest" configuration.
    testBuildType "withoutGeckoBinaries"
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        withGeckoBinaries { // For consistency with :geckoview project in Task Cluster invocations.
            initWith debug
        }
        withoutGeckoBinaries { // Logical negation of withGeckoBinaries.
            initWith debug
        }
    }
}

dependencies {
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:support-annotations:23.4.0'

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    // Not defining this library again results in test-app assuming 23.1.1, and the following errors:
    // "Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.4.0) and test app (23.1.1) differ."
    androidTestCompile 'com.android.support:support-annotations:23.4.0'

    debugCompile project(path: ':geckoview', configuration: "debug")
    releaseCompile project(path: ':geckoview', configuration: "release")
    withGeckoBinariesCompile project(path: ':geckoview', configuration: "withGeckoBinaries")
    withoutGeckoBinariesCompile project(path: ':geckoview', configuration: "withoutGeckoBinaries")
}

apply from: "${topsrcdir}/mobile/android/gradle/with_gecko_binaries.gradle"

android.applicationVariants.all { variant ->
    // Like 'debug', 'release', or 'withoutGeckoBinaries'.
    def buildType = variant.buildType.name

    // It would be most natural for :geckoview to always include the Gecko
    // binaries, but that's difficult; see the notes in
    // mobile/android/gradle/with_gecko_binaries.gradle.  Instead we handle our
    // own Gecko binary inclusion.
    if (!buildType.equals('withoutGeckoBinaries')) {
        configureVariantWithGeckoBinaries(variant)
    }
}