-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
124 lines (105 loc) · 3.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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.2.3'
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'war'
apply plugin: 'tomcat'
apply plugin: 'idea'
repositories {
mavenCentral()
}
configurations {
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
}
def sets = [ "java", "groovy", "resources" ]
def sourceFolder = { set ->
"src/integration-test/$set"
}
sourceSets {
integrationTest { sourceSet ->
sets.each {
if (sourceSet.hasProperty(it)) {
sourceSet."$it".srcDir file(sourceFolder(it))
}
}
}
}
dependencies {
providedCompile('javax.servlet:javax.servlet-api:3.1.0')
compile('org.jboss.resteasy:resteasy-jaxrs:3.0.8.Final')
compile('org.jboss.resteasy:resteasy-cdi:3.0.8.Final')
compile('org.jboss.resteasy:resteasy-jackson2-provider:3.0.8.Final')
compile('org.jboss.resteasy:resteasy-servlet-initializer:3.0.8.Final')
compile('org.jboss.resteasy:async-http-servlet-3.0:3.0.8.Final')
compile('com.google.guava:guava:17.0')
compile('org.jboss.weld.servlet:weld-servlet:2.2.1.Final')
compile('log4j:log4j:1.2.14')
compile('org.projectlombok:lombok:1.14.2')
compile('com.googlecode.siren4j:siren4j:1.0.14')
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.4.0')
compile('org.apache.commons:commons-lang3:3.3.2')
compile('javax.validation:validation-api:1.1.0.Final')
compile('org.hibernate:hibernate-validator:5.1.1.Final')
compile('org.hibernate:hibernate-validator-cdi:5.1.1.Final')
compile('com.theoryinpractise:halbuilder-standard:4.0.1')
compile('org.springframework.hateoas:spring-hateoas:0.16.0.RELEASE')
def tomcatVersion = '7.0.54'
tomcat("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
tomcat("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
}
integrationTestCompile sourceSets.main.output
integrationTestCompile 'org.codehaus.groovy:groovy-all:2.3.3'
integrationTestCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude group: 'org.codehaus.groovy'
}
integrationTestCompile('org.jboss.resteasy:resteasy-client:3.0.8.Final')
integrationTestCompile('org.skyscreamer:jsonassert:1.2.3')
}
ext {
tomcatStopPort = 8081
tomcatStopKey = 'stopKey'
}
task integrationTomcatRunWar(type: org.gradle.api.plugins.tomcat.tasks.TomcatRunWar) {
stopPort = tomcatStopPort
stopKey = tomcatStopKey
daemon = true
}
task integrationTomcatStop(type: org.gradle.api.plugins.tomcat.tasks.TomcatStop) {
stopPort = tomcatStopPort
stopKey = tomcatStopKey
}
def contextPath = '/'
tomcatRunWar.contextPath = contextPath
integrationTomcatRunWar.contextPath = contextPath
task integrationTest(type: Test) {
description = "Runs integration tests"
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
dependsOn integrationTomcatRunWar
finalizedBy integrationTomcatStop
}
task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}
group = 'org.takearest'
version = '1.0'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
idea {
module {
scopes.TEST.plus += configurations.integrationTestCompile
}
}