forked from ironjacamar/ironjacamar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
448 lines (382 loc) · 14.3 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
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
/*
* IronJacamar, a Java EE Connector Architecture implementation
* Copyright 2015, Red Hat Inc, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the Eclipse Public License 1.0 as
* published by the Free Software Foundation.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse
* Public License for more details.
*
* You should have received a copy of the Eclipse Public License
* along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
import org.apache.tools.ant.filters.*;
defaultTasks 'build'
version = "2.0.0-SNAPSHOT"
// Dependencies
ext {
libraries = [
apache_el: "org.mortbay.jasper:apache-el:8.0.27",
ant: "org.apache.ant:ant:1.9.7",
apiviz: "org.jboss.apiviz:apiviz:1.3.2.GA",
byteman: "org.jboss.byteman:byteman:3.0.5",
byteman_submit: "org.jboss.byteman:byteman-submit:3.0.5",
fasterxml: "com.fasterxml:classmate:1.3.1",
fungal: "com.github.fungal:fungal:0.11.0.Final",
fungal_cli: "com.github.fungal:fungal-cli:0.11.0.Final",
hibernate_validator: "org.hibernate:hibernate-validator:5.2.4.Final",
jandex: "org.jboss:jandex:2.0.2.Final",
javax_inject: "javax.inject:javax.inject:1",
jboss_common: "org.jboss:jboss-common-core:2.5.0.Final",
jboss_jaspi: "org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.1_spec:1.0.0.Final",
jboss_logging: "org.jboss.logging:jboss-logging:3.3.0.Final",
jboss_logging_manager: "org.jboss.logmanager:jboss-logmanager:2.0.3.Final",
jboss_logging_manager_log4j: "org.jboss.logmanager:log4j-jboss-logmanager:1.1.2.Final",
jboss_logging_processor: "org.jboss.logging:jboss-logging-processor:2.0.1.Final",
jboss_naming: "org.jboss.naming:jnpserver:5.0.3.GA",
jboss_stdio: "org.jboss.stdio:jboss-stdio:1.0.2.GA",
jboss_threads: "org.jboss.threads:jboss-threads:2.2.1.Final",
jetty_annotation: "javax.annotation:javax.annotation-api:1.2",
jetty_asm: "org.ow2.asm:asm:5.0.1",
jetty_asm_commons: "org.ow2.asm:asm-commons:5.0.1",
jetty_ecj: "org.eclipse.jdt.core.compiler:ecj:4.4.2",
jetty_dom4j: "dom4j:dom4j:1.6.1",
jetty_jasper: "org.mortbay.jasper:jasper-jsp:8.0.27",
jetty_server_annotations: "org.eclipse.jetty:jetty-annotations:9.3.8.v20160314",
jetty_server_continuation: "org.eclipse.jetty:jetty-continuation:9.3.8.v20160314",
jetty_server_http: "org.eclipse.jetty:jetty-http:9.3.8.v20160314",
jetty_server_io: "org.eclipse.jetty:jetty-io:9.3.8.v20160314",
jetty_server_jmx: "org.eclipse.jetty:jetty-jmx:9.3.8.v20160314",
jetty_server_jsp: "org.eclipse.jetty:apache-jsp:9.3.8.v20160314",
jetty_server_plus: "org.eclipse.jetty:jetty-plus:9.3.8.v20160314",
jetty_server_schemas: "org.eclipse.jetty.toolchain:jetty-schemas:3.1",
jetty_server_security: "org.eclipse.jetty:jetty-security:9.3.8.v20160314",
jetty_server_server: "org.eclipse.jetty:jetty-server:9.3.8.v20160314",
jetty_server_servlet: "org.eclipse.jetty:jetty-servlet:9.3.8.v20160314",
jetty_server_util: "org.eclipse.jetty:jetty-util:9.3.8.v20160314",
jetty_server_webapp: "org.eclipse.jetty:jetty-webapp:9.3.8.v20160314",
jetty_server_xml: "org.eclipse.jetty:jetty-xml:9.3.8.v20160314",
jetty_servlet: "javax.servlet:javax.servlet-api:3.1.0",
jetty_servlet_jsp: "org.mortbay.jasper:apache-jsp:8.0.27",
jgroups: "org.jgroups:jgroups:3.6.9.Final",
junit: "junit:junit:4.12",
log4j: "log4j:log4j:1.2.16",
maven: "org.apache.maven:maven-plugin-api:3.3.9",
narayana_jta: "org.jboss.narayana.jta:narayana-jta:5.3.1.Final",
narayana_integration: "org.jboss.narayana.jts:narayana-jts-integration:5.3.1.Final",
narayana_spi: "org.jboss:jboss-transaction-spi:7.3.1.Final",
picketbox: "org.picketbox:picketbox:4.9.3.Final",
saxon: "net.sf.saxon:saxon:8.7",
saxon_dom: "net.sf.saxon:saxon-dom:8.7",
shrinkwrap_api: "org.jboss.shrinkwrap:shrinkwrap-api:1.2.2",
shrinkwrap_impl: "org.jboss.shrinkwrap:shrinkwrap-impl-base:1.2.2",
shrinkwrap_spi: "org.jboss.shrinkwrap:shrinkwrap-spi:1.2.2",
shrinkwrap_descriptors_api: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:2.0.0-alpha-5",
shrinkwrap_descriptors_impl: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-impl-base:2.0.0-alpha-5",
shrinkwrap_descriptors_spi: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:2.0.0-alpha-5",
shrinkwrap_descriptors_ant: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-ant:2.0.0-alpha-5",
shrinkwrap_descriptors_metadata_parser: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-metadata-parser:2.0.0-alpha-5",
transaction_spec: "org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final",
validation_spec: "javax.validation:validation-api:1.1.0.Final",
asciidoctor: "org.asciidoctor:asciidoctor-gradle-plugin:1.5.2",
asciidoctorjpdf: "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11",
asciidoctorjepub3: "org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.6"
]
}
// Java version
ext.javaLanguageLevel = "1.8"
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
name 'jboss-nexus'
url "http://repository.jboss.org/nexus/content/groups/public/"
}
maven {
name "jboss-snapshots"
url "http://snapshots.jboss.org/maven2/"
}
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
}
allprojects {
apply plugin: 'distribution'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
repositories {
mavenCentral()
mavenLocal()
mavenCentral name: "jboss-nexus", artifactUrls: ["http://repository.jboss.org/nexus/content/groups/public/"]
mavenCentral name: "jboss-snapshots", artifactUrls: ["http://snapshots.jboss.org/maven2/"]
mavenCentral name: "fungal", artifactUrls: ["http://jesperpedersen.github.io/fungal/maven2/"]
}
jacoco {
toolVersion = '0.7.6.201602180812'
}
}
buildscript {
repositories {
mavenCentral()
mavenLocal()
mavenCentral name: "jboss-nexus", artifactUrls: ["http://repository.jboss.org/nexus/content/groups/public/"]
mavenCentral name: "jboss-snapshots", artifactUrls: ["http://snapshots.jboss.org/maven2/"]
}
}
subprojects { subProject ->
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
mavenLocal()
mavenCentral name: "jboss-nexus", artifactUrls: ["http://repository.jboss.org/nexus/content/groups/public/"]
mavenCentral name: "jboss-snapshots", artifactUrls: ["http://snapshots.jboss.org/maven2/"]
}
configurations {
apiVizTool {
description = "APIViz"
}
byteman {
description = "Byteman"
}
jbossLoggingTool {
description = "JBoss Logging Tool Processor"
}
}
dependencies {
compile(libraries.jboss_logging_processor)
apiVizTool(libraries.apiviz)
byteman(libraries.byteman)
jbossLoggingTool(libraries.jboss_logging_processor)
}
// Add tools.jar
ext.toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
if ( ext.toolsJar.exists() ) {
dependencies {
testCompile files( toolsJar )
}
}
targetCompatibility = rootProject.javaLanguageLevel
sourceCompatibility = rootProject.javaLanguageLevel
eclipse {
jdt {
sourceCompatibility = rootProject.javaLanguageLevel
targetCompatibility = rootProject.javaLanguageLevel
}
classpath {
downloadSources = true
downloadJavadoc = true
}
}
tasks.withType(JavaCompile) {
options.fork = true
options.encoding = "UTF-8"
}
task processInputFiles(type: Copy) {
from 'src/main/java'
into 'src/main/java'
include '**/*.java.in'
rename {
String fileName -> fileName.replace('.in', '')
}
filter {
String line -> line.replaceAll("@VERSION@", rootProject.version)
}
}
afterEvaluate {
configure(tasks.processResources) {
filter(ReplaceTokens,
tokens: [IJ_VERSION: rootProject.version])
}
}
task compile
compile.dependsOn compileJava, processResources, compileTestJava, processTestResources
sourceSets.all {
ext.originalJavaSrcDirs = java.srcDirs
ext.generatedLoggingSrcDir = file("${buildDir}/generated/logging/${name}")
java.srcDir generatedLoggingSrcDir
}
task generateLoggingClasses(type: JavaCompile) {
ext.aptDumpDir = subProject.file( "${buildDir}/tmp/apt/logging" )
classpath = compileJava.classpath + configurations.jbossLoggingTool
source = sourceSets.main.originalJavaSrcDirs
destinationDir = aptDumpDir
options.define(
compilerArgs: [
"-nowarn",
"-proc:only",
"-encoding", "UTF-8",
"-processor", "org.jboss.logging.processor.apt.LoggingToolsProcessor",
"-s", "$sourceSets.main.generatedLoggingSrcDir.absolutePath",
"-Adebug=true",
"-AskipTranslations=true",
"-source", rootProject.javaLanguageLevel,
"-target", rootProject.javaLanguageLevel,
"-AtranslationFilesPath=${project.rootDir}/src/main/resources"
]
);
outputs.dir sourceSets.main.generatedLoggingSrcDir;
doFirst {
sourceSets.main.generatedLoggingSrcDir.mkdirs()
}
doLast {
aptDumpDir.delete()
}
}
// for the time being eat the annoying output from running the annotation processors
generateLoggingClasses.logging.captureStandardError(LogLevel.INFO)
task generateSources( type: Task )
generateSources.dependsOn generateLoggingClasses
generateLoggingClasses.mustRunAfter processInputFiles
compileJava.dependsOn processInputFiles, generateLoggingClasses
compileJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8", "-Xlint:deprecation"])
compileTestJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8", "-Xlint:deprecation"])
checkstyle {
sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ]
configProperties = [samedir: rootProject.file('tools/checkstyle').absolutePath]
configFile = rootProject.file('tools/checkstyle/checkstyle.xml')
showViolations = true
ignoreFailures = false
toolVersion = '6.16.1'
}
checkstyleMain.exclude '**/*_$bundle*'
checkstyleMain.exclude '**/*_$logger*'
distZip.enabled = false
distTar.enabled = false
tasks.withType(Jar){
doFirst{
manifest {
attributes(
"Manifest-Version" : "1.0",
"Implementation-Version" : rootProject.version,
"Implementation-Vendor" : "The IronJacamar project (http://www.ironjacamar.org)",
"Implementation-Id" : "org.ironjacamar",
"Created-By" : System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')',
"Built-With": "gradle-${rootProject.getGradle().getGradleVersion()}"
)
}
}
}
test {
useJUnit()
jvmArgs "-javaagent:" + project.configurations.byteman.asPath + "=listener:true"
}
}
//Distribution
def distributionDependencies = copySpec {
from project(':testsuite').configurations.testCompile
into 'lib'
include '**/*.jar'
exclude '**/jboss-logging-processor*'
exclude '**/jdeparser*'
exclude '**/tools*'
rename (/(.+)(-[\d]+.+)\.jar/, '$1.jar')
rename (/(.+)(-[\d]+).jar/, '$1.jar')
includeEmptyDirs = false
}
def distributionSJC = copySpec {
from rootProject.file('sjc/src/dist/resources/')
into ''
include '**/*'
}
def distributionCodeGen = copySpec {
from rootProject.file('codegenerator/src/dist/resources/')
into 'doc/codegenerator'
include '**/*'
}
def distributionRarInfo = copySpec {
from rootProject.file('rarinfo/src/dist/resources/')
into 'doc/rarinfo'
include '**/*'
}
def distributionSchemas = copySpec {
from rootProject.file('common/src/main/resources/')
into 'doc'
include '**/*'
}
def distributionLib = copySpec {
from {allprojects.libsDir}
into 'lib'
}
def distributionJetty = copySpec {
from project(':web').configurations.compile
into 'lib/jetty'
include '**/*.jar'
exclude '**/fungal*'
exclude '**/jboss*'
exclude '**/jdeparser*'
includeEmptyDirs = false
}
def distributionConsole = copySpec {
from rootProject.file('web/src/console/resources/')
into 'system'
include '**/*'
}
def distributionTracer = copySpec {
from rootProject.file('tracer/src/dist/resources/')
into 'doc/tracer'
include '**/*'
}
def distributionValidator = copySpec {
from rootProject.file('validator/src/dist/resources/')
into 'doc/validator'
include '**/*'
}
def distributionDoc = copySpec {
from rootProject.file('doc/src/dist/resources/')
into 'doc'
include '**/*'
}
def distributionDevelDocHtml = copySpec {
from rootProject.file('doc/build/developer-guide/html5/')
into 'system/root.war/developer-guide/'
include '**/*'
}
def distributionUserDocHtml = copySpec {
from rootProject.file('doc/build/user-guide/html5/')
into 'system/root.war/user-guide/'
include '**/*'
}
def distributionApiJavaDoc = copySpec {
from rootProject.file('api/build/docs/javadoc')
into 'system/root.war/api'
include '**/*'
}
def distributionDocOther = copySpec {
from rootProject.file('doc/build/')
into 'doc'
exclude '**/html5/**'
}
distributions {
main {
contents {
with distributionSJC, distributionSchemas, distributionLib, distributionDependencies,
distributionJetty, distributionConsole, distributionCodeGen, distributionRarInfo, distributionTracer,
distributionValidator, distributionDoc, distributionDocOther, distributionDevelDocHtml,
distributionUserDocHtml, distributionApiJavaDoc
}
}
}
distZip.dependsOn subprojects.jar
distTar.dependsOn subprojects.jar
tasks.withType(Tar) {
compression = Compression.GZIP
extension = "tar.gz"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}