diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-11-07 09:25:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 09:25:17 +0100 |
commit | c5992d71f5b011e6b664532fdc2abbb8d3c51a0b (patch) | |
tree | 644fa91098429f7eaf3334a7d262ca36393b12f0 /platform/android/MapboxGLAndroidSDKTestApp | |
parent | afd43eea3aeaf1123a75637d6b008971a3519396 (diff) | |
download | qtlocation-mapboxgl-c5992d71f5b011e6b664532fdc2abbb8d3c51a0b.tar.gz |
[android] - cleanup unused resources and gradle configurations. (#6896)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp')
6 files changed, 87 insertions, 136 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index 80013ed291..46d1a13297 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -1,25 +1,4 @@ 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 = '25.0.0' @@ -36,7 +15,6 @@ android { versionCode 11 versionName "5.0.0" - // Specify AndroidJUnitRunner as the default test instrumentation runner testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } @@ -64,7 +42,6 @@ android { buildTypes { debug { - // run code coverage reports testCoverageEnabled = true } release { @@ -106,63 +83,9 @@ dependencies { androidTestCompile 'com.squareup.spoon:spoon-client:1.6.2' } -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' + diff --git a/platform/android/MapboxGLAndroidSDKTestApp/gradle-config.gradle b/platform/android/MapboxGLAndroidSDKTestApp/gradle-config.gradle new file mode 100644 index 0000000000..21da83c4a0 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/gradle-config.gradle @@ -0,0 +1,22 @@ +// +// Configuration file for gradle build execution. +// + +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') +}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/gradle-device-farm.gradle b/platform/android/MapboxGLAndroidSDKTestApp/gradle-device-farm.gradle new file mode 100644 index 0000000000..f455e263c0 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/gradle-device-farm.gradle @@ -0,0 +1,43 @@ +apply plugin: 'devicefarm' + +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 { + + } +}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/gradle-make.gradle b/platform/android/MapboxGLAndroidSDKTestApp/gradle-make.gradle new file mode 100644 index 0000000000..29567df6f0 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/gradle-make.gradle @@ -0,0 +1,18 @@ +// +// Contains GL-native make commands +// + +task makeClean(type: Exec) { + workingDir '../../' + commandLine 'make', 'clean' +} + +task makeAndroid(type: Exec) { + workingDir '../../' + commandLine 'make', 'android' +} + +task makeAndroidAll(type: Exec) { + workingDir '../../' + commandLine 'make', 'apackage' +}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/lint.xml b/platform/android/MapboxGLAndroidSDKTestApp/lint.xml deleted file mode 100644 index 94058fd4df..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/lint.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lint> - <!-- Ignore errors caused by icon burning --> - <issue id="IconLauncherShape" severity="ignore"> - <ignore path="res/drawable-mdpi/icon.png" /> - <ignore path="res/drawable-hdpi/icon.png" /> - <ignore path="res/drawable-xdpi/icon.png" /> - <ignore path="res/drawable-xxdpi/icon.png" /> - <ignore path="res/drawable-mdpi/icon_burned.png" /> - <ignore path="res/drawable-hdpi/icon_burned.png" /> - <ignore path="res/drawable-xdpi/icon_burned.png" /> - <ignore path="res/drawable-xxdpi/icon_burned.png" /> - </issue> - <issue id="IconDuplicates" severity="ignore"> - <ignore path="res/drawable-mdpi/icon.png" /> - <ignore path="res/drawable-hdpi/icon.png" /> - <ignore path="res/drawable-xdpi/icon.png" /> - <ignore path="res/drawable-xxdpi/icon.png" /> - <ignore path="res/drawable-mdpi/icon_burned.png" /> - <ignore path="res/drawable-hdpi/icon_burned.png" /> - <ignore path="res/drawable-xdpi/icon_burned.png" /> - <ignore path="res/drawable-xxdpi/icon_burned.png" /> - </issue> - <issue id="UnusedResources" severity="ignore"> - <ignore path="res/drawable-mdpi/icon.png" /> - <ignore path="res/drawable-hdpi/icon.png" /> - <ignore path="res/drawable-xdpi/icon.png" /> - <ignore path="res/drawable-xxdpi/icon.png" /> - <ignore path="res/drawable-mdpi/icon_burned.png" /> - <ignore path="res/drawable-hdpi/icon_burned.png" /> - <ignore path="res/drawable-xdpi/icon_burned.png" /> - <ignore path="res/drawable-xxdpi/icon_burned.png" /> - </issue> -</lint> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/update_icons.sh b/platform/android/MapboxGLAndroidSDKTestApp/update_icons.sh deleted file mode 100755 index ef5213d4f9..0000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/update_icons.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [[ -z `which iconoblast` ]]; then - echo "Requires https://github.com/mapbox/iconoblast" - exit 1 -fi - -commit=`git rev-parse --short HEAD` -branch=`git rev-parse --abbrev-ref HEAD` -repo=`git remote show origin | grep 'Fetch URL' | sed -e 's/.*github\.com:mapbox\///' -e 's/\.git$//' -e 's/^mapbox-//'` - -pwd=`pwd` -cd src/main/res -for folder in `find . -maxdepth 1 -type d -name drawable-\*` -do - cd ${folder} - cp icon.png icon_burned.png - iconoblast icon_burned.png $commit $branch $repo - cd .. -done -cd ${pwd} |