summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/build.gradle
blob: b17fa91d048a91b66ee4f7e2ebc319d7e4f79dca (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apply plugin: 'com.android.library'

ext {
    supportLibVersion = '25.0.0'
}

dependencies {
    compile "com.android.support:support-annotations:${supportLibVersion}"
    compile "com.android.support:support-v4:${supportLibVersion}"
    compile "com.android.support:design:${supportLibVersion}"
    compile 'com.squareup.okhttp3:okhttp:3.5.0'
    compile 'com.mapzen.android:lost:1.1.1'
    compile 'com.jakewharton.timber:timber:4.3.1'

    // Mapbox Android Services
    compile('com.mapbox.mapboxsdk:mapbox-java-services:1.3.1@jar') {
        transitive = true
    }
}

android {
    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

    defaultConfig {
        minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
        buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT_BASE", String.format("\"MapboxEventsAndroid/%s\"", project.VERSION_NAME)
        buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
        buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
    }

    android {
        // avoid naming conflicts, force usage of prefix
        resourcePrefix 'mapbox_'
    }

    sourceSets {
        // limit amount of exposed library resources
        main.res.srcDirs += 'src/main/res-public'
    }

    repositories {
        mavenCentral()
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    lintOptions {
        checkAllWarnings true
        warningsAsErrors true
    }

    buildTypes {
        debug {
            jniDebuggable true
        }

        release {
            // aar proguard configuration
            consumerProguardFiles 'proguard-rules.pro'
            jniDebuggable false
        }
    }
}

def getGitRevision() {
    def cmd = "git rev-parse --short HEAD"
    def proc = cmd.execute()
    def ref = proc.text.trim()
    return ref
}

configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
    all*.exclude group: 'commons-collections', module: 'commons-collections'
}

apply from: 'gradle-javadoc.gradle'
apply from: 'gradle-publish.gradle'
apply from: 'gradle-checkstyle.gradle'