summaryrefslogtreecommitdiff
path: root/build-system/integration-test/test-projects/ndkSanAngeles/build.gradle
blob: bbab4584464d3f553db78b8f78ef56d2d92f89a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
apply from: "../commonHeader.gradle"
buildscript { apply from: "../commonBuildScript.gradle" }

apply plugin: 'com.android.application'

project.ext['android.useDeprecatedNdk'] = true

android {
    namespace "com.example.SanAngeles"
    compileSdkVersion libs.versions.latestCompileSdk.get().toInteger()
    buildToolsVersion = libs.versions.buildToolsVersion.get()

    defaultConfig {
        minSdkVersion libs.versions.ndk19SupportLibMinSdk.get()
        ndk {
            moduleName "sanangeles"
            cFlags "-DANDROID_NDK -DDISABLE_IMPORTGL"
            ldLibs "GLESv1_CM", "dl", "log"
            stl "stlport_static"
            jobs 4
        }

        // This actual the app version code. Giving ourselves 1,000,000 values
        versionCode = 123
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes.debug.jniDebuggable true
    externalNativeBuild {
        ndkBuild {
            path "Android.mk"
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }
}

// map for the version code.
ext.versionCodes = ['armeabi-v7a':1, x86:2]

android.applicationVariants.all { variant ->
    // assign different version code for each output
    variant.outputs.all { output ->
        // set the versionCode on the output.
        println("Customizing " + output)
        def value
        if (output.getFilter(com.android.build.OutputFile.ABI)== null) {
            value = 3
        } else {
            value = project.ext.versionCodes.get(
                    output.getFilter(com.android.build.OutputFile.ABI))
        }
        output.versionCodeOverride = variant.versionCode + (value * 1000000)
    }
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation "com.android.support.test:runner:${libs.versions.testSupportLibVersion.get()}"
    androidTestImplementation "com.android.support.test:rules:${libs.versions.testSupportLibVersion.get()}"
}