diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle
index 64f7ac2a7..e18b4ab4d 100644
--- a/platform/android/MapboxGLAndroidSDK/build.gradle
+++ b/platform/android/MapboxGLAndroidSDK/build.gradle
@@ -1,20 +1,4 @@
apply plugin: 'com.android.library'
-apply plugin: 'checkstyle'
-apply plugin: 'maven'
-apply plugin: 'signing'
-
-allprojects {
- group project.GROUP
- version project.VERSION_NAME
-
- repositories {
- mavenCentral()
- }
-}
-
-repositories {
- mavenCentral()
-}
ext {
supportLibVersion = '25.0.0'
@@ -46,10 +30,12 @@ android {
}
android {
+ // avoid naming conflicts, force usage of prefix
resourcePrefix 'mapbox_'
}
sourceSets {
+ // limit amount of exposed library resources
main.res.srcDirs += 'src/main/res-public'
}
@@ -73,94 +59,13 @@ android {
}
release {
- jniDebuggable false
+ // aar proguard configuration
consumerProguardFiles 'proguard-rules.pro'
+ jniDebuggable false
}
}
}
-configurations {
- all*.exclude group: 'commons-logging', module: 'commons-logging'
- all*.exclude group: 'commons-collections', module: 'commons-collections'
-}
-
-android.libraryVariants.all { variant ->
- def name = variant.name
- //noinspection GroovyAssignabilityCheck
- task "javadoc$name"(type: Javadoc) {
- description = "Generates javadoc for build $name"
- failOnError = false
- destinationDir = new File(destinationDir, variant.baseName)
- source = files(variant.javaCompile.source)
- classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
- options.windowTitle("Mapbox Android SDK $VERSION_NAME Reference")
- options.docTitle("Mapbox Android SDK $VERSION_NAME")
- options.header("Mapbox Android SDK $VERSION_NAME Reference")
- options.bottom("© 2015–2016 Mapbox. All rights reserved.")
- options.links("http://docs.oracle.com/javase/7/docs/api/")
- options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference")
- options.overview("src/main/java/overview.html")
- options.group("Mapbox Android SDK", "com.mapbox.*")
- options.group("Third Party Libraries", "com.almeros.*")
- exclude '**/R.java', '**/BuildConfig.java', 'com/almeros/**'
- }
-}
-
-/*
-task cleanJNIBuilds {
- def jniLibsDir = new File("MapboxGLAndroidSDK/src/main/jniLibs")
- delete jniLibsDir.absolutePath
-}
-*/
-
-android.libraryVariants.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')
- checkstyle.exclude('**/com/almeros/android/multitouch/**')
- project.tasks.getByName("check").dependsOn checkstyle
-}
-
-// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/jar.gradle
-android.libraryVariants.all { variant ->
- def jarTask = project.tasks.create(name: "jar${variant.name.capitalize()}", type: Jar) {
- from variant.javaCompile.destinationDir
- exclude "**/R.class"
- exclude "**/BuildConfig.class"
- }
- jarTask.dependsOn variant.javaCompile
- artifacts.add('archives', jarTask);
-}
-
-// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/gradle-mvn-push.gradle
-def isReleaseBuild() {
- return VERSION_NAME.contains("SNAPSHOT") == false
-}
-
-def getReleaseRepositoryUrl() {
- return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL :
- "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
-}
-
-def getSnapshotRepositoryUrl() {
- return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL :
- "https://oss.sonatype.org/content/repositories/snapshots/"
-}
-
-def getRepositoryUsername() {
- return hasProperty('USERNAME') ? USERNAME :
- (hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "")
-}
-
-def getRepositoryPassword() {
- return hasProperty('PASSWORD') ? PASSWORD :
- (hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "")
-}
-
def getGitRevision() {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
@@ -168,121 +73,10 @@ def getGitRevision() {
return ref
}
-task apklib(type: Zip) {
- appendix = extension = 'apklib'
-
- from 'AndroidManifest.xml'
- into('res') {
- from 'res'
- }
- into('src') {
- from 'src'
- }
-}
-
-artifacts {
- archives apklib
-}
-
-afterEvaluate { project ->
- uploadArchives {
- repositories {
- mavenDeployer {
- beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-
- pom.groupId = GROUP
- pom.artifactId = POM_ARTIFACT_ID
- pom.version = VERSION_NAME
-
- repository(url: getReleaseRepositoryUrl()) {
- authentication(userName: getRepositoryUsername(),
- password: getRepositoryPassword())
- }
- snapshotRepository(url: getSnapshotRepositoryUrl()) {
- authentication(userName: getRepositoryUsername(),
- password: getRepositoryPassword())
- }
-
-/*
- // Leaving out as artifact was incorrectly named when found
- addFilter('aar') { artifact, file ->
- artifact.name == archivesBaseName
- }
- addFilter('apklib') { artifact, file ->
- artifact.name == archivesBaseName + '-apklib'
- }
-*/
-
- pom.project {
- name POM_NAME
- packaging POM_PACKAGING
- description POM_DESCRIPTION
- url POM_URL
-
- scm {
- url POM_SCM_URL
- connection POM_SCM_CONNECTION
- developerConnection POM_SCM_DEV_CONNECTION
- }
-
- licenses {
- license {
- name POM_LICENCE_NAME
- url POM_LICENCE_URL
- distribution POM_LICENCE_DIST
- }
- }
-
- developers {
- developer {
- id POM_DEVELOPER_ID
- name POM_DEVELOPER_NAME
- }
- }
- }
- }
- }
- }
-
- signing {
- required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
- sign configurations.archives
- }
-
- task androidJavadocs(type: Javadoc) {
- source = android.sourceSets.main.java.sourceFiles
- classpath = files(android.bootClasspath)
- }
-
- task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
- classifier = 'javadoc'
- from androidJavadocs.destinationDir
- }
-
- task androidSourcesJar(type: Jar) {
- classifier = 'sources'
- from android.sourceSets.main.java.sourceFiles
- }
-
- artifacts {
- archives androidSourcesJar
- archives androidJavadocsJar
- }
-}
-
-
-task makeClean(type: Exec) {
- workingDir '../../'
- commandLine 'make', 'clean'
-}
-
-task makeAndroid(type: Exec) {
- workingDir '../../'
- commandLine 'make', 'android'
-}
-
-task makeAndroidAll(type: Exec) {
- workingDir '../../'
- commandLine 'make', 'apackage'
+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'
\ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDK/deploy.sh b/platform/android/MapboxGLAndroidSDK/deploy.sh
deleted file mode 100755
index c9392201e..000000000
--- a/platform/android/MapboxGLAndroidSDK/deploy.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env bash
-../gradlew -b build.gradle clean assembleRelease uploadArchives
diff --git a/platform/android/MapboxGLAndroidSDK/gradle-javadoc.gradle b/platform/android/MapboxGLAndroidSDK/gradle-javadoc.gradle
new file mode 100644
index 000000000..00d96365e
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/gradle-javadoc.gradle
@@ -0,0 +1,21 @@
+android.libraryVariants.all { variant ->
+ def name = variant.name
+ //noinspection GroovyAssignabilityCheck
+ task "javadoc$name"(type: Javadoc) {
+ description = "Generates javadoc for build $name"
+ failOnError = false
+ destinationDir = new File(destinationDir, variant.baseName)
+ source = files(variant.javaCompile.source)
+ classpath = files(variant.javaCompile.classpath.files) + files(android.bootClasspath)
+ options.windowTitle("Mapbox Android SDK $VERSION_NAME Reference")
+ options.docTitle("Mapbox Android SDK $VERSION_NAME")
+ options.header("Mapbox Android SDK $VERSION_NAME Reference")
+ options.bottom("© 2015–2016 Mapbox. All rights reserved.")
+ options.links("http://docs.oracle.com/javase/7/docs/api/")
+ options.linksOffline("http://d.android.com/reference/", "$System.env.ANDROID_HOME/docs/reference")
+ options.overview("src/main/java/overview.html")
+ options.group("Mapbox Android SDK", "com.mapbox.*")
+ options.group("Third Party Libraries", "com.almeros.*")
+ exclude '**/R.java', '**/BuildConfig.java', 'com/almeros/**'
+ }
+}
\ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDK/gradle-publish.gradle b/platform/android/MapboxGLAndroidSDK/gradle-publish.gradle
new file mode 100644
index 000000000..f017434fa
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/gradle-publish.gradle
@@ -0,0 +1,153 @@
+apply plugin: 'maven'
+apply plugin: 'signing'
+
+allprojects {
+ group project.GROUP
+ version project.VERSION_NAME
+
+ repositories {
+ mavenCentral()
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/jar.gradle
+android.libraryVariants.all { variant ->
+ def jarTask = project.tasks.create(name: "jar${variant.name.capitalize()}", type: Jar) {
+ from variant.javaCompile.destinationDir
+ exclude "**/R.class"
+ exclude "**/BuildConfig.class"
+ }
+ jarTask.dependsOn variant.javaCompile
+ artifacts.add('archives', jarTask);
+}
+
+// From https://raw.github.com/mcxiaoke/gradle-mvn-push/master/gradle-mvn-push.gradle
+def isReleaseBuild() {
+ return VERSION_NAME.contains("SNAPSHOT") == false
+}
+
+def getReleaseRepositoryUrl() {
+ return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL :
+ "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
+}
+
+def getSnapshotRepositoryUrl() {
+ return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL :
+ "https://oss.sonatype.org/content/repositories/snapshots/"
+}
+
+def getRepositoryUsername() {
+ return hasProperty('USERNAME') ? USERNAME :
+ (hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "")
+}
+
+def getRepositoryPassword() {
+ return hasProperty('PASSWORD') ? PASSWORD :
+ (hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "")
+}
+
+task apklib(type: Zip) {
+ appendix = extension = 'apklib'
+
+ from 'AndroidManifest.xml'
+ into('res') {
+ from 'res'
+ }
+ into('src') {
+ from 'src'
+ }
+}
+
+artifacts {
+ archives apklib
+}
+
+afterEvaluate { project ->
+ uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+
+ pom.groupId = GROUP
+ pom.artifactId = POM_ARTIFACT_ID
+ pom.version = VERSION_NAME
+
+ repository(url: getReleaseRepositoryUrl()) {
+ authentication(userName: getRepositoryUsername(),
+ password: getRepositoryPassword())
+ }
+ snapshotRepository(url: getSnapshotRepositoryUrl()) {
+ authentication(userName: getRepositoryUsername(),
+ password: getRepositoryPassword())
+ }
+
+/*
+ // Leaving out as artifact was incorrectly named when found
+ addFilter('aar') { artifact, file ->
+ artifact.name == archivesBaseName
+ }
+ addFilter('apklib') { artifact, file ->
+ artifact.name == archivesBaseName + '-apklib'
+ }
+*/
+
+ pom.project {
+ name POM_NAME
+ packaging POM_PACKAGING
+ description POM_DESCRIPTION
+ url POM_URL
+
+ scm {
+ url POM_SCM_URL
+ connection POM_SCM_CONNECTION
+ developerConnection POM_SCM_DEV_CONNECTION
+ }
+
+ licenses {
+ license {
+ name POM_LICENCE_NAME
+ url POM_LICENCE_URL
+ distribution POM_LICENCE_DIST
+ }
+ }
+
+ developers {
+ developer {
+ id POM_DEVELOPER_ID
+ name POM_DEVELOPER_NAME
+ }
+ }
+ }
+ }
+ }
+ }
+
+ signing {
+ required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
+ sign configurations.archives
+ }
+
+ task androidJavadocs(type: Javadoc) {
+ source = android.sourceSets.main.java.sourceFiles
+ classpath = files(android.bootClasspath)
+ }
+
+ task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
+ classifier = 'javadoc'
+ from androidJavadocs.destinationDir
+ }
+
+ task androidSourcesJar(type: Jar) {
+ classifier = 'sources'
+ from android.sourceSets.main.java.sourceFiles
+ }
+
+ artifacts {
+ archives androidSourcesJar
+ archives androidJavadocsJar
+ }
+}
\ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
index 80013ed29..46d1a1329 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 = "\n" +
- "\n" +
- " " + "$System.env.MAPBOX_ACCESS_TOKEN" + "\n" +
- ""
-
- 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 000000000..21da83c4a
--- /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 = "\n" +
+ "\n" +
+ " " + "$System.env.MAPBOX_ACCESS_TOKEN" + "\n" +
+ ""
+
+ 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 000000000..f455e263c
--- /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 000000000..29567df6f
--- /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 94058fd4d..000000000
--- a/platform/android/MapboxGLAndroidSDKTestApp/lint.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/update_icons.sh b/platform/android/MapboxGLAndroidSDKTestApp/update_icons.sh
deleted file mode 100755
index ef5213d4f..000000000
--- 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}
diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle
index 6955fa596..cf03539ed 100644
--- a/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle
+++ b/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle
@@ -1,24 +1,5 @@
apply plugin: 'com.android.application'
-task accessToken {
- def tokenFile = new File("MapboxGLAndroidSDKWearTestApp/src/main/res/values/developer-config.xml")
- if (!tokenFile.exists()) {
- String tokenFileContents = "\n" +
- "\n" +
- " " + "$System.env.MAPBOX_ACCESS_TOKEN" + "\n" +
- ""
-
- if (tokenFileContents == null) {
- throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
- }
- tokenFile.write(tokenFileContents)
- }
-}
-
-gradle.projectsEvaluated {
- preBuild.dependsOn('accessToken')
-}
-
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
@@ -44,14 +25,15 @@ dependencies {
transitive = true
}
+ // Wear
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile 'com.google.android.support:wearable:2.0.0-alpha3'
+ provided 'com.google.android.wearable:wearable:2.0.0-alpha3'
+
// 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'
-
- compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.google.android.support:wearable:2.0.0-alpha3'
- provided 'com.google.android.wearable:wearable:2.0.0-alpha3'
}
-apply from: '../checkstyle.gradle'
\ No newline at end of file
+apply from: 'gradle-config.gradle'
diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle b/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle
new file mode 100644
index 000000000..fac47cb2a
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle
@@ -0,0 +1,22 @@
+//
+// Configuration file for gradle build execution.
+//
+
+task accessToken {
+ def tokenFile = new File("MapboxGLAndroidSDKWearTestApp/src/main/res/values/developer-config.xml")
+ if (!tokenFile.exists()) {
+ String tokenFileContents = "\n" +
+ "\n" +
+ " " + "$System.env.MAPBOX_ACCESS_TOKEN" + "\n" +
+ ""
+
+ 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/build.gradle b/platform/android/build.gradle
index 2cd3b7307..88253321e 100644
--- a/platform/android/build.gradle
+++ b/platform/android/build.gradle
@@ -17,8 +17,6 @@ allprojects {
}
}
-apply from: 'checkstyle.gradle'
-
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}
diff --git a/platform/android/checkstyle.gradle b/platform/android/checkstyle.gradle
deleted file mode 100644
index 69f7f41ff..000000000
--- a/platform/android/checkstyle.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-apply plugin: 'checkstyle'
-
-checkstyle.toolVersion = '7.1'
-
-task checkstyle(type: Checkstyle) {
- description 'Checks if the code adheres to coding standards'
- group 'verification'
-
- configFile = new File(rootDir, "checkstyle.xml")
- source 'src'
- include '**/*.java'
- exclude '**/gen/**'
-
- classpath = files()
- ignoreFailures = false
-}
diff --git a/platform/android/checkstyle.xml b/platform/android/checkstyle.xml
deleted file mode 100644
index 3b4fba7b2..000000000
--- a/platform/android/checkstyle.xml
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-