-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
259 lines (225 loc) · 8.84 KB
/
build.gradle
File metadata and controls
259 lines (225 loc) · 8.84 KB
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
import org.jazzcommunity.development.BackupTask
import org.jazzcommunity.development.BootStrapTask
import org.jazzcommunity.development.DeploymentTask
import org.jazzcommunity.development.DownloadTask
import org.jazzcommunity.development.ReleaseTask
import org.jazzcommunity.development.InitializeTask
import org.jazzcommunity.development.P2CreationTask
import org.jazzcommunity.development.P2ProfileTask
import org.jazzcommunity.development.RunTask
import org.jazzcommunity.development.JtsTask
import org.jazzcommunity.development.SetupTask
import org.jazzcommunity.development.InfoTask
import org.jazzcommunity.development.UpgradeTask
import org.jazzcommunity.development.library.DetectOperatingSystem
import org.jazzcommunity.development.library.FileTools
import org.jazzcommunity.development.library.RuntimeDetector
import org.jazzcommunity.development.library.config.ConfigReader
plugins {
id 'java-library'
id 'com.diffplug.osgi.equinoxlaunch'
id 'com.diffplug.oomph.ide'
id 'de.undercouch.download' version '4.0.4'
}
dependencies {
api 'com.diffplug.gradle:goomph:3.22.0'
}
repositories {
jcenter()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
oomphIde {
repoEclipseLatest()
splash 'buildSrc/resources/logo.png'
/*
* When debugging plugins for the goomph generated environment, it really helps when you:
* 1. launch the ide using gradlew run
* 2. wait until eclipse has loaded and close the application
* 3. (manually deploy whatever plugin you need if not added here yet)
* 4. use https://stackoverflow.com/questions/1489648/eclipse-doesnt-load-plugins-in-the-dropins-folder
* to get full debug information of plugin deployment
*/
// Use legacy GEF (up to 4.0.0) because the new releases don't have the required
// org.eclipse.draw2d and org.eclipse.gef bundles for feature based launches anymore.
repo 'https://download.eclipse.org/tools/gef/updates/legacy/releases/4.0.0_gef-master_1952'
feature 'org.eclipse.gef'
pde {
targetplatform 'ibm-sdk', {
it.installation RuntimeDetector.getTargetPlatform(project)
}
}
// add the extracted test project
if (FileTools.exists('jde/dev/projects/tests')) {
addProjectFolder 'jde/dev/projects/tests'
}
// add the custom launches for creating required runtime files for a new release
if (FileTools.exists('jde/dev/projects/launches')) {
addProjectFolder 'jde/dev/projects/launches'
}
// add the enhanced class decompiler for easier browsing of the jazz sdk
repo 'https://ecd-plugin.github.io/update/'
feature 'org.sf.feeling.decompiler'
// load custom proxy configuration. default configuration is empty
p2director {
addArg('plugincustomization', 'jde/user/eclipse-proxy.ini')
}
}
task initialize(type: InitializeTask) {
group = "Jazz Development Environment"
description = "Initialize eclipse plugin environment for newest sdk."
sdk = ""
}
// Unpack dropins. This is always done when running ide, even if there aren't any, or they have
// all been unpacked already
task unpack(type: Copy) {
fileTree(dir: "jde/dropins").include {"*.zip"}.each { zip ->
from(zipTree(zip)) {
include "**/*.jar"
// this will flatten the entire zip file to only leave the jar file in the dropins folder
eachFile { file ->
file.relativePath = new RelativePath(true, file.name)
}
includeEmptyDirs false
}
into "jde/dev/dropins"
}
}
// make sure that unpack is run both when initialize is called on it's own, and also
// when run as a dependant task
initialize.dependsOn(unpack)
ideSetupP2.dependsOn(unpack)
ideSetupP2.dependsOn(initialize)
// idea taken from https://gitter.im/diffplug/goomph/archives/2017/09/08
// I might even be able to run the initialize bit here as well?
ideSetupP2.doLast {
copy {
from 'jde/dev/dropins'
into 'build/oomph-ide/dropins'
}
}
ideClean.doLast {
// Always delete the dev folder when cleaning IDE. This will result in initialize running the
// next time the ide task is executed.
delete 'jde/dev'
// Recreate empty projects folder. This is necessary because of some weird behaviour in the ide
// task. Folders are checked at the very start of the entire build lifecycle, regardless of
// their content. So if project folders exist, they can be filled later on by the dependant
// tasks, but they have to exist at the very beginning. This work around makes sure that the
// empty folders always exist.
mkdir 'jde/dev/projects'
mkdir 'jde/dev/projects/launches'
mkdir 'jde/dev/projects/tests'
}
task launches() {
doLast {
copy {
from 'tool/projects/launches'
into 'jde/dev/projects/launches'
}
}
}
task packageDatabase(type: Zip) {
from 'jde/dev/db'
include '**/*'
archiveFileName = provider {
FileTools.newestVersion('jde/dev/initialize') + '_db.zip'
}
destinationDirectory = file('jde/dev/release/db')
}
task release(type: ReleaseTask) {
group = "Jazz Development Environment"
description = "Creates new distributable files for an sdk. Options: [--deploy], default=do not copy"
// maybe find a way to just ignore this task if initialize hasn't been run
dependsOn packageDatabase
deploy = false
}
task p2create(type: P2CreationTask) {
group = "Jazz Development Environment"
description = "Make P2 repository from provided sdk. Options [--sdk=VERSION], default=latest"
sdk = ""
dependsOn ideSetupP2
}
task p2use(type: P2ProfileTask) {
group = "Jazz Development Environment"
description = "Configure user maven settings to use local p2 repository. Options [--sdk=VERSION;--out=file|console;--create=true|false], defaults=latest;file;false"
sdk = ""
out = "file"
create = "false"
}
task bootstrap(type: BootStrapTask) {
group = "Jazz Development Environment"
description = "Create folders for user environment. Generally only needs to be run once."
}
task info(type: InfoTask) {
group = "Jazz Development Environment"
description = "Print information of the currently available configuration."
}
task backup(type: BackupTask) {
group = "Jazz Development Environment"
description = "Backup user files. Options: [--mode=slim|user|full], default=slim"
// default mode used when no command line argument is supplied, eg no '--mode=full'
mode = "slim"
}
task setup(type: SetupTask) {
group = "Jazz Development Environment"
description = "Setup a new runtime based on an RTC sdk. Options: [--sdk=VERSION], default=latest"
// will default to setting up the latest sdk version
sdk = ""
}
task upgrade(type: UpgradeTask) {
group = "Jazz Development Environment"
description = "Copies all non-user files after upgrading from an older jazz development environment"
}
// define custom properties for entire project
ext {
connections = []
}
task download(type: DownloadTask) {
group = "Jazz Development Environment"
description = "Automatically download artifacts used for running the jazz development environment. Options: [--sdk=VERSION]"
sdk = ""
dropins = false
doLast {
def connections = project.getProperties().get("connections")
for (def connection : connections) {
download {
src connection.getUrl()
dest connection.getDestination()
header 'Cookie', connection.getCookieHeader()
}
}
}
}
task jts(type: JtsTask) {
group = "Jazz Team Server"
description = "Create an integration test environment provisioned with a minimal Jazz Team Server configuration. Options: [--server=VERSION], default=latest"
server = ""
}
task deploy(type: DeploymentTask) {
group = "Jazz Team Server"
description = "Deploy available plugins to known JTS locations."
}
allprojects {
afterEvaluate { project ->
def runtime = RuntimeDetector.get(project)
if (runtime.isPresent()) {
project.task('run', type: RunTask) {
group = "Jazz Development Environment"
description = "Run a jetty server for debugging. Options: [-Pruntime=VERSION], default=latest"
workingDir './jde/runtime/' + runtime.get()
ignoreExitValue = true
// Somehow, the native OperatingSystem interface doesn't work properly yet
// It's an incubating feature, so I guess we'll just have to wait.
if (DetectOperatingSystem.windows) {
def line = ConfigReader.windowsTerminal()
commandLine line
}
if (DetectOperatingSystem.linux) {
def line = ConfigReader.linuxTerminal()
commandLine line
}
}
}
}
}