-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
core.gradle
115 lines (96 loc) · 3.95 KB
/
core.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
/*
* Copyright 2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.text.DateFormat
usePlugin 'groovy'
configurations {
testFixtures
testFixturesRuntime {
extendsFrom testFixtures, testRuntime
}
integTestCompile {
extendsFrom testCompile
}
integTestRuntime {
extendsFrom intTestCompile, testRuntime
}
integTestFixtures {
extendsFrom testFixtures
}
integTestFixturesRuntime {
extendsFrom integTestFixtures, integTestRuntime
}
}
sourceSets {
integTest {
compileClasspath = sourceSets.test.classes + sourceSets.main.classes + configurations.integTestCompile
runtimeClasspath = classes + compileClasspath + configurations.integTestRuntime
}
}
dependencies {
groovy libraries.groovy_depends
compile "commons-httpclient:commons-httpclient:3.0@jar", "commons-codec:commons-codec:1.2@jar", libraries.jcl_to_slf4j
compile libraries.ivy, "jsch:jsch:0.1.31@jar"
compile libraries.jopt_simple,
libraries.ant,
"org.apache.ant:ant-nodeps:1.7.0@jar",
libraries.logback_classic,
libraries.logback_core,
libraries.slf4j_api,
libraries.jul_to_slf4j,
libraries.commons_io,
libraries.commons_lang,
"commons-codec:commons-codec:1.2@jar",
"commons-collections:commons-collections:3.2.1@jar",
"slide:webdavlib:2.0@jar",
"org.apache.maven:maven-ant-tasks:2.1.0@jar",
libraries.asm_all
runtime libraries.log4j_to_slf4j, libraries.jcl_to_slf4j
testCompile "xmlunit:xmlunit:1.2"
runtime libraries.ant_launcher,
"org.apache.ant:ant-trax:1.7.0@jar"
integTestCompile libraries.jetty_depends
testFixtures sourceSets.test.classes, sourceSets.main.classes
integTestFixtures sourceSets.integTest.classes
}
processResources.doLast {
writeVersionProperties(new File(sourceSets.main.classesDir, GradleVersion.FILE_NAME))
}
ide.doLast {
writeVersionProperties(new File(ideDir, "resources/test/$GradleVersion.FILE_NAME"))
}
def writeVersionProperties(File destination) {
logger.info('Write version properties to: {}', destination.absoluteFile)
Properties versionProperties = new Properties()
versionProperties.putAll([
(GradleVersion.VERSION): version.toString(),
(GradleVersion.BUILD_TIME): DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(version.buildTime)
])
destination.parentFile.mkdirs()
destination.withOutputStream {
versionProperties.store(it, '')
}
}
[compileGroovy, compileTestGroovy]*.groovyOptions*.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G')
test {
xmsSize = '128m'
xmxSize = '512m'
maxPermSize = '128m'
// there must be a nicer way of doing this...
try { xmsSize = customXmsSize; logger.debug('Using custom Xms size: ' + xmsSize + ' for :core:test') } catch (MissingPropertyException e) { }
try { xmxSize = customXmxSize; logger.debug('Using custom Xmx size: ' + xmxSize + ' for :core:test') } catch (MissingPropertyException e) { }
try { maxPermSize = customMaxPermSize; logger.debug('Using custom MaxPermSize: ' + maxPermSize + ' for :core:test') } catch (MissingPropertyException e) { }
options.fork(jvmArgs: ["-ea", "-Xms${xmsSize}", "-Xmx${xmxSize}", "-XX:MaxPermSize=${maxPermSize}", '-XX:+HeapDumpOnOutOfMemoryError'])
}