-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (79 loc) · 2.42 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
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: "jacoco"
mainClassName = "is.deltazedacreed.tictactoe.TicTacToeWeb"
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
jacoco {
toolVersion = "0.7.1.201405082137"
reportsDir = file("$buildDir/JacocoReport")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/JacocoReport/jacocoHtml"
}
}
jar {
manifest {
attributes("Main-Class": "is.deltazedacreed.tictactoe.Game")
}
}
sourceSets {
selenium
seleniumXvfb
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.5'
testCompile 'junit:junit:4.11'
compile 'com.sparkjava:spark-core:1.1.1'
seleniumCompile 'junit:junit:4.11'
seleniumCompile 'org.seleniumhq.selenium:selenium-java:2.39.0'
seleniumXvfbCompile 'junit:junit:4.11'
seleniumXvfbCompile 'org.seleniumhq.selenium:selenium-java:2.39.0'
}
task selenium(type: Test, dependsOn: installApp) {
testClassesDir = sourceSets.selenium.output.classesDir
classpath = sourceSets.selenium.runtimeClasspath
ant.condition(property: "os", value: "windows") { os(family: "windows") }
ant.condition(property: "os", value: "unix" ) { os(family: "unix") }
doFirst {
switch(ant.properties.os) {
case 'unix':
'build/install/TicTacToe/bin/TicTacToe &'.execute()
break
case 'windows':
'build\\install\\TicTacToe\\bin\\TicTacToe.bat'.execute()
break
}
}
}
task seleniumXvfb(type: Test, dependsOn: installApp) {
testClassesDir = sourceSets.selenium.output.classesDir
classpath = sourceSets.selenium.runtimeClasspath
environment "DISPLAY", ":99"
doFirst {
'bin/xvfb start'.execute()
'build/install/TicTacToe/bin/TicTacToe &'.execute()
}
doLast {
'bin/xvfb stop'.execute()
}
}
task stage {
dependsOn installApp
}