-
Notifications
You must be signed in to change notification settings - Fork 4
/
groovy.gradle
52 lines (49 loc) · 1.5 KB
/
groovy.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
/**
* Add groovy-all as dependency and ensure that it is used instead of the
* individual groovy modules.
*
* @param groovyVersion the groovy artifact version
* @param addDependency if the dependency to groovy-all should be added
* @param customName a custom name for the created bundle
* @param indy if the invoke dynamic version should be used
*/
def groovyAll(String groovyVersion = '2.5.19', boolean addDependency = true, String customName = null, boolean indy = false) {
configurations {
bndplatform {
// groovy
resolutionStrategy.eachDependency {
if (it.requested.group == 'org.codehaus.groovy') {
// always use groovy-all instead of (groovy-*)
//XXX classifier seems to be ignored here -> normal groovy-all will be added
it.useTarget "org.codehaus.groovy:${it.requested.name}:${groovyVersion}"
}
}
}
}
platform {
if (customName && !indy) {
// custom symbolic name
bnd('org.codehaus.groovy:groovy-all') {
symbolicName = customName
}
}
if (addDependency || indy) {
// if (addDependency) {
feature id: 'platform.shared.groovy-all',
name: 'Groovy complete',
version: groovyVersion, {
bundle "org.codehaus.groovy:groovy-all:${groovyVersion}${indy ? ':indy' : ''}", {
bnd {
instruction '-removeheaders', 'Require-Capability'
if (customName) {
symbolicName = customName
}
}
}
}
}
imports(group: 'org.codehaus.groovy') {
versionStrategy = MINIMUM // assume that groovy is backwards compatible
}
}
}