-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
285 lines (233 loc) · 7.99 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'de.thetaphi:forbiddenapis:3.8'
}
}
plugins {
id 'java-library'
id 'maven-publish'
// https://github.com/researchgate/gradle-release
id 'net.researchgate.release' version '3.0.2'
id 'io.codearte.nexus-staging' version '0.30.0'
}
apply plugin: 'de.thetaphi.forbiddenapis'
apply plugin: 'jacoco'
apply plugin: 'signing'
apply plugin: 'idea'
java {
toolchain {
sourceCompatibility = JavaVersion.VERSION_17
}
}
group = 'org.dstadler'
archivesBaseName = 'cover-the-world'
repositories {
// for geotools (needs to appear before mavenCentral)
maven { url 'https://repo.osgeo.org/repository/release/' }
mavenCentral()
}
forbiddenApis {
suppressAnnotations = ['org.dstadler.commons.util.SuppressForbidden']
// 'jdk-unsafe'
bundledSignatures = [ 'jdk-system-out', 'jdk-non-portable', 'jdk-deprecated', 'jdk-reflection',
'commons-io-unsafe-2.15.1', 'jdk-internal' ]
}
forbiddenApisMain {
signaturesFiles += files('config/forbidden-apis/forbidden.signatures.txt')
}
dependencies {
implementation 'org.dstadler:commons-dost:1.3.4'
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'commons-io:commons-io:2.18.0'
implementation 'com.google.guava:guava:33.4.0-jre'
// jcoords from https://github.com/xni06/JCoord
implementation fileTree(dir: 'lib', include: ['*.jar'])
// https://github.com/filosganga/geogson
implementation 'com.github.filosganga:geogson-core:1.4.31'
implementation 'org.geotools:gt-main:31.3'
implementation 'org.geotools:gt-geojson:31.3'
implementation 'org.geotools:gt-render:31.3'
// provide a logging.properties only when running the example, but
// don't include it in the jar-file
runtimeOnly files('src/runtime/resources')
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.4'
testImplementation 'org.dstadler:commons-test:1.0.0.21'
testImplementation 'org.apache.logging.log4j:log4j-core:2.24.3'
}
wrapper {
gradleVersion = '8.5'
}
test {
maxHeapSize = "512m"
systemProperties = System.properties
// enable to show standard out and standard error of the test JVM(s) on the console
// testLogging.showStandardStreams = true
// http://forums.gradle.org/gradle/topics/jacoco_related_failure_in_multiproject_build
systemProperties['user.dir'] = workingDir
// avoid failures because Gradle provides it's own version of JNA in the system properties
systemProperties['jna.boot.library.path'] = null
useJUnitPlatform()
}
jacoco {
toolVersion = '0.8.12'
}
jacocoTestReport {
reports {
xml.required = true
}
}
/*jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: 'org/dstadler/audio/example/**')
}))
}
}*/
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
java {
withJavadocJar()
withSourcesJar()
}
release {
git {
requireBranch.set('main')
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from components.java
pom {
name = 'cover-the-world'
description = 'Read GPX tracks and produce a world-map with covered tiles.'
url = 'https://github.com/centic9/cover-the-world'
licenses {
license {
name = 'BSD 2-Clause "Simplified" License'
url = 'https://github.com/centic9/cover-the-world/blob/main/LICENSE.md'
}
}
developers {
developer {
id = 'centic9'
name = 'Dominik Stadler'
}
}
scm {
connection = 'scm:[email protected]:centic9/cover-the-world'
developerConnection = 'scm:[email protected]:centic9/cover-the-world'
url = 'https://github.com/centic9/cover-the-world'
}
}
}
}
repositories {
maven {
// change to point to your repo, e.g. http://my.org/repo
//url = layout.buildDirectory.dir('repo')
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials(PasswordCredentials)
//snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/')
}
}
}
signing {
sign publishing.publications.mavenJava
}
idea {
module {
excludeDirs += [
file('tilesSquares'),
file('tilesSquaresAdjacent'),
file('tilesSquaresCombined'),
file('tilesSquaresNew'),
file('tilesTiles'),
file('tilesTilesAdjacent'),
file('tilesTilesCombined'),
file('tilesTilesNew')
]
}
}
afterReleaseBuild.dependsOn publish
tasks.register('createZip', Zip) {
from '.'
excludes = ['bin', 'build', '.gradle', '.svn', '.git', '*.log', '*.log.*', '.idea',
'out', '*.zip', 'tiles*']
}
tasks.register('updateFiles', JavaExec) {
description = 'Run all steps to read the GPX files and produce the necessary files for the sample web application'
mainClass = 'org.dstadler.ctw.CoverTheWorld'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
}
tasks.register('createAllSquares', JavaExec) {
description = 'Create covered squares for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateTileOverlaysFromUTMRef'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
args "all"
}
tasks.register('createNewSquares', JavaExec) {
description = 'Create recently covered squares for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateTileOverlaysFromUTMRef'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
}
tasks.register('createAllTiles', JavaExec) {
description = 'Create covered tiles for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateTileOverlaysFromTiles'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
args "all"
}
tasks.register('createNewTiles', JavaExec) {
description = 'Create recently covered tiles for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateTileOverlaysFromTiles'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
}
tasks.register('createAllAdjacentTiles', JavaExec) {
description = 'Create adjacent tiles for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateAdjacentTileOverlaysFromTiles'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
args "all"
}
tasks.register('createNewAdjacentTiles', JavaExec) {
description = 'Create recent adjacent tiles for all supported zooms'
mainClass = 'org.dstadler.ctw.tiles.CreateAdjacentTileOverlaysFromTiles'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-Xmx512m']
}
tasks.register('removeTiles', Exec) {
description = 'Remove all pre-built tiles to rebuild them from scratch'
workingDir '.'
commandLine 'bash', '-c',
'rm -rf tilesSquares tilesSquaresAdjacent tilesSquaresNew tilesSquaresCombined tilesTiles tilesTilesAdjacent tilesTilesNew tilesTilesCombined'
}
updateFiles.mustRunAfter removeTiles
createAllSquares.mustRunAfter updateFiles
createNewSquares.mustRunAfter updateFiles
createAllTiles.mustRunAfter updateFiles
createNewTiles.mustRunAfter updateFiles
createAllAdjacentTiles.mustRunAfter updateFiles
createNewAdjacentTiles.mustRunAfter updateFiles
tasks.register('tiles') {
dependsOn updateFiles, createNewSquares, createNewTiles, createNewAdjacentTiles
}
tasks.register('rebuildTiles') {
dependsOn removeTiles, createAllSquares, createAllTiles, createAllAdjacentTiles, tiles
}