summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-01-27 11:13:00 +1100
committerLeith Bade <leith@mapbox.com>2015-01-27 11:13:00 +1100
commit7f41d476c1d5cd5b4dff2bd1841d20ef9aa2beb7 (patch)
tree44f594413045fd9fa2d75603d03e11e3d202c6a3
parent8193acdf30e61e1b7d4af30df7e78d7d7dc649f1 (diff)
downloadqtlocation-mapboxgl-7f41d476c1d5cd5b4dff2bd1841d20ef9aa2beb7.tar.gz
Don't create token.txt if it already exists
-rw-r--r--android/java/app/build.gradle10
1 files changed, 6 insertions, 4 deletions
diff --git a/android/java/app/build.gradle b/android/java/app/build.gradle
index e44bbdbd59..4a36c7d1e3 100644
--- a/android/java/app/build.gradle
+++ b/android/java/app/build.gradle
@@ -4,11 +4,13 @@ task accessToken {
def rawDir = new File("app/src/main/res/raw")
rawDir.mkdirs()
def tokenFile = new File("app/src/main/res/raw/token.txt")
- String token = System.getenv('MAPBOX_ACCESS_TOKEN')
- if (token == null) {
- throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
+ if (!tokenFile.exists()) {
+ String token = System.getenv('MAPBOX_ACCESS_TOKEN')
+ if (token == null) {
+ throw new InvalidUserDataException("You must set the MAPBOX_ACCESS_TOKEN environment variable.")
+ }
+ tokenFile.write(token)
}
- tokenFile.write(token)
}
gradle.projectsEvaluated {