-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
149 lines (128 loc) · 4.24 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
buildscript {
ext.kotlin_version = '1.0.2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'checkstyle'
def SEARCH_BASE_URL = hasProperty('searchBaseUrl') ? '"' + searchBaseUrl + '"' : "null";
def ROUTE_BASE_URL = hasProperty('routeBaseUrl') ? '"' + routeBaseUrl + '"' : "null";
def VECTOR_TILE_API_KEY = hasProperty('vectorTileApiKey') ? '"' + vectorTileApiKey + '"' : "null";
def PELIAS_API_KEY = hasProperty('peliasApiKey') ? '"' + peliasApiKey + '"' : "null";
def VALHALLA_API_KEY = hasProperty('valhallaApiKey') ? '"' + valhallaApiKey + '"' : "null";
def MINT_API_KEY = hasProperty('mintApiKey') ? '"' + mintApiKey + '"' : "null";
def BUILD_NUMBER = hasProperty('buildNumber') ? '"' + buildNumber + '"' : '"DEV"';
def RELEASE_STORE_FILE = hasProperty('releaseStoreFile') ? releaseStoreFile : "null";
def RELEASE_STORE_PASSWORD = hasProperty('releaseStorePassword') ? releaseStorePassword : "null";
def RELEASE_KEY_ALIAS = hasProperty('releaseKeyAlias') ? releaseKeyAlias : "null";
def RELEASE_KEY_PASSWORD = hasProperty('releaseStoreFile') ? releaseKeyPassword : "null";
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.mapzen.erasermap"
minSdkVersion 15
targetSdkVersion 23
versionCode buildVersionCode()
versionName version
buildConfigField "String", "SEARCH_BASE_URL", SEARCH_BASE_URL
buildConfigField "String", "ROUTE_BASE_URL", ROUTE_BASE_URL
buildConfigField "String", "VECTOR_TILE_API_KEY", VECTOR_TILE_API_KEY
buildConfigField "String", "PELIAS_API_KEY", PELIAS_API_KEY
buildConfigField "String", "VALHALLA_API_KEY", VALHALLA_API_KEY
buildConfigField "String", "MINT_API_KEY", MINT_API_KEY
buildConfigField "String", "BUILD_NUMBER", BUILD_NUMBER
}
signingConfigs {
debug {
storeFile file("debug.keystore")
}
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
minifyEnabled false
}
productFlavors {
dev {
}
prod {
}
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
testOptions {
unitTests.returnDefaultValues = true
}
}
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true
}
}
task checkstyle(type: Checkstyle) {
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
source 'src'
include '**/*.java'
include '**/*.kt'
exclude '**/gen/**'
classpath = files()
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://mint.splunk.com/gradle/" }
}
ext {
flavorType = "Dev"
}
gradle.startParameter.getTaskNames().each { task ->
if(task.contains("Prod")){
flavorType = "Prod"
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.mapzen:mapzen-android-sdk:1.0.8'
compile 'com.google.dagger:dagger:2.0'
compile 'com.google.dagger:dagger-compiler:2.0'
compile 'javax.annotation:javax.annotation-api:1.2'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.squareup:otto:1.3.7'
compile 'com.splunk.mint:mint:4.2.1'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.mapzen.android:speakerbox:1.4.1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.powermock:powermock:1.6.4'
testCompile 'org.powermock:powermock-module-junit4:1.6.4'
testCompile 'org.powermock:powermock-api-mockito:1.6.4'
testCompile 'org.assertj:assertj-core:1.7.0'
testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile 'org.json:json:20160212'
}