-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
145 lines (123 loc) · 3.87 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
buildscript {
ext.kotlin_version = '1.1.2'
ext.dagger_version = '2.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'checkstyle'
def SEARCH_BASE_URL = hasProperty('searchBaseUrl') ? '"' + searchBaseUrl + '"' : "null";
def ROUTE_BASE_URL = hasProperty('routeBaseUrl') ? '"' + routeBaseUrl + '"' : "null";
def API_KEY = hasProperty('apiKey') ? '"' + apiKey + '"' : "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 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.mapzen.erasermap"
minSdkVersion 19
targetSdkVersion 25
versionCode buildVersionCode()
versionName version
buildConfigField "String", "SEARCH_BASE_URL", SEARCH_BASE_URL
buildConfigField "String", "ROUTE_BASE_URL", ROUTE_BASE_URL
buildConfigField "String", "API_KEY", 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:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.mapzen:mapzen-android-sdk:1.4.0'
compile "com.google.dagger:dagger:$dagger_version"
compile 'com.squareup:otto:1.3.7'
compile 'com.splunk.mint:mint:4.2.1'
compile 'com.mapzen.android:speakerbox:1.4.1'
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
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'
testCompile "com.google.dagger:dagger-compiler:$dagger_version"
}