forked from testinfected/simple-petstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
139 lines (121 loc) · 4.44 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
allprojects {
apply plugin: 'java'
group = 'org.testinfected.petstore'
version = '0.2-SNAPSHOT'
repositories {
mavenCentral()
}
}
ext {
libs = [
mysql : 'mysql:mysql-connector-java:5.1.21',
flyway : 'com.googlecode.flyway:flyway-core:2.0',
cli : 'com.vtence.cli:cli:1.1',
molecule : 'com.vtence.molecule:molecule:0.10',
molecule_test : 'com.vtence.molecule:molecule:0.10:tests',
tape : 'com.vtence.tape:tape:0.2',
jmustache : 'com.samskivert:jmustache:1.11',
simple : ['org.simpleframework:simple-common:6.0.1',
'org.simpleframework:simple-transport:6.0.1',
'org.simpleframework:simple-http:6.0.1'],
hamcrest : 'org.hamcrest:java-hamcrest:2.0.0.0',
hamcrest_dom : 'com.vtence.hamcrest:hamcrest-dom:2.0.0',
junit : 'junit:junit:4.12@jar',
jmock : ['org.jmock:jmock:2.6.0@jar',
'org.jmock:jmock-junit4:2.6.0@jar',
'org.jmock:jmock-legacy:2.6.0@jar',
'cglib:cglib-nodep:2.1_3',
'org.objenesis:objenesis:1.0'],
juniversal_chardet: 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3',
nekohtml : 'net.sourceforge.nekohtml:nekohtml:1.9.20',
selenium_api : 'org.seleniumhq.selenium:selenium-api:2.53.0',
selenium_firefox : 'org.seleniumhq.selenium:selenium-firefox-driver:2.53.0',
mario : 'com.vtence.mario:mario:0.1',
selenium_phantom : 'com.codeborne:phantomjsdriver:1.3.0',
nolog : ['org.slf4j:slf4j-api:1.5.6',
'org.slf4j:jcl-over-slf4j:1.5.6',
'org.slf4j:slf4j-nop:1.5.6']
]
}
subprojects {
apply plugin: 'jacoco'
dependencies {
testCompile libs.junit
testCompile libs.hamcrest
testCompile libs.jmock
testCompile libs.nolog
}
}
configurations {
jacoco
}
dependencies {
jacoco 'org.jacoco:org.jacoco.ant:0.7.0.201403182114'
}
task coverage(type: JacocoReport) {
jacocoClasspath = configurations.jacoco
// Add execution data from all subprojects
executionData fileTree(project.rootDir.absolutePath).include("*/build/jacoco/*.exec")
// Add source classes from all subprojects
subprojects.each {
sourceSets it.sourceSets.main
}
// Make the aggregate report go in a top-level directory somewhere
reports {
xml {
enabled true
destination "build/reports/jacoco/test/jacocoTestReport.xml"
}
html {
enabled true
destination "build/reports/jacoco/test/html"
}
}
}
apply plugin: 'application'
mainClassName = 'org.testinfected.petstore.Launcher'
if (!project.hasProperty('env')) {
ext.env = 'development'
}
run {
classpath = project(':server').sourceSets.main.runtimeClasspath
args '-e', env
if (project.hasProperty('host')) {
args '-h', host
}
if (project.hasProperty('port')) {
args '-p', port
}
if (project.hasProperty('timeout')) {
args '--timeout', timeout
}
if (project.hasProperty('quiet')) {
args '-q'
}
args project(':webapp').file('src/main/content')
}
task 'db-init'(type: JavaExec) {
main = 'org.testinfected.petstore.Migrations'
classpath = project(':server').sourceSets.main.runtimeClasspath
args = ['-e', env, 'init']
}
task 'db-clean'(type: JavaExec) {
main = 'org.testinfected.petstore.Migrations'
classpath = project(':server').sourceSets.main.runtimeClasspath
args = ['-e', env, 'clean']
}
task 'db-migrate'(type: JavaExec) {
main = 'org.testinfected.petstore.Migrations'
classpath = project(':server').sourceSets.main.runtimeClasspath
args = ['-e', env, 'migrate']
}
task 'db-drop'(type: JavaExec) {
main = 'org.testinfected.petstore.Migrations'
classpath = project(':server').sourceSets.main.runtimeClasspath
args = ['-e', env, 'drop']
}
task 'db-reset'(type: JavaExec) {
main = 'org.testinfected.petstore.Migrations'
classpath = project(':server').sourceSets.main.runtimeClasspath
args = ['-e', env, 'reset']
}