@@ -18,6 +18,11 @@ version = '2.2.0' + (project.hasProperty('snapshot') ? '-SNAPSHOT' : '')
18
18
sourceCompatibility = ' 1.8'
19
19
targetCompatibility = ' 1.8'
20
20
21
+ ant {
22
+ property(file : ' build.properties' )
23
+ property(file : " gdal.${ org.gradle.internal.os.OperatingSystem.current().isWindows() ? 'win' : 'unix'} .properties" )
24
+ }
25
+
21
26
ext {
22
27
joglVersion = ' 2.3.2'
23
28
gdalVersion = ' 2.4.0'
@@ -32,14 +37,18 @@ repositories {
32
37
}
33
38
34
39
dependencies {
35
- implementation " org.jogamp.jogl:jogl-all-main:${ project.joglVersion} "
36
- implementation " org.jogamp.gluegen:gluegen-rt-main:${ project.joglVersion} "
37
-
38
- compile " org.gdal:gdal:${ project.gdalVersion} "
40
+ compile " org.jogamp.jogl:jogl-all-main:$project . joglVersion "
41
+ compile " org.jogamp.gluegen:gluegen-rt-main:$project . joglVersion "
42
+
43
+ if (project. hasProperty(' systemGDAL' )) {
44
+ compile files(" ${ ant.properties['gdal.jar.dir']} /gdal.jar" )
45
+ } else {
46
+ implementation " org.gdal:gdal:$project . gdalVersion "
47
+ }
39
48
40
- implementation " org.codehaus.jackson:jackson-core-asl:${ project.jacksonVersion} "
49
+ compile " org.codehaus.jackson:jackson-core-asl:$project . jacksonVersion "
41
50
42
- testImplementation " junit:junit:${ project.junitVersion} "
51
+ testImplementation " junit:junit:$project . junitVersion "
43
52
}
44
53
45
54
task sourcesJar (type : Jar , dependsOn : classes) {
@@ -64,12 +73,12 @@ task extensionsJar(type: Jar) {
64
73
exclude ' images/**'
65
74
exclude ' gov/nasa/worldwind/**'
66
75
}
67
- }
68
- extensionsJar . doLast {
69
- copy {
70
- from " $b uildDir /libs/ ${ extensionsJar.archiveName } "
71
- into " ${ project.projectDir } "
72
- rename " ${ extensionsJar.archiveName } " , " ${ extensionsJar.baseName } . ${ extensionsJar.extension } "
76
+ doLast {
77
+ copy {
78
+ from " $b uildDir /libs/ $e xtensionsJar . archiveName "
79
+ into project . projectDir
80
+ rename " $e xtensionsJar . archiveName " , " $e xtensionsJar . baseName . $e xtensionsJar . extension "
81
+ }
73
82
}
74
83
}
75
84
@@ -85,7 +94,7 @@ def pomConfig = {
85
94
license {
86
95
name ' NASA Open Source Agreement v1.3'
87
96
url ' https://ti.arc.nasa.gov/opensource/nosa/'
88
- distribution " repo"
97
+ distribution ' repo'
89
98
}
90
99
}
91
100
developers {
@@ -96,7 +105,7 @@ def pomConfig = {
96
105
}
97
106
}
98
107
scm {
99
- url " https://github.com/WorldWindEarth/WorldWindJava"
108
+ url ' https://github.com/WorldWindEarth/WorldWindJava'
100
109
}
101
110
}
102
111
@@ -145,7 +154,7 @@ bintray {
145
154
githubRepo = ' WorldWindEarth/WorldWindJava'
146
155
version {
147
156
name = project. version
148
- desc = ' WorldWind v' + project. version
157
+ desc = " WorldWind v$ project . version "
149
158
vcsTag = System . getenv(' TRAVIS_TAG' )
150
159
released = new Date ()
151
160
}
@@ -194,25 +203,25 @@ compileJava {
194
203
195
204
test {
196
205
dependsOn jar
197
- classpath + = project. files(" $buildDir /libs/${ jar.archiveName} " , configurations. runtime)
206
+ classpath + = project. files(" $buildDir /libs/$jar . archiveName " , configurations. runtime)
198
207
}
199
208
200
209
jar {
201
210
dependsOn classes
202
211
from sourceSets. main. output
203
212
exclude ' gov/nasa/worldwindx/**'
204
- }
205
- jar . doLast {
206
- copy {
207
- from " $b uildDir /libs/ ${ jar.archiveName } "
208
- into " ${ project.projectDir } "
209
- rename " ${ jar.archiveName } " , " ${ jar.baseName } . ${ jar.extension } "
213
+ doLast {
214
+ copy {
215
+ from " $b uildDir /libs/ $j ar . archiveName "
216
+ into project . projectDir
217
+ rename " $j ar . archiveName " , " $j ar . baseName . $j ar . extension "
218
+ }
210
219
}
211
220
}
212
221
213
222
javadoc {
214
223
options {
215
- overview = " ${ project.projectDir} /src/overview.html"
224
+ overview = " $project . projectDir /src/overview.html"
216
225
windowTitle = ' WorldWindJava API'
217
226
title = ' NASA WorldWind Java-Community Edition'
218
227
header = ' NASA WorldWind-CE'
@@ -231,3 +240,94 @@ artifacts {
231
240
archives extensionsJar
232
241
archives javadocJar
233
242
}
243
+
244
+ task processMilStd2525SVGs (dependsOn : jar) {
245
+ group = ' build'
246
+ description = ' Processes the MIL-STD-2525 SVG source files.'
247
+
248
+ // Set outputs of this task to be PNG directory.
249
+ def milStd2525PngDir = file(ant. properties[' milstd2525.png.dir' ])
250
+ outputs. dir(milStd2525PngDir)
251
+
252
+ doLast {
253
+ def milStd2525SrcDir = file(ant. properties[' milstd2525.src.dir' ])
254
+
255
+ // If PNG directory doesn't exist, create it.
256
+ if (! milStd2525PngDir. exists()) {
257
+ milStd2525PngDir. mkdirs()
258
+ }
259
+
260
+ def width = ant. properties[' milstd2525.png.width' ]
261
+ def height = ant. properties[' milstd2525.png.height' ]
262
+
263
+ // Rasterize the MIL-STD-2525 SVG sources. Exclude empty directories in order
264
+ // to suppress erroneous error messages from the Apache Batik Rasterizer.
265
+ milStd2525SrcDir. traverse([type : groovy.io.FileType . DIRECTORIES , excludeNameFilter : ~/ fills|frames|icons/ ]) { srcDir ->
266
+ def dstDir = milStd2525PngDir. path + (srcDir. path - milStd2525SrcDir. path)
267
+ exec {
268
+ commandLine ' java' ,\
269
+ ' -jar' ,\
270
+ " $project . projectDir /lib-external/batik/batik-rasterizer.jar" ,\
271
+ ' -m' ,\
272
+ ' image/png' ,\
273
+ ' -maxw' ,\
274
+ width,\
275
+ ' -h' ,\
276
+ height,\
277
+ ' -d' ,\
278
+ dstDir,\
279
+ srcDir
280
+ }
281
+ }
282
+
283
+ // The Forward Edge of Battle (FEBA, 2.X.2.4.2.1) image has a custom height of 16 pixels.
284
+ milStd2525SrcDir. traverse([type : groovy.io.FileType . FILES , nameFilter : ~/ g-g.dlf--------\. svg/ ]) { srcFile ->
285
+ def dstFile = ((milStd2525PngDir. path + (srcFile. path - milStd2525SrcDir. path)) - ' .svg' ) + ' .png'
286
+ exec {
287
+ commandLine ' java' ,\
288
+ ' -jar' ,\
289
+ " $project . projectDir /lib-external/batik/batik-rasterizer.jar" ,\
290
+ ' -m' ,\
291
+ ' image/png' ,\
292
+ ' -maxw' ,\
293
+ width,\
294
+ ' -h' ,\
295
+ ' 16' ,\
296
+ ' -d' ,\
297
+ dstFile,\
298
+ srcFile
299
+ }
300
+ }
301
+
302
+ // Trim the MIL-STD-2525 modifier images to remove transparent borders.
303
+ def modifiersDir = file(" $milStd2525PngDir . path /modifiers" )
304
+ modifiersDir. traverse([type : groovy.io.FileType . FILES ]) { srcFile ->
305
+ exec {
306
+ commandLine ' java' ,\
307
+ ' -cp' ,\
308
+ " $buildDir /libs/$jar . archiveName " ,\
309
+ ' gov.nasa.worldwind.util.ImageTrimmer' ,\
310
+ srcFile
311
+ }
312
+ }
313
+ }
314
+ }
315
+
316
+ task milStd2525Zip (type : Zip , dependsOn : processMilStd2525SVGs) {
317
+ group = ' build'
318
+ description = ' Assembles the MIL-STD-2525 symbology package.'
319
+ def milStd2525OutDir = file(ant. properties[' milstd2525.out.dir' ])
320
+ def milStd2525PngDir = file(ant. properties[' milstd2525.png.dir' ])
321
+ from milStd2525PngDir
322
+ include ' **/*'
323
+ archiveName ' milstd2525-symbols.zip'
324
+ destinationDir milStd2525OutDir
325
+ }
326
+
327
+ task runLayerManager (type : JavaExec , dependsOn : classes) {
328
+ group = ' run'
329
+ description = ' Runs the LayerManager example app.'
330
+ classpath sourceSets. main. runtimeClasspath
331
+ main = ' gov.nasa.worldwindx.examples.layermanager.LayerManagerApp'
332
+ systemProperty ' java.util.logging.config.file' , " $project . projectDir /logging.properties"
333
+ }
0 commit comments