forked from groovy/groovy-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
294 lines (266 loc) · 9.91 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
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'code-quality'
// TODO use antlr plugin
//apply plugin: 'antlr'
allprojects { p ->
group = 'org.codehaus.groovy'
version = groovyVersion
tasks.withType(Checkstyle).all { t -> t.ignoreFailures = true }
tasks.withType(CodeNarc).all { t -> t.ignoreFailures = true }
}
sourceCompatibility = 1.5
targetCompatibility = 1.5
buildDir = 'target'
//evaluationDependsOn(':subprojects:groovy-bsf')
//childrenDependOnMe()
repositories {
// todo Some repos are needed only for some configs. Declare them just for the configuration once Gradle allows this.
mavenCentral() // default, tools
mavenRepo url: "http://www.aQute.biz/repo" // tools
mavenRepo url: "http://repository.jboss.org/maven2" // examples, tools
}
// todo do we need compile and runtime scope for examples?
configurations {
tools
examplesCompile.extendsFrom compile
examplesRuntime.extendsFrom examplesCompile
antlr
}
dependencies {
// TODO use antlr plugin
// antlr "antlr:antlr:2.7.7"
groovy files("$buildDir/classes")
groovy "asm:asm:3.3.1"
groovy "antlr:antlr:2.7.7"
groovy "asm:asm-commons:3.3.1"
groovy "asm:asm-util:3.3.1"
groovy "asm:asm-analysis:3.3.1"
groovy "asm:asm-tree:3.3.1"
compile "commons-cli:commons-cli:1.2"
compile "org.apache.ant:ant:1.8.2"
compile "javax.servlet:servlet-api:2.4"
compile "javax.servlet:jsp-api:2.0"
compile("com.thoughtworks.xstream:xstream:1.4.2") {
exclude(group: 'xpp3', module: 'xpp3_min')
exclude(group: 'junit', module: 'junit')
exclude(group: 'jmock', module: 'jmock')
}
compile("jline:jline:1.0") {
exclude(group: 'junit', module: 'junit')
}
compile "org.fusesource.jansi:jansi:1.6"
compile("org.apache.ivy:ivy:2.2.0") {
transitive = false
}
runtime("org.apache.ant:ant-junit:1.8.2") {
exclude(group: 'junit', module: 'junit')
}
runtime "org.apache.ant:ant-launcher:1.8.2"
runtime "org.apache.ant:ant-antlr:1.8.2"
runtime("commons-logging:commons-logging:1.1.1") {
exclude(group: 'log4j', module: 'log4j')
exclude(group: 'logkit', module: 'logkit')
exclude(group: 'avalon-framework', module: 'avalon-framework')
}
testCompile "jmock:jmock:1.2.0"
testCompile "jmock:jmock-cglib:1.2.0"
testCompile "xmlunit:xmlunit:1.3"
testCompile "hsqldb:hsqldb:1.8.0.10"
// testCompile group:"org.hsqldb", name:"hsqldb", version:"2.2.8", classifier:"jdk5"
// testCompile "com.h2database:h2:1.3.164"
testCompile "ch.qos.logback:logback-classic:0.9.21"
testCompile "log4j:log4j:1.2.16"
testCompile "org.slf4j:jcl-over-slf4j:1.6.0"
testCompile "com.thoughtworks.qdox:qdox:1.12"
testCompile "org.apache.ant:ant-testutil:1.8.2"
runtime "org.codehaus.gpars:gpars:0.12"
tools "com.googlecode.jarjar:jarjar:1.1"
tools("checkstyle:checkstyle:4.4") {
exclude(module: 'junit')
}
tools "redhill:simian:2.2.4"
tools("net.sourceforge.cobertura:cobertura:1.9.4.1") {
exclude(module: 'asm')
exclude(module: 'asm')
exclude(module: 'ant')
}
tools "asm:asm:3.3.1"
tools "com.thoughtworks.qdox:qdox:1.12"
tools "biz.aQute:bnd:0.0.401"
examplesCompile "lucene:lucene:1.4.3"
examplesCompile "org.eclipse:osgi:3.5.0.v20090520"
examplesRuntime("commons-httpclient:commons-httpclient:3.1") {
exclude(module: 'junit')
exclude(module: 'commons-logging')
exclude(module: 'commons-codec')
}
examplesRuntime("openejb:openejb-loader:1.0") {
exclude(module: 'log4j')
exclude(module: 'openejb-core')
exclude(module: 'geronimo-jta_1.0.1B_spec')
exclude(module: 'geronimo-servlet_2.4_spec')
exclude(module: 'geronimo-ejb_2.1_spec')
exclude(module: 'geronimo-j2ee-connector_1.5_spec')
}
antlr "org.apache.ant:ant-antlr:1.8.2"
testCompile project(':subprojects:groovy-test')
testCompile project(':subprojects:groovy-jsr223')
testCompile project(':subprojects:groovy-bsf')
testCompile project(':subprojects:groovy-jmx')
}
sourceSets {
main {
java {
srcDirs = [
"$projectDir/src/main",
// "$projectDir/subprojects/groovy-jmx/src/main/java",
// "$projectDir/subprojects/groovy-bsf/src/main/java",
]
fileTree("$projectDir/src/main/groovy/ui").matching {
exclude 'GroovyMain.java', 'GroovySocketServer.java'
}.visit {details ->
exclude "groovy/ui/$details.path"
}
}
groovy {
srcDirs = [
"$projectDir/src/main",
"$projectDir/subprojects/groovy-jmx/src/main/groovy",
]
}
resources {
srcDirs = ["$projectDir/src/main", "$projectDir/src/tools"]
include "META-INF/services/*", "META-INF/groovy-release-info.properties",
"groovy/grape/*.xml", "groovy/ui/*.properties", "groovy/ui/**/*.png",
"groovy/inspect/swingui/AstBrowserProperties.groovy",
"org/codehaus/groovy/tools/shell/**/*.properties",
"org/codehaus/groovy/tools/shell/**/*.xml",
"org/codehaus/groovy/antlib.xml",
"org/codehaus/groovy/tools/groovydoc/gstringTemplates/**/*.*",
"org/codehaus/groovy/tools/groovy.ico"
}
output.classesDir = "$buildDir/classes" as File
}
test {
groovy {
srcDirs = [
"$projectDir/src/test",
// "$projectDir/subprojects/groovy-bsf/src/test/groovy",
// "$projectDir/subprojects/groovy-jmx/src/test/groovy",
// "$projectDir/subprojects/groovy-bsf/src/test/java",
// "$projectDir/subprojects/groovy-jmx/src/test/java"
]
if (!isJava16()) {
exclude "groovy/**/vm6/*Test.groovy"
exclude "org/codehaus/groovy/**/vm6/*Test.groovy"
}
}
resources {
srcDirs = ["$projectDir/src/test-resources"]
}
output.classesDir = "$buildDir/test-classes" as File
}
tools {
groovy {
srcDirs = ["$projectDir/src/tools"]
}
resources {
srcDirs = ["$projectDir/src/tools"]
}
compileClasspath = configurations.tools + sourceSets.main.runtimeClasspath
runtimeClasspath = output + compileClasspath
output.classesDir = "$buildDir/tools-classes" as File
}
examples {
groovy {
srcDirs = ["$projectDir/src/examples"]
}
resources {
srcDirs = ["$projectDir/src/examples"]
}
compileClasspath = configurations.examplesRuntime + sourceSets.main.output
output.classesDir = "$buildDir/examples-classes" as File
}
}
// remove this from config once GRADLE-854 is fixed.
processResources.doLast {
copy {
from("$projectDir/src/main") {
include "groovy/inspect/swingui/AstBrowserProperties.groovy",
"org/codehaus/groovy/tools/groovydoc/gstringTemplates/GroovyDocTemplateInfo.java"
}
into sourceSets.main.output.classesDir
}
}
task ensureGrammars {
description = "Ensure all the Antlr generated files are up to date."
antlrDirectory = "$projectDir/src/main/org/codehaus/groovy/antlr"
groovyParserDirectory = "$antlrDirectory/parser"
javaParserDirectory = "$antlrDirectory/java"
doFirst {
ant {
taskdef(name: 'antlr',
classname: 'org.apache.tools.ant.taskdefs.optional.ANTLR',
classpath: configurations.antlr.asPath)
mkdir dir: groovyParserDirectory
antlr(target: "$antlrDirectory/groovy.g", outputdirectory: groovyParserDirectory) {
classpath path: configurations.compile.asPath
}
antlr(target: "$javaParserDirectory/java.g", outputdirectory: javaParserDirectory) {
classpath path: configurations.compile.asPath
}
}
}
}
compileJava {
dependsOn ensureGrammars
doLast {
mkdir "$sourceSets.main.output.classesDir/META-INF"
ant {
java(classname: "org.codehaus.groovy.tools.DgmConverter",
fork: "true",
failonerror: "true",
outputproperty: 'outy',
errorproperty: 'errr',
classpath: sourceSets.main.runtimeClasspath.asPath)
}
// println "Out: " + ant.properties.outy
// println "Err: " + ant.properties.errr
}
}
compileGroovy {
groovyOptions.fork(memoryMaximumSize: groovycMain_mx)
}
compileTestGroovy {
groovyOptions.fork(memoryMaximumSize: groovycTest_mx)
}
compileExamplesGroovy {
groovyOptions.fork(memoryMaximumSize: groovycExamples_mx)
}
def isJava16() {
System.properties['java.version'].contains('1.6')
}
// suppress CheckStyle
task checkstyleExamples(overwrite: true) << {};
task checkstyleMain(overwrite: true) << {};
task checkstyleTest(overwrite: true) << {};
task checkstyleTools(overwrite: true) << {};
codeNarcConfigFileName = "./config/codenarc/codenarc.groovy"
// ignore CodeNarc on examples
task codenarcExamples(overwrite: true) << {};
// don't fail build on CodeNarc tasks
tasks.withType(CodeNarc).all { codeNarcTask ->
codeNarcTask.ignoreFailures = true
}
// provide to other build scripts
isJava6 = this.&isJava16()
apply from: "$projectDir/gradle/test.gradle"
apply from: "$projectDir/gradle/docs.gradle"
apply from: "$projectDir/gradle/assemble.gradle"
apply from: "$projectDir/gradle/upload.gradle"
task wrapper(type: Wrapper) {
// gradleVersion = '1.0-milestone-5-20110929000016+0200'
// distributionUrl = "http://repo.gradle.org/gradle/distributions-snapshots/gradle-${gradleVersion}-bin.zip"
gradleVersion = '1.0-milestone-8'
}