diff options
author | Leith Bade <leith@mapbox.com> | 2015-01-27 11:24:56 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2015-01-27 11:24:56 +1100 |
commit | 679085b4d9bc451b94181c4f5f59545651d03b38 (patch) | |
tree | 44f594413045fd9fa2d75603d03e11e3d202c6a3 | |
parent | 8193acdf30e61e1b7d4af30df7e78d7d7dc649f1 (diff) | |
parent | 7f41d476c1d5cd5b4dff2bd1841d20ef9aa2beb7 (diff) | |
download | qtlocation-mapboxgl-679085b4d9bc451b94181c4f5f59545651d03b38.tar.gz |
Merge pull request #775 from mapbox/token-check
Don't create token.txt if it already exists
-rw-r--r-- | android/java/app/build.gradle | 10 |
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 { |