-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.orig
353 lines (300 loc) · 9.81 KB
/
build.gradle.orig
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-clover-plugin:2.2.0'
}
}
// checking the presence of an Eclipse API baseline repositorsy
if (project.properties['api.baseline'] == null || project.properties['api.baseline'].isEmpty()) {
System.err.println("Cannot find an Eclipse API baseline repository")
System.err.println("Create file iobserve-analysis/gradle.properties if missing.")
System.err.println("Add the property api.baseline=path to the repository")
System.err.println("Use / for path separation")
System.err.println("The repository can be found at [email protected]:research-iobserve/iobserve-repository.git")
} else {
println "iObserve API baseline repository is at: " + project.properties['api.baseline']
}
<<<<<<< HEAD
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
// make it easy to test a snapshot version of goomph
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
// grab dependencies from the gradle plugin portal
maven { url 'https://plugins.gradle.org/m2/' }
}
// make sure we don't cache stale snapshot versions
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
classpath 'com.bmuschko:gradle-clover-plugin:2.2.0'
// a bunch of eclipse stuff
classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}"
// creates a targetplatform
classpath "org.standardout:bnd-platform:${VER_BND_PLATFORM}"
}
=======
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.bmuschko.clover'
def confDir = "${project.rootDir}/tools_configurations"
repositories {
mavenCentral()
mavenLocal()
}
clover {
report {
html = true
}
>>>>>>> origin/master
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'com.bmuschko.clover'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '0.0.3-SNAPSHOT'
group = 'org.iobserve'
clover {
report {
html=true
}
}
// --- quality assurance plugins ---
apply plugin: 'pmd'
pmd {
// the used PMD version should be the same version as the PMD Eclipse plugin (https://marketplace.eclipse.org/content/eclipse-pmd) uses
// toolVersion = pmdAndCpdVersion
ignoreFailures = true
// Clear the rule set first. Otherwise we would have a lot of additional rules in our rule set.
// ruleSets = []
// ruleSetFiles = files(resolveRelativeToParent(dirConfig, 'pmdrules.xml'))
}
// check.dependsOn(':cpdCheck')
apply plugin: 'checkstyle'
checkstyle {
ignoreFailures = true
showViolations = false
configFile = file("$confDir/iobserve-checkstyle-rules.xml")
configDir = file("$confDir")
}
// apply plugin: 'findbugs'
// findbugs {
// toolVersion = fbVersion
// ignoreFailures = true
// effort = "max"
// reportLevel = "low"
// excludeFilter = resolveRelativeToParent(dirConfig, 'fb-filter.xml')
//}
tasks.withType(Pmd) {
reports {
xml.enabled = true
html.enabled = false
}
}
tasks.withType(Checkstyle) {
reports {
xml.enabled true
}
}
tasks.withType(FindBugs) {
reports {
xml.enabled = true
html.enabled = false
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {url "https://repo.eclipse.org/content/groups/releases/" }
maven {url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven {url "https://oss.sonatype.org/content/repositories/releases/" }
maven {url "https://mvnrepository.com/artifact/org.eclipse.emf/org.eclipse.emf.ecore" }
maven {url "https://oss.sonatype.org/content/groups/public/"}
maven {url "https://jitpack.io"}
maven {url "https://mvnrepository.com/artifact/org.eclipse/ocl" }
maven {url "http://mvnrepository.com/artifact/org.eclipselabs/cdo.p2"}
maven {url "http://mvnrepository.com/artifact/org.eclipselabs/cdo"}
maven {url "http://mvnrepository.com/artifact/org.eclipselabs/cdo-maven"}
maven {url "http://mvnrepository.com/artifact/commons-daemon/commons-daemon"}
maven {url "http://mvnrepository.com/artifact/commons-cli/commons-cli"}
maven {url "https://mvnrepository.com/artifact/org.antlr/antlr-runtime"}
maven {url "https://mvnrepository.com/artifact/org.gradle/gradle-tooling-api" }
maven {url project.properties['api.baseline']}
// SNAPSHOT versions are free to rely on other SNAPSHOT libraries
if (project.version.endsWith('SNAPSHOT')) {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
// local eclipse maven (created by Goomph)
maven {
url rootProject.file('target.p2/build/p2asmaven/maven')
}
}
<<<<<<< HEAD
=======
ext {
appName = "org.iobserve"
}
>>>>>>> origin/master
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
}
}
}
task reports {
doLast {
def reportCollection = ""
subprojects.each { s ->
reportCollection += "\t\t<h2>" + s.name + "</h2>\n"
reportCollection += "\t\t<ul>\n"
def folder = new File ("$projectDir/" + s.name + "/build/reports/checkstyle")
if (folder.exists()) {
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/checkstyle/main.html\">checkstyle main</a></li>\n"
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/checkstyle/test.html\">checkstyle test</a></li>\n"
}
folder = new File ("$projectDir/" + s.name + "/build/reports/tests")
if (folder.exists()) {
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/tests/test/index.html\">JUnit tests</a></li>\n"
}
folder = new File ("$projectDir/" + s.name + "/build/reports/clover")
if (folder.exists()) {
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/clover/html/index.html\">Test coverage</a></li>\n"
}
folder = new File ("$projectDir/" + s.name + "/build/reports/pmd")
if (folder.exists()) {
def mainFile = new File ("$projectDir/" + s.name + "/build/reports/pmd/main.html")
def testFile = new File ("$projectDir/" + s.name + "/build/reports/pmd/test.html")
if (mainFile.exists()) {
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/pmd/main.html\">PMD main</a></li>\n"
}
if (testFile.exists()) {
reportCollection += "\t\t\t<li><a href=\"" + s.name + "/build/reports/pmd/test.html\">PMD test</a></li>\n"
}
}
reportCollection += "\t\t</ul>\n"
}
new File("$projectDir/reports.html").text = """
<html>
<head>
<title>Project Summary</title>
</head>
<body>
<h1>Project Summary</h1>
$reportCollection
</body>
</html>
"""
}
}
/////////////
// PLUGINS //
/////////////
// tasks to clean and jar all of the plugins
Closure IS_PLUGIN = { it.name.startsWith('peropteryx') }
configure(subprojects.findAll(IS_PLUGIN)) {
// we need the maven repo from p2
evaluationDependsOn(':target.p2')
def PROJECT_NAME = it.name
//////////
// JAVA //
//////////
apply plugin: 'java'
sourceSets {
main { java {
srcDir 'src'
} }
test { java {
srcDir 'test'
} }
}
sourceCompatibility = VER_JAVA
targetCompatibility = VER_JAVA
// add SWT and the appropriate platform-native SWT for building and testing
dependencies {
compile "eclipse-deps:org.eclipse.swt:+"
compile "eclipse-deps:org.eclipse.swt.${com.diffplug.common.swt.os.SwtPlatform.getNative()}:+"
}
//////////
// OSGI //
//////////
// create the manifest
apply plugin: 'com.diffplug.gradle.osgi.bndmanifest'
osgiBndManifest {
copyTo 'META-INF/MANIFEST.MF'
}
// configure the OSGi bundle
jar.manifest.attributes(
'-exportcontents': 'peropteryx.*',
'-removeheaders': 'Bnd-LastModified,Bundle-Name,Created-By,Tool,Private-Package,Require-Capability',
'Import-Package': '!javax.annotation.*,*',
'Bundle-SymbolicName': project.name,
'Bundle-RequiredExecutionEnvironment': 'JavaSE-1.8',
'Require-Capability': 'osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"',
'Bundle-Vendor': 'iObserve',
'Bundle-License': "http://www.apache.org/licenses/LICENSE-2.0",
'Export-Package': 'org.iobserve.planning.peropteryx.rcp'
)
//////////////////////
// ECLIPSE PROJECTS //
//////////////////////
apply plugin: 'eclipse'
// remove the build folder
apply plugin: 'com.diffplug.gradle.eclipse.excludebuildfolder'
// improve the project deps
apply plugin: 'com.diffplug.gradle.eclipse.projectdeps'
// handle build.properties correctly
apply plugin: 'com.diffplug.gradle.eclipse.buildproperties'
eclipse {
project {
natures 'org.eclipse.pde.PluginNature'
natures 'org.eclipse.jdt.core.javanature'
buildCommand 'org.eclipse.jdt.core.javabuilder'
buildCommand 'org.eclipse.pde.ManifestBuilder'
buildCommand 'org.eclipse.pde.SchemaBuilder'
}
classpath {
downloadSources true
downloadJavadoc true
}
jdt {
sourceCompatibility VER_JAVA
targetCompatibility VER_JAVA
}
}
// always create "fresh" projects
tasks.eclipse.dependsOn(cleanEclipse)
}
/////////////////////////////////////////////////////////
// Root eclipse project for tinkering with build files //
/////////////////////////////////////////////////////////
apply plugin: 'com.diffplug.gradle.eclipse.resourcefilters'
eclipseResourceFilters {
exclude().folders().name('com.diffplug.*')
}
/////////////////////////////
// Setup a headless launch //
/////////////////////////////
apply plugin: 'com.diffplug.gradle.equinoxlaunch'
equinoxLaunch {
codegenSetup {
source.addProject(project(':peropteryx.rcp'))
source.addMaven('com.google.guava:guava:17.0')
source.addMaven('com.google.guava:guava:18.0')
}
}