summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/build.gradle')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/build.gradle126
1 files changed, 27 insertions, 99 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
index f5f4ec3f54..318f891127 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
+++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
@@ -1,43 +1,22 @@
-apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
-apply plugin: 'checkstyle'
-apply plugin: 'devicefarm'
-
-task accessToken {
- def tokenFile = new File("MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml")
- if (!tokenFile.exists()) {
- String tokenFileContents = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- " <string name=\"mapbox_access_token\">" + "$System.env.MAPBOX_ACCESS_TOKEN" + "</string>\n" +
- "</resources>"
-
- if (tokenFileContents == null) {
- throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
- }
- tokenFile.write(tokenFileContents)
- }
-}
-
-gradle.projectsEvaluated {
- preBuild.dependsOn('accessToken')
-}
ext {
- supportLibVersion = '23.4.0'
+ supportLibVersion = '25.1.0'
+ espressoVersion = '2.2.2'
+ testRunnerVersion = '0.5'
+ leakCanaryVersion = '1.5'
}
android {
- compileSdkVersion 23
- buildToolsVersion "23.0.3"
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.mapbox.mapboxsdk.testapp"
minSdkVersion 15
- targetSdkVersion 23
- versionCode 9
- versionName "4.1.0"
-
- // Specify AndroidJUnitRunner as the default test instrumentation runner
+ targetSdkVersion 25
+ versionCode 11
+ versionName "5.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
@@ -65,8 +44,9 @@ android {
buildTypes {
debug {
- // run code coverage reports
testCoverageEnabled = true
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
@@ -88,82 +68,30 @@ dependencies {
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
// Leak Canary
- debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
- releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
- testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
+ debugCompile "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
+ releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
+ testCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
- // Mapbox Android Services
- compile('com.mapbox.mapboxsdk:mapbox-android-services:1.3.0@aar') {
+ // Mapbox Android Services (Java component)
+ compile('com.mapbox.mapboxsdk:mapbox-java-services:2.0.0-SNAPSHOT@jar') {
transitive = true
}
// Testing dependencies
testCompile 'junit:junit:4.12'
- testCompile 'org.mockito:mockito-core:1.10.19'
- androidTestCompile "com.android.support:support-annotations:${supportLibVersion}"
- androidTestCompile 'com.android.support.test:runner:0.4.1'
- androidTestCompile 'com.android.support.test:rules:0.4.1'
- androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
+ testCompile 'org.mockito:mockito-core:2.2.27'
androidTestCompile 'com.squareup.spoon:spoon-client:1.6.2'
+ androidTestCompile "com.android.support:support-annotations:${supportLibVersion}"
+ androidTestCompile "com.android.support.test:runner:${testRunnerVersion}"
+ androidTestCompile "com.android.support.test:rules:${testRunnerVersion}"
+ androidTestCompile "com.android.support.test.espresso:espresso-core:${espressoVersion}"
+ androidTestCompile "com.android.support.test.espresso:espresso-intents:${espressoVersion}"
}
-checkstyle {
- configFile project.file('../checks.xml')
- showViolations true
-}
-
-def getAccessKeyDeviceFarm() {
- if (project.hasProperty('AWS_ACCESS_KEY_ID_DEVICE_FARM')) {
- return AWS_ACCESS_KEY_ID_DEVICE_FARM
- } else {
- println("Could not locate AWS_ACCESS_KEY_ID_DEVICE_FARM in gradle.properties")
- return ""
- }
-}
-
-def getSecretAccessKeyDeviceFarm() {
- if (project.hasProperty('AWS_SECRET_ACCESS_KEY_DEVICE_FARM')) {
- return AWS_SECRET_ACCESS_KEY_DEVICE_FARM
- } else {
- println("Could not locate AWS_SECRET_ACCESS_KEY_DEVICE_FARM in gradle.properties")
- return ""
- }
-}
-
-devicefarm {
-
- projectName "Mapbox GL Android" // required: Must already exists.
- devicePool "sanity" // optional: Defaults to "Top Devices"
-
- authentication {
- accessKey getAccessKeyDeviceFarm()
- secretKey getSecretAccessKeyDeviceFarm()
- }
-
- devicestate {
- wifi "on"
- bluetooth "off"
- gps "on"
- nfc "on"
- latitude 47.6204 // default
- longitude - 122.3491 // default
- }
-
- instrumentation {
-
- }
-}
-
-android.applicationVariants.all { variant ->
- def name = variant.buildType.name
- def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle
- checkstyle.dependsOn variant.javaCompile
- checkstyle.source variant.javaCompile.source
- checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir)
- checkstyle.exclude('**/BuildConfig.java')
- checkstyle.exclude('**/R.java')
- project.tasks.getByName("check").dependsOn checkstyle
-}
-
+apply from: 'gradle-make.gradle'
+apply from: 'gradle-config.gradle'
+apply from: 'gradle-device-farm.gradle'
apply from: 'gradle-spoon.gradle'
+apply from: 'gradle-checkstyle.gradle'
+