66 lines
1.6 KiB
Groovy
66 lines
1.6 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
task accessToken {
|
|
def rawDir = new File("app/src/main/res/raw")
|
|
rawDir.mkdirs()
|
|
def tokenFile = new File("app/src/main/res/raw/token.txt")
|
|
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)
|
|
}
|
|
}
|
|
|
|
gradle.projectsEvaluated {
|
|
preBuild.dependsOn('accessToken')
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 21
|
|
buildToolsVersion "21.1.2"
|
|
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "com.mapbox.mapboxgl.app"
|
|
minSdkVersion 14
|
|
targetSdkVersion 21
|
|
versionCode 3
|
|
versionName "0.1.2"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_7
|
|
targetCompatibility JavaVersion.VERSION_1_7
|
|
}
|
|
|
|
packagingOptions {
|
|
exclude 'META-INF/LICENSE.txt'
|
|
exclude 'META-INF/NOTICE.txt'
|
|
}
|
|
|
|
lintOptions {
|
|
checkAllWarnings true
|
|
disable 'UnusedAttribute'
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':lib')
|
|
compile 'com.android.support:support-annotations:21.0.0'
|
|
compile 'com.android.support:support-v4:21.0.3'
|
|
compile 'com.android.support:appcompat-v7:21.0.3'
|
|
compile 'com.mapzen.android:lost:0.2'
|
|
}
|