-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
245 lines (204 loc) · 7.45 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
buildscript {
repositories {
maven {
url 'https://dl.bintray.com/youngdigitalplanet/empiria'
}
}
dependencies {
classpath group: 'eu.ydp', name: 'gradle-gwt-compiler-plugin', version: '2.0.0'
}
}
/*
* Copyright 2017 Young Digital Planet S.A.
*
* 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 eu.ydp.gradle.gwt.GWTCompileTask
def empiriaWar = file("war")
def empiriaBuildDir = new File(empiriaWar, "empiria.player")
def empiriaWebkitWar = file("build/gwt")
def empiriaWebkitBuildDir = new File(empiriaWebkitWar, "empiria.player")
def versionFile = file("${projectDir}/src/main/java/eu/ydp/empiria/player/client/version/version.txt")
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
apply plugin: "groovy"
sourceCompatibility = 1.7
compileJava.options.encoding = 'UTF-8'
ext {
tstamp = new Date().format("yyyyMMddHHmmssSSS")
buildnumber = "${System.env["BUILD_NUMBER"] ?: "${tstamp}"}"
jacocoReport = "${buildDir}/jacoco/testJUnit.exec"
}
repositories {
maven {
url 'https://dl.bintray.com/youngdigitalplanet/empiria'
}
maven {
url "https://jitpack.io"
}
jcenter {
url "http://jcenter.bintray.com/"
}
mavenCentral()
maven {
url 'https://code.lds.org/nexus/content/repositories/thirdparty/'
}
}
configurations.all {
resolutionStrategy {
force group: 'eu.ydp', name: 'ydpgwtutils', version: '2.0.0'
}
}
dependencies {
compile group: 'com.google.gwt', name: 'gwt-servlet', version: '2.7.0'
compile group: 'com.google.gwt', name: 'gwt-user', version: '2.7.0'
compile group: 'com.google.gwt', name: 'gwt-dev', version: '2.7.0'
compile group: 'com.google.gwt.inject', name: 'gin', version: '2.1.2'
compile group: 'com.googlecode.gwtquery', name: 'gwtquery', version: '1.4.2'
compile group: 'com.googlecode.gwtquery.bundles', name: 'gquery-dnd-bundle', version: '1.0.6'
compile group: 'com.google.guava', name: 'guava-gwt', version: '18.0'
compile 'eu.ydp:mathplayer:2.0.0'
compile 'eu.ydp:jsfilerequest:2.0.0'
compile 'eu.ydp:gwtFlashMedia:2.0.0'
compile 'eu.ydp:gwtcreatejs:2.0.0'
compile group: 'eu.ydp', name: 'jaxb4gwt', version: '2.0.0'
compile group: 'eu.ydp', name: 'matheclipse-parser-gwt', version: '2.0.0'
compile group: 'de.knightsoft-net', name: 'gwt-lzma', version: '1.2'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
testCompile group: 'com.google.gwt.gwtmockito', name: 'gwtmockito', version: '1.1.5'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile group: 'pl.pragmatists', name: 'JUnitParams', version: '1.0.4'
testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
testCompile group: 'xmlunit', name: 'xmlunit', version: '1.3'
testCompile group: 'org.reflections', name: 'reflections', version: '0.9.9-RC1'
testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.3'
testCompile group: 'org.objenesis', name: 'objenesis', version: '2.1'
testCompile group: 'com.github.cglib.cglib', name: 'cglib-nodep', version: '5503bcca74'
}
eclipse {
project {
natures 'com.google.gwt.eclipse.core.gwtNature', 'org.springsource.ide.eclipse.gradle.core.nature', 'org.eclipse.jdt.groovy.core.groovyNature'
buildCommand 'com.google.gdt.eclipse.core.webAppProjectValidator'
buildCommand 'com.google.gwt.eclipse.core.gwtProjectValidator'
}
classpath {
containers 'com.google.gwt.eclipse.core.GWT_CONTAINER'
defaultOutputDir file('/war/WEB-INF/classes')
}
}
sourceSets {
test.java.srcDirs += 'src/test/gwt'
test.runtimeClasspath += files(main.java.srcDirs)
test.runtimeClasspath += files(test.java.srcDirs)
test.runtimeClasspath += files(test.groovy.srcDirs)
}
task testJUnit(type: Test) {
jacoco {
enabled = true
}
useJUnit()
include "**/*Spec.class"
include "**/*Test.class"
maxHeapSize = '512M'
jvmArgs(['-XX:MaxPermSize=256M', '-Xss1M'])
reports.html.destination = file("$buildDir/reports/junit")
}
task testGWTUnit(type: Test) {
jacoco {
enabled = false
}
useJUnit()
include "**/GWTTestCaseSuite.*"
include "**/MainFlowProcessorGWTTestCase.*"
include "**/PageSwitchAnimationGWTTestCase.*"
forkEvery = 1
maxHeapSize = '512M'
jvmArgs(['-XX:MaxPermSize=256M', '-Xss1M'])
reports.html.destination = file("$buildDir/reports/gwt")
}
testGWTUnit.shouldRunAfter testJUnit
task test(overwrite: true, dependsOn: [testJUnit, testGWTUnit]) {
ext {
jacoco = [destinationFile: file(jacocoReport)]
}
}
jacoco {
toolVersion = '0.7.1.201405082137'
}
jacocoTestReport {
executionData = files(jacocoReport)
reports {
xml.enabled true
csv.enabled false
}
}
testJUnit.finalizedBy jacocoTestReport
task cleanCache(dependsOn: clean) {
delete "gwt-unitCache/"
}
task compileMain(dependsOn: [classes], type: GWTCompileTask) {
module = 'eu.ydp.empiria.player.Player'
buildDir = empiriaWar
gwtArgs['-XjsInteropMode'] = 'JS'
}
task compileDev(dependsOn: [classes], type: GWTCompileTask) {
module = 'eu.ydp.empiria.player.Player_dev'
buildDir = empiriaWar
gwtArgs['-XjsInteropMode'] = 'JS'
}
task compileDevPretty(dependsOn: [classes], type: GWTCompileTask) {
module = 'eu.ydp.empiria.player.Player_dev'
buildDir = empiriaWar
gwtArgs['-XjsInteropMode'] = 'JS'
gwtArgs['-style'] = 'PRETTY'
}
task compileWebkit(dependsOn: [classes], type: GWTCompileTask) {
module = 'eu.ydp.empiria.player.Player_webkit'
buildDir = empiriaWebkitWar
gwtArgs['-XjsInteropMode'] = 'JS'
}
def configCopyMetaInfoAndZip(playerDir, targetZip) {
return {
def metadataProperties = [version: version, tstamp: tstamp, buildnumber: buildnumber]
archiveName targetZip
destinationDir file("dist")
from playerDir
from(file("metadata.template.xml")) {
rename "metadata.template.xml", "metadata.xml"
expand metadataProperties
}
}
}
task createVersion() {
versionFile.createNewFile()
versionFile.write "${version}"
}
task zipMain(dependsOn: [compileMain], type: Zip) {
configure configCopyMetaInfoAndZip(empiriaBuildDir, "empiriaplayer.zip")
}
task zipWebkit(dependsOn: [compileWebkit], type: Zip) {
configure configCopyMetaInfoAndZip(empiriaWebkitBuildDir, "empiriaplayer_webkit.zip")
}
task compileAll(dependsOn: [compileMain, compileWebkit])
task distMain(dependsOn: [cleanCache, createVersion, test, zipMain])
task distWebkit(dependsOn: [cleanCache, createVersion, test, zipWebkit])
task dist(dependsOn: [distMain, distWebkit])
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
tasks.withType(JavaCompile) {
options.compilerArgs = ["-implicit:none"]
options.compilerArgs += ["-sourcepath", ""]
}