summaryrefslogtreecommitdiff
path: root/build-system/tests/ndkSanAngeles/build.gradle
blob: 6b48d792451c0c48725e8992d6116fb4d6ff67de (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
68
buildscript {
    repositories {
        maven { url '../../../../../out/repo' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        ndk {
            moduleName "sanangeles"
            cFlags "-DANDROID_NDK -DDISABLE_IMPORTGL"
            ldLibs "GLESv1_CM", "dl", "log"
            stl "stlport_static"
        }

        // This actual the app version code. Giving ourselves 1,000,000 values
        versionCode = 123

    }

    buildTypes.debug.jniDebugBuild true

    productFlavors {
        x86 {
            ndk {
                abiFilter "x86"
            }

            // this is the flavor part of the version code.
            // It must be higher than the arm one for devices supporting
            // both, as x86 is preferred.
            versionCode = 3
        }
        arm {
            ndk {
                abiFilter "armeabi-v7a"
            }
            versionCode = 2
        }
        mips {
            ndk {
                abiFilter "mips"
            }
            versionCode = 1
        }
        fat {
            // fat binary, lowest version code to be
            // the last option
            versionCode = 0
        }
    }

    // make per-variant version code
    applicationVariants.all { variant ->
        // get the single flavor
        def flavorVersion = variant.productFlavors.get(0).versionCode

        // set the composite code
        variant.mergedFlavor.versionCode = flavorVersion * 1000000 + defaultConfig.versionCode
    }
}