-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
284 lines (242 loc) · 10.8 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
plugins {
id 'org.eclipse.buildship.build.build-definition-plugin'
id 'eclipse'
id 'com.gradle.build-scan' version '2.2.1'
}
wrapper {
distributionUrl = "https://services.gradle.org/distributions/gradle-5.2.1-bin.zip"
}
// the default version can be overridden through -Peclipse.version=<version>
// also the target platforms contains 1) the Eclipse SDK 2) the latest junit 3) SWTBot 2.2.1
eclipseBuild {
defaultEclipseVersion = '410'
final def swtPluginId = "org.eclipse.swt.${ECLIPSE_WS}.${ECLIPSE_OS}.${ECLIPSE_ARCH}"
// define version mapping for the 3rd-party dependencies that are not specific to a particular Eclipse version
def eclipseVersionAgnosticDependencies = [
// 'org.gradle.toolingapi' : toolingApiBundleVersion,
'org.slf4j.api' : '1.7.2',
// 'org.slf4j.simple' : '1.7.2',
'com.google.guava' : '21.0.0',
// 'com.google.gson' : '2.7.0',
// 'org.apache.log4j' : '1.2.15',
'org.eclipse.swtbot.eclipse.finder' : '2.2.1',
'org.eclipse.swtbot.junit4_x' : '2.2.1',
// 'org.jetbrains.kotlin.bundled-compiler' : '0.8.7',
// 'org.jetbrains.kotlin.core' : '0.8.7'
]
// 2018-12
targetPlatform {
eclipseVersion = '410'
targetDefinition = file('tooling-e410.target')
// oomph
def oomphVersion = '1.10.0'
def oomphDependencies = [
'org.eclipse.oomph.base' : oomphVersion,
'org.eclipse.oomph.setup' : oomphVersion,
'org.eclipse.oomph.setup.core' : oomphVersion,
'org.eclipse.oomph.resources' : oomphVersion
]
def oomphEditDependencies = [
'org.eclipse.oomph.base.edit' : oomphVersion,
'org.eclipse.oomph.predicates.edit' : oomphVersion,
'org.eclipse.oomph.resources.edit' : oomphVersion,
'org.eclipse.oomph.setup.edit' : oomphVersion
]
// buildship
def buildshipVersion = '3.0.0'
def buildshipDependencies = [
'org.eclipse.buildship.core' : buildshipVersion,
'org.eclipse.buildship.ui' : buildshipVersion
]
def targetAdditionalDependencies =
eclipseVersionAgnosticDependencies +
oomphDependencies +
oomphEditDependencies +
buildshipDependencies
versionMapping = [
'org.eclipse.emf.ecore' : '2.15.0',
'org.eclipse.emf.edit' : '2.11.0',
'org.eclipse.swt' : '3.108.100',
"$swtPluginId" : '3.108.100',
'com.ibm.icu' : '62.1.0',
'org.eclipse.core.expressions' : '3.6.200',
'org.eclipse.core.filesystem' : '1.7.200',
'org.eclipse.core.net' : '1.3.300',
'org.eclipse.core.resources' : '3.13.200',
'org.eclipse.core.runtime' : '3.15.100',
'org.eclipse.core.variables' : '3.4.200',
'org.eclipse.debug.core' : '3.13.100',
'org.eclipse.debug.ui' : '3.13.200',
'org.eclipse.help' : '3.8.200',
'org.eclipse.jdt.core' : '3.16.0',
'org.eclipse.jdt.junit.core' : '3.10.200',
'org.eclipse.jdt.launching' : '3.11.100',
'org.eclipse.jdt.ui' : '3.15.100',
'org.eclipse.jface.databinding' : '1.8.400',
'org.eclipse.jface.text' : '3.15.0',
'org.eclipse.ui' : '3.110.0',
'org.eclipse.ui.console' : '3.8.200',
'org.eclipse.ui.editors' : '3.11.300',
'org.eclipse.ui.ide' : '3.14.200',
'org.eclipse.ui.navigator' : '3.7.300',
'org.eclipse.ui.views' : '3.9.200',
'org.eclipse.ui.workbench.texteditor' : '3.11.200',
'org.junit' : '4.12.0'
] + targetAdditionalDependencies
}
// 2019-03
targetPlatform {
eclipseVersion = '411'
targetDefinition = file('tooling-e411.target')
// oomph
def oomphVersion = '1.12.0'
def oomphDependencies = [
'org.eclipse.oomph.base' : oomphVersion,
'org.eclipse.oomph.setup' : oomphVersion,
'org.eclipse.oomph.setup.core' : oomphVersion,
'org.eclipse.oomph.resources' : oomphVersion
]
def oomphEditDependencies = [
'org.eclipse.oomph.base.edit' : oomphVersion,
'org.eclipse.oomph.predicates.edit' : oomphVersion,
'org.eclipse.oomph.resources.edit' : oomphVersion,
'org.eclipse.oomph.setup.edit' : oomphVersion
]
// buildship
def buildshipVersion = '3.0.1'
def buildshipDependencies = [
'org.eclipse.buildship.core' : buildshipVersion,
'org.eclipse.buildship.ui' : buildshipVersion
]
def targetAdditionalDependencies =
eclipseVersionAgnosticDependencies +
oomphDependencies +
oomphEditDependencies +
buildshipDependencies
versionMapping = [
'org.eclipse.emf.ecore' : '2.17.0',
'org.eclipse.emf.edit' : '2.14.0',
'org.eclipse.swt' : '3.110.0',
"$swtPluginId" : '3.110.0',
'com.ibm.icu' : '63.1.0',
'org.eclipse.core.expressions' : '3.6.200',
'org.eclipse.core.filesystem' : '1.7.200',
'org.eclipse.core.net' : '1.3.400',
'org.eclipse.core.resources' : '3.13.200',
'org.eclipse.core.runtime' : '3.15.100',
'org.eclipse.core.variables' : '3.4.300',
'org.eclipse.debug.core' : '3.13.200',
'org.eclipse.debug.ui' : '3.13.300',
'org.eclipse.help' : '3.8.200',
'org.eclipse.jdt.core' : '3.17.0',
'org.eclipse.jdt.junit.core' : '3.10.200',
'org.eclipse.jdt.launching' : '3.12.100',
'org.eclipse.jdt.ui' : '3.16.100',
'org.eclipse.jface.databinding' : '1.8.400',
'org.eclipse.jface.text' : '3.15.0',
'org.eclipse.ui' : '3.112.0',
'org.eclipse.ui.console' : '3.8.300',
'org.eclipse.ui.editors' : '3.11.300',
'org.eclipse.ui.ide' : '3.14.300',
'org.eclipse.ui.navigator' : '3.7.300',
'org.eclipse.ui.views' : '3.9.300',
'org.eclipse.ui.workbench.texteditor' : '3.11.200',
'org.junit' : '4.12.0'
] + targetAdditionalDependencies
}
}
// read the current version from an external file and add a timestamp suffix if requested by the caller
ext.baseVersion = file('version.txt').text.trim()
ext.versionQualifier = getVersionQualifier()
version = baseVersion + '.' + versionQualifier
// TODO: (schwitzkroko) let handle .tooling folder locally in root project root,
// ensure that local common repos ('mavenized-target-platform') are created for and used by all project builds,
// currently this approach fails at 'assemble*'...
// allprojects {
// ext.set("targetPlatformsDir", "${rootDir}/.tooling/eclipse/targetPlatforms")
// }
subprojects {
version = rootProject.version
apply plugin: 'eclipse'
plugins.withType(JavaPlugin) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
// configure the repositories where the external dependencies can be found
repositories {
maven {
name = 'mavenized-target-platform'
url "${eclipsebuild.Config.on(project).mavenizedTargetPlatformDir}"
}
// maven {
// name = 'gradle-snapshots'
// url gradleSnapshotsRepositoryUrl
// }
// maven {
// name = 'gradle-releases'
// url gradleReleasesRepositoryUrl
// }
// maven {
// name = 'gradle-remote'
// url gradleRemoteRepositoryUrl
// }
}
}
tasks.withType(eclipsebuild.DownloadEclipseSdkTask) {
def os = org.gradle.internal.os.OperatingSystem.current()
// dont support 32bit here anymore
// def arch = System.getProperty("os.arch").contains("64") ? "64" : "32"
def mirrorBaseUrl = toolingEclipseSdkBaseUrl?: "http://builds.gradle.org:8000/eclipse/sdk"
if (os.windows) {
// downloadUrl = "${mirrorBase}/eclipse-sdk-4.4.2-windows-${arch}.zip"
downloadUrl = "${mirrorBaseUrl}/eclipse-SDK-4.4.2-win32-x86_64.zip"
} else if (os.macOsX) {
// downloadUrl = "${mirrorBase}/eclipse-sdk-4.4.2-macosx-${arch}.tar.gz"
downloadUrl = "${mirrorBaseUrl}/eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz"
} else if (os.linux) {
// downloadUrl = "${mirrorBase/eclipse-sdk-4.4.2-linux-${arch}.tar.gz"
downloadUrl = "${mirrorBaseUrl}/eclipse-SDK-4.4.2-macosx-cocoa-x86_64.tar.gz"
}
logger.debug("sdk url selected: ${downloadUrl}")
}
String getVersionQualifier() {
def config = eclipsebuild.BuildshipConfig.on(project)
// determine suffix for snapshot and milestone builds
def suffix
if (config.isRelease()) {
suffix = ''
} else if (config.isMilestone()) {
suffix = '-m'
} else if (config.isSnapshot()) {
suffix = '-s'
} else {
throw new IllegalStateException("BuildshipConfig must either be a release, milestone, or snapshot.")
}
// use full timestamp on CI vs. date-only for local builds
if (project.hasProperty('build.invoker') && project.property('build.invoker') == 'ci') {
// note that for Eclipse plugin versions, the '-' and '.' character are invalid in front of the build id
'v' + new Date().format('yyyyMMdd-kkmm', TimeZone.getTimeZone('GMT')) + suffix
} else {
'v' + new Date().format('yyyyMMdd', TimeZone.getTimeZone('GMT')) + suffix
}
}
def getBundleVersion(String version) {
def matcher = version =~ /(\d+)\.(\d+)(?:-.*|\.(\d+)(?:-.*)?)?/
if (matcher.matches()) {
def major = matcher.group(1)
def minor = matcher.group(2)
def service = matcher.group(3) ?: '0'
return "$major.$minor.$service"
} else {
throw new IllegalArgumentException("Invalid bundle version: $version")
}
}
eclipse {
project {
name = 'net.ifao.oomph.setup.buildship.ROOT'
}
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}