Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update GeoTools to 29.1 #54

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repositories {
version = '5.0.0'

ext {
geotoolsVersion = '21.0'
geotoolsVersion = '29.1'
wicketVersion = '6.10.0'
}

Expand All @@ -54,15 +54,13 @@ include {

from 'modules/shared/adaptions' // all adaptions

from 'modules/resources' // resource bundles

from('modules/shared/geotools.gradle') {
from('modules/geotools.gradle') {
geotools geotoolsVersion, [
'geotools',
'gt-cql',
'gt-epsg-hsql',
'gt-geojson',
'gt-geometry',
// 'gt-geometry',
'gt-main',
'gt-shapefile',
'gt-render',
Expand Down Expand Up @@ -128,7 +126,7 @@ include {

// TopoJSON support
from 'modules/topojson-j.gradle'

// ensures that always a fixed version of groovy-all is used as groovy dependency
from 'modules/shared/groovy.gradle', {
//XXX custom name is required w/ indy - problem is that Gradle still adds the normal groovy-all dependency
Expand Down Expand Up @@ -224,6 +222,7 @@ platform {

// uncomment and update with eclipse directory only during development
// eclipseHome = new File('/Users/kapil/eclipse/eclipse-4.24-rcp-for-hale-studio-java17/Eclipse-for-hale-studio-5.0.0.app/Contents/Eclipse')
// eclipseHome = new File('C:/Users/EmanuelaEpure/Downloads/eclipse-rcp-2022-06-R-win32-x86_64/eclipse')
// override behavior for all bundles to prevent package uses conflicts for packages provided by the JRE
override {
// ensure javax.annotation imports are w/o version
Expand Down Expand Up @@ -258,6 +257,36 @@ platform {
bundle group: 'org.geotools.xsd', name: 'gt-xsd-gml2', version: geotoolsVersion
bundle group: 'org.geotools.xsd', name: 'gt-xsd-gml3', version: geotoolsVersion

bnd group: 'si.uom', name: 'si-quantity', {
prependImport 'javax.measure.*'
}

bnd group: 'si.uom', name: 'si-units-java8', {
prependImport 'javax.measure.*'
prependImport 'si.uom.quantity.*'
}

bnd group: 'systems.uom', name: 'systems-quantity', {
prependImport 'javax.measure.*'
}

// bnd group: 'systems.uom', name: 'systems-common-java8', {
// prependImport 'javax.measure.*'
// prependImport 'si.uom.quantity.*'
// }

bnd group: 'tec.uom', name: 'uom-se', {
prependImport 'javax.measure.*'
}

bnd group: 'tec.uom.lib', name: 'uom-lib-common', {
prependImport 'javax.measure.*'
}

bnd group: 'tech.units', name: 'indriya', {
prependImport 'tec.uom.lib.common.*'
}

bnd group: 'org.locationtech.jts', name: 'jts-core', {
instruction 'Export-Package', "*;version=$version"
}
Expand Down Expand Up @@ -340,8 +369,8 @@ platform {
bundle 'org.codehaus.castor:castor-core:1.4.1'

// Units of Measurement
bundle 'systems.uom:systems-common-java8:0.7.2'
bundle 'systems.uom:systems-quantity:0.7.2'
// bundle 'systems.uom:systems-common-java8:0.7.2'
// bundle 'systems.uom:systems-quantity:0.7.2'

bnd group: 'com.sun.istack', name: 'istack-commons-runtime', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
Expand Down
90 changes: 90 additions & 0 deletions modules/geotools.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* 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)
)
//optional import instr oracle.jdbc
optionalImport(
'oracle.*'
)
}
}

// geotools depends on log4j
plugin group: 'log4j', name: 'log4j'

}
}
}

// default configuration
geotools()
Loading
Loading