-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
190 lines (144 loc) · 4.83 KB
/
build.gradle
File metadata and controls
190 lines (144 loc) · 4.83 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
buildscript {
repositories {
maven { url 'http://jcenter.bintray.com' }
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.4'
classpath 'org.hidetake:gradle-ssh-plugin:0.3.0'
}
}
task wrapper(type: Wrapper) {
gradleVersion = "2.0"
}
apply plugin: 'cargo'
apply plugin: 'ssh'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'jacoco'
//apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: "sonar-runner"
repositories {
mavenCentral()
}
//find out howto make groovy directories in the systemTest
sourceSets {
systemTest
performanceTest
integrationTest
resources
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
compile "jfree:jfreechart:1.0.12"
compile "joda-time:joda-time:2.2"
compile(group: 'log4j', name: 'log4j', version: '1.2.17')
compile(group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.6.6') // van nexus apd
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5')
//providedCompile 'org.jfree:jfreechart:1.0.13'
//providedCompile 'org.jfree:data:1.0.13'
runtime 'javax.servlet:jstl:1.1.2'
compile localGroovy()
testCompile localGroovy()
testCompile "org.testng:testng:6.3.1"
testCompile "junit:junit:4.9"
testCompile "org.mockito:mockito-all:1.9.5"
runtime 'postgresql:postgresql:9.0-801.jdbc4'
runtime "org.slf4j:log4j-over-slf4j:1.7.5"
runtime "org.slf4j:jcl-over-slf4j:1.7.5"
runtime "org.slf4j:jul-to-slf4j:1.7.5"
//compile 'postgresql:postgresql:9.0-801.jdbc4'
integrationTestCompile 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2'
integrationTestCompile configurations.testCompile
integrationTestRuntime configurations.testRuntime
systemTestCompile configurations.testCompile
systemTestRuntime configurations.testRuntime
performanceTestCompile configurations.testCompile
performanceTestRuntime configurations.testRuntime
}
jacocoTestReport {
reports {
html.enabled false
}
}
/*checkstyleMain << {
ant.xslt(in: reports.xml.destination,
style: new File('config/checkstyle-noframes-sorted.xsl'),
out: new File(reports.xml.destination.parent, 'main.html'))
}
*/
ext {
tomcatLog = file("build/tomcatOutput.log")
cargoLocalTomcat = "localTomcatPath NOT SET!"
}
task prepareTomcatLog() {
if (!tomcatLog.exists()) {
if (!buildDir.exists()) {
buildDir.mkdir()
}
tomcatLog.createNewFile()
}
}
cargoRunLocal.dependsOn('prepareTomcatLog','war')
if (!hasProperty('localTomcatPath')) {
//cargoLocalTomcat = "localTomcatPath NOT SET!"
} else {
cargoLocalTomcat = localTomcatPath
}
logger.quiet "cargoLocalTomcat = ${cargoLocalTomcat}"
cargo {
containerId = 'tomcat7x'
port = 9080
deployable {
file = file("build/libs/smartMeter.war")
context = '/smartMeter'
}
remote {
hostname = "odin.nl.cx"
username = 'bpmone'
password = 'janka12345'
}
local {
homeDir = file("${cargoLocalTomcat}")
output = tomcatLog
timeout = 60000
containerProperties {
property 'cargo.tomcat.ajp.port', 8010
}
}
}
task systemTest(type: Test) {
testClassesDir = sourceSets.systemTest.output.classesDir
classpath = sourceSets.systemTest.runtimeClasspath
reports.junitXml.destination = file("${reporting.baseDir}/systemTest")
reports.html.destination = file("${reporting.baseDir}/systemTest")
}
task performanceTest(type: Test) {
testClassesDir = sourceSets.performanceTest.output.classesDir
classpath = sourceSets.performanceTest.runtimeClasspath
reports.junitXml.destination = file("${reporting.baseDir}/performanceTest")
reports.html.destination = file("${reporting.baseDir}/performanceTest")
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
reports.junitXml.destination = file("${reporting.baseDir}/integrationTest")
reports.html.destination = file("${reporting.baseDir}/integrationTest")
}
task liveTestGroup(dependsOn: ['systemTest', 'performanceTest', 'integrationTest'])
//to start/stop tomcat for test runs
liveTestGroup.dependsOn war, cargoStartLocal
liveTestGroup.finalizedBy cargoStopLocal
sonarRunner {
sonarProperties {
property "sonar.host.url", "http://192.168.8.1:9000"
property "sonar.jdbc.url", "jdbc:h2:tcp://192.168.8.1:9092/sonar"
//property "sonar.jdbc.driverClassName", "org.postgresql.Driver"
property "sonar.jdbc.username", "sonar"
property "sonar.jdbc.password", "sonar"
property "sonar.jacoco.reportPath", "$buildDir/jacoco/test.exec"
}
}