-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
209 lines (179 loc) · 6.33 KB
/
build.gradle
File metadata and controls
209 lines (179 loc) · 6.33 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
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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: 'jetty'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.7.201606060606" //checked at http://www.eclemma.org/jacoco/
}
//Adding Google java format and sonar pluggins for jdk >= 8
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
//classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.3.2"
if(JavaVersion.current()>= JavaVersion.VERSION_1_8){
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1"
}
classpath "com.netflix.nebula:nebula-ospackage-plugin:3.+"
}
}
//apply plugin: "com.github.sherter.google-java-format"
if(JavaVersion.current()>= JavaVersion.VERSION_1_8){
apply plugin: "org.sonarqube"
}
mainClassName = "controller.Application"
//mainClassName = "crypt.CryptCommander"
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
maven {
url 'http://www.janus-project.org/maven'
url uri('libs')
}
}
jar {
manifest {
attributes 'Implementation-Title': 'SXP network',
'Implementation-Version': 1.0
}
}
sourceSets.main.resources.srcDirs += ["src/main/resources"]
//Adding selenium configurations
configurations {
seleniumCompile.extendsFrom testCompile
seleniumRuntime.extendsFrom testRuntime
}
//Define selenium sources and resources
sourceSets {
selenium {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/selenium/java')
}
resources.srcDir file('src/selenium/resources')
}
}
//selenium task
task selenium(type: Test) {
description = "Batch of GUI tests that use selenium"
testClassesDir = sourceSets.selenium.output.classesDir
classpath = sourceSets.selenium.runtimeClasspath
outputs.upToDateWhen { false }
// jvmArgs ""
}
test{
//exclude 'model/syncManager/**'
//exclude 'controller/**'
//exclude 'crypt/**'
//exclude 'model/entity/**'
//exclude 'model/validator/**'
//exclude 'network/**'
//exclude 'protocol/**'
//exclude 'rest/**'
//exclude 'util/**'
testLogging {
showStandardStreams = false
showExceptions = false
showStackTraces = false
}
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006'
}
}
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events "passed", "skipped", "failed", "standardOut"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
dependencies {
compile 'org.hibernate:hibernate-validator:5.2.4.Final'
compile 'org.apache.logging.log4j:log4j-api:2.1'
compile 'org.apache.logging.log4j:log4j-core:2.1'
compile 'org.apache.logging.log4j:log4j-1.2-api:2.1'
compile 'org.apache.logging.log4j:log4j-web:2.5'
compile 'org.eclipse.jetty:jetty-server:9.2+'
compile 'org.eclipse.jetty:jetty-servlet:9.2+'
compile 'org.eclipse.jetty:jetty-webapp:9.3+'
compile 'org.eclipse.jetty:jetty-util:9.2+'
//compile 'org.eclipse.jetty:apache-jsp:9.2+'
//compile 'org.eclipse.jetty:apache-jstl:9.2+'
compile 'org.apache.commons:commons-collections4:4.0'
compile 'org.glassfish.jersey.core:jersey-server:2.7'
compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.7'
compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.7'
compile 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.7'
compile 'org.glassfish.jersey.media:jersey-media-moxy:2.7'
compile 'javax:javaee-api:7.0'
compile 'org.apache.derby:derby:10.12.1.1'
compile 'org.eclipse.persistence:eclipselink:2.6.3-M1'
compile 'org.eclipse.persistence:javax.persistence:2.1.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
compile fileTree(dir: './libs', include: '*.jar')
compile ('com.kenai.jxse:jxse:2.7')
{
// org.jboss.netty has moved to io.netty
exclude group: 'org.jboss.netty', module: 'httptunnel'
}
compile 'org.jdom:jdom2:2.0.6'
compile 'com.google.guava:guava:19.0'
compile 'org.shredzone.acme4j:acme4j-utils:0.8'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
compile 'org.hibernate:hibernate-validator:5.3.3.Final'
compile 'javax.el:javax.el-api:2.2.4'
compile 'org.glassfish.web:javax.el:2.2.4'
testCompile 'org.apache.commons:commons-lang3:3.1'
testCompile fileTree(dir: './libs', include: 'loremipsum-1.0.jar')
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'
testCompile group: 'org.json', name: 'json', version: '20160810'
seleniumCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.0.1'
}
configurations.all {
exclude group: "log4j", module: "log4j"
}
[compileJava, compileTestJava]*.options.collect {options ->
options.encoding = 'UTF-8'}
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
//Copy dependencies in the libs directory
task libs(type: Sync) {
from configurations.compile
//from configurations.runtime
from configurations.testCompile
from configurations.seleniumCompile
into "$buildDir/libs"
}
build.finalizedBy(libs)
//Define jacoco report tasks
test.finalizedBy(jacocoTestReport)