-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
122 lines (104 loc) · 3.97 KB
/
build.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
buildscript {
repositories {
mavenLocal()
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
classpath 'org.standardout:bnd-platform:1.7.0'
classpath 'biz.aQute.bnd:biz.aQute.bndlib:4.3.1'
}
}
def buildTime() {
def df = new java.text.SimpleDateFormat("yyyyMMddHHmm")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}
apply plugin: 'org.standardout.bnd-platform'
repositories {
mavenCentral()
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
// project version is also platform feature version default,
// here uses TestNG version as project version.
version = '7.10.2'
def buildMode = System.getProperty('BUILD_MODE')
def versionWithQualifier
def qualifierPrefix = 'b' // 'b' for Beta
if (buildMode == "release") {
assert !version.endsWith('-SNAPSHOT') : "Please don't use snapshot version ${version} for release"
qualifierPrefix = 'r' // 'r' for Release
}
if (version ==~ /^\d+[\.\d+]+$/) {
versionWithQualifier = version + "." + qualifierPrefix + buildTime()
}
else {
versionWithQualifier = version.substring(0, version.indexOf('-')) + "." + qualifierPrefix + buildTime()
}
defaultTasks 'updateSiteZip'
updateSiteZip.dependsOn clean
platform {
bundle "org.testng:testng:${version}", {
bnd {
// override/set the symbolic name
symbolicName = 'org.testng'
// override/set the bundle name
bundleName = 'testng'
// instruction 'Export-Package', "org.testng.*;version=$version"
instruction 'Import-Package',
'com.beust.jcommander.*;version="[1.8.3,2.0.0)",' +
'org.slf4j.*,' +
'bsh.*;version="[2.0.0,3.0.0)";resolution:=optional,' +
'com.google.inject.*;version="[1.2,5.0)";resolution:=optional,' +
'junit.framework;version="[3.8.1, 5.0.0)";resolution:=optional,' +
'org.junit.*;resolution:=optional,' +
'org.apache.tools.ant.*;version="[1.7.0, 2.0.0)";resolution:=optional,' +
'org.yaml.*;version="[1.6,2.0)";resolution:=optional,' +
'!com.beust.testng,' +
'!org.testng.*,' +
'!com.sun.*'
instruction 'Require-Bundle', 'com.beust.jcommander;bundle-version="[1.8.3,2.0.0)";visibility:=reexport'
instruction 'Bundle-Vendor', 'TestNG Team'
version = versionWithQualifier
}
exclude module: 'ant'
exclude module: 'bsh'
exclude module: 'junit'
exclude module: 'jsr305'
exclude module: 'guice'
}
bundle "org.yaml:snakeyaml:1.21"
bundle "org.slf4j:slf4j-api:1.7.36"
bundle "org.apache-extras.beanshell:bsh:2.0b6", {
bnd {
optionalImport 'org.apache.bsf.*'
}
}
bundle "org.jcommander:jcommander:1.83", {
bnd {
// override/set the symbolic name
symbolicName = 'com.beust.jcommander'
// override/set the bundle name
bundleName = 'jcommander'
}
}
featureId 'org.testng.p2.feature'
featureName 'TestNG P2 Feature'
featureVersion versionWithQualifier
featureProvider 'TestNG Team'
categoryName 'TestNG P2 Libraries'
categoryId 'org.testng.p2.libraries'
useBndHashQualifiers false
useFeatureHashQualifiers false
defaultQualifier ''
downloadsDir = new File(System.properties['user.home'], '.bnd-eclipse')
eclipseMirror = 'http://philippkatz.de/eclipse-p2-minimal.tar.gz'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}