-
Notifications
You must be signed in to change notification settings - Fork 120
/
build.gradle
156 lines (133 loc) · 4.31 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
150
151
152
153
154
155
156
buildscript {
apply from: "${rootDir}/gradle/dependencies.gradle"
repositories {
maven { url 'https://plugins.gradle.org/m2' }
google()
mavenCentral()
jcenter()
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username = "mapbox"
password = project.hasProperty('SDK_REGISTRY_TOKEN') ? project.property('SDK_REGISTRY_TOKEN') : System.getenv('SDK_REGISTRY_TOKEN')
}
}
}
dependencies {
dependencies.create(pluginDependencies.checkstyle) {
transitive = false
}
classpath pluginDependencies.jacoco
classpath pluginDependencies.errorprone
classpath pluginDependencies.buildConfig
classpath pluginDependencies.mapboxSdkRegistry
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += ['-Xlint:all', '-Xlint:unchecked', 'autovaluegson.defaultCollectionsToEmpty:true']
}
allprojects {
repositories {
maven { url 'https://plugins.gradle.org/m2' }
google()
mavenCentral()
jcenter()
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username = "mapbox"
password = project.hasProperty('SDK_REGISTRY_TOKEN') ? project.property('SDK_REGISTRY_TOKEN') : System.getenv('SDK_REGISTRY_TOKEN')
}
}
// uncomment if snapshots access is needed
// maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}
}
subprojects {
apply from: "${rootDir}/gradle/dependencies.gradle"
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.ltgt.errorprone'
// Fixes issue with test resources not being found inside Intellij
idea {
module {
testOutputDir = file('build/resources/test')
}
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
errorprone dependenciesList.errorprone
// Test Dependencies
testCompile dependenciesList.junit
testCompile dependenciesList.hamcrestJunit
testCompile dependenciesList.mockito
testCompile dependenciesList.googleTruth
}
}
def TESTABLE_MODULES = ["services",
"services-core",
"services-directions",
"services-directions-models",
"services-geocoding",
"services-geojson",
"services-matching",
"services-matrix",
"services-optimization",
"services-route-tiles",
"services-speech",
"services-staticmap",
"services-tilequery",
"services-turf",
"services-directions-refresh",
"services-directions-refresh-models",
"services-isochrone"]
def RELEASE_MODULES = ["services",
"services-core",
"services-geojson",
"services-turf",
"services-directions-models",
"services-directions-refresh-models"]
subprojects { subproject ->
tasks.withType(Jar) { jarTask ->
if (!jarTask.name.endsWith("sourcesJar")) {
jarTask.exclude("**/*.java")
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
if (TESTABLE_MODULES.contains(subproject.name)) {
afterEvaluate { project ->
project.apply from: "${rootDir}/gradle/jacoco.gradle"
project.apply from: "${rootDir}/gradle/checkstyle.gradle"
}
}
if (RELEASE_MODULES.contains(subproject.name)) {
subproject.apply from: "${rootDir}/gradle/publish.gradle"
subproject.apply from: "${rootDir}/gradle/dependencies-graph.gradle"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}