-
Notifications
You must be signed in to change notification settings - Fork 4
/
postgis.gradle
61 lines (52 loc) · 1.97 KB
/
postgis.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
import static org.standardout.gradle.plugin.platform.internal.util.VersionUtil.toOsgiVersion
/**
* Merged PostGIS and PostgreSQL driver bundle.
*
* @param postgisVersion the version of the PostGIS JDBC driver
* @param postgresVersion the version of the PostgreSQL JDBC driver
* @param buddies the list of symbolic names of bundles that should be registered as buddies (Eclipse-RegisterBuddy)
*/
def postgis(String postgisVersion = '2.2.1', String postgresVersion = '42.2.4', List<String> buddies = []) {
// repositories {
// maven {
// // repo with (more or less current) PostGIS JDBC driver
// url 'http://52north.org/maven/repo/releases/'
// }
// }
platform {
def combinedVersion = postgresVersion + '.postgis-' + postgisVersion
feature id: 'platform.shared.postgis',
name: 'PostgreSQL and PostGIS JDBC drivers', {
bundle "net.postgis:postgis-jdbc:$postgisVersion", {
exclude group: 'postgresql', module: 'postgresql'
}
bundle "org.postgresql:postgresql:$postgresVersion"
merge {
include group: 'org.postgresql', name: 'postgresql'
include group: 'net.postgis', name: 'postgis-jdbc'
bnd {
bundleName = 'PostgreSQL and PostGIS JDBC Drivers'
symbolicName = 'org.postgresql.jdbc'
version = combinedVersion
if (buddies) {
// register buddy
instruction 'Eclipse-RegisterBuddy', buddies.join(',')
// add as optional required bundle
instruction 'Require-Bundle', buddies.collect{
it + ';resolution:=optional'
}.join(',')
}
prependImport 'waffle.*;resolution:=optional'
// package export
// XXX any way to find out the actual resolved version?
def pgv = toOsgiVersion(postgisVersion)
def psv = toOsgiVersion(postgresVersion)
prependImport "org.postgresql.*;version=$psv"
instruction 'Export-Package',
"org.postgis;version:=$pgv,org.postgis.*;version:=$pgv," +
(properties['Export-Package']?:"*;version:=$psv")
}
}
}
}
}