-
Notifications
You must be signed in to change notification settings - Fork 4
/
geotools.gradle
86 lines (75 loc) · 2.28 KB
/
geotools.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
/**
* Adds a combined geotools bundle and an opengis bundle to the platform.
*
* @param geotoolsVersion version of Geotools dependencies
* @param modules the list of geotools modules to add (in group org.geotools)
* @param bundleVersion a version for the merged bundle
*/
def geotools(String geotoolsVersion = '10.4',
List<String> modules = [
'gt-api',
'gt-cql',
'gt-epsg-hsql',
'gt-geojson',
'gt-main',
'gt-shapefile'
], String bundleVersion = geotoolsVersion + '.0.combined') {
repositories {
maven {
url 'https://repo.osgeo.org/repository/release/'
}
// mavenCentral()
}
platform {
bnd group: 'xpp3', name: 'xpp3_min', {
instruction '-removeheaders', 'Require-Capability'
}
feature id: 'platform.shared.geotools',
name: 'Geotools',
version: geotoolsVersion, {
// opengis
plugin "org.geotools:gt-opengis:${geotoolsVersion}", {
bnd {
symbolicName = 'org.opengis'
}
}
// geotools dependencies
modules.each {
if (it != 'gt-opengis') {
plugin "org.geotools:${it}:${geotoolsVersion}"
}
else if (it == 'geotools') {
plugin "org.getools:${it}:${geotoolsVersion}", {
exclude group: 'com.github.spotbugs', module 'spotbugs-annotation'
}
}
}
// geotools bundle
merge {
match {
it.group != null && it.group.startsWith('org.geotools') && it.name != 'gt-opengis'
}
bnd {
symbolicName = 'org.geotools'
bundleName = 'Geotools'
version = bundleVersion
instruction 'Export-Package', "org.geotools.*;version=$bundleVersion"
instruction 'Private-Package', '*'
def tokenizedVersion = geotoolsVersion.tokenize('.|-')
def majorVersion = tokenizedVersion[0] as int
def jtsGeomPackage = (majorVersion < 20) ? 'com.vividsolutions.jts.geom' : 'org.locationtech.jts.geom'
prependImport(
// import eclipse xsd/emf w/o version (as the dependency does not export them)
'org.eclipse.xsd.*', 'org.eclipse.emf.*,',
// add missing imports that result in class loading issues
jtsGeomPackage // because the package is also included in the bundle! (EmptyGeometry)
)
}
}
// geotools depends on log4j
plugin group: 'log4j', name: 'log4j'
}
}
}
// default configuration
geotools()