-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
158 lines (149 loc) · 6.85 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
description = "Code Examples"
ext.testFailures = 0
ext.integTestFailures = 0
project.gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.find { it.name == "unitTestReport" } != null) {
taskGraph.allTasks.each { Task task ->
if (task.getName().equals("test")) {
println("Found test task: " + task)
Test test = (Test) task
test.ignoreFailures = true // proceed even test fails
test.afterSuite { td, tr ->
if (td.getParent() == null) {
ext.testFailures += tr.getFailedTestCount() // increment failed tests count
}
}
}
}
}
if (taskGraph.allTasks.find { it.name == "integTestReport" } != null) {
taskGraph.allTasks.each { Task task ->
if (task.getName().equals("integTest")) {
println("Found integTest task: " + task)
Test test = (Test) task
test.ignoreFailures = true
test.afterSuite { td, tr ->
if (td.getParent() == null) {
ext.integTestFailures += tr.getFailedTestCount()
}
}
}
}
}
}
allprojects {
apply plugin: 'java'
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
group = 'com.yifanwu.examples'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
test {
// reports.html.enabled = false // Disable the test report for the individual test task
// testLogging { showStandardStreams = true }
include '**/Test*'
include '**/*Test.*'
}
task integTest(type: Test) {
// reports.html.enabled = true // Disable the test report for the individual test task
// testLogging { showStandardStreams = true }
ignoreFailures = true
include '**/IT*'
include '**/*IT.*'
}
}
task unitTestReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allUnitTests")
// Include the results from the `test` task in all subprojects
reportOn allprojects*.test
doLast {
if (testFailures > 0) {
throw new GradleException("The build finished but ${testFailures} tests failed. Please check report! ")
}
}
}
task integTestReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allIntegTests")
// Include the results from the `test` task in all subprojects
reportOn allprojects*.integTest
doLast {
if (integTestFailures > 0) {
throw new GradleException("The build finished but ${integTestFailures} tests failed. Please check report! ")
}
}
}
ext {
camelVersion = '2.22.0'
}
// all external dependencies go into here for central management (ie. version, exclusion)
ext.libraries = [ // Groovy map literal
jcip: "net.jcip:jcip-annotations:1.0",
jsr305: 'com.google.code.findbugs:jsr305:3.0.2',
slf4j_log4j: "org.slf4j:slf4j-log4j12:1.7.25",
camel_core: dependencies.create("org.apache.camel:camel-core:${camelVersion}")
{ exclude module: "slf4j-api"
force = true },
camel_spring: "org.apache.camel:camel-spring:${camelVersion}",
camel_jms: "org.apache.camel:camel-jms:${camelVersion}",
camel_hawtdb: "org.apache.camel:camel-hawtdb:${camelVersion}",
camel_disruptor: "org.apache.camel:camel-disruptor:${camelVersion}",
camel_groovy: "org.apache.camel:camel-groovy:${camelVersion}",
camel_metrics: dependencies.create("org.apache.camel:camel-metrics:${camelVersion}")
{ exclude module: "slf4j-api"
force = true},
camel_http4: "org.apache.camel:camel-http4:${camelVersion}",
camel_exec: "org.apache.camel:camel-exec:${camelVersion}",
camel_kafka: dependencies.create("org.apache.camel:camel-kafka:${camelVersion}")
{ exclude module: "kafka-clients"
force = true},
kafka_clients: dependencies.create("org.apache.kafka:kafka-clients:0.11.0.1")
{ exclude module: "slf4j-api"
force = true},
camel_netty4_http: "org.apache.camel:camel-netty4-http:${camelVersion}",
camel_jetty: "org.apache.camel:camel-jetty:${camelVersion}",
camel_jackson: "org.apache.camel:camel-jackson:${camelVersion}",
camel_netty4: "org.apache.camel:camel-netty4:${camelVersion}",
camel_mail: "org.apache.camel:camel-mail:${camelVersion}",
camel_swagger_java: "org.apache.camel:camel-swagger-java:${camelVersion}",
camel_quartz: "org.apache.camel:camel-quartz:${camelVersion}",
activemq_all: "org.apache.activemq:activemq-all:5.11.1",
camel_sql: "org.apache.camel:camel-sql:${camelVersion}",
derby: "org.apache.derby:derby:10.12.1.1",
mysql_connector: "mysql:mysql-connector-java:5.1.6",
commons_dbcp: "commons-dbcp:commons-dbcp:1.4",
poi: "org.apache.poi:poi:3.12",
poi_ooxml: "org.apache.poi:poi-ooxml:3.12",
groovy_all: "org.codehaus.groovy:groovy-all:2.4.6",
json: "org.json:json:20160810",
google_gson: "com.google.code.gson:gson:2.6.2",
xbean_spring: "org.apache.xbean:xbean-spring:4.5",
camel_spring_security: "org.apache.camel:camel-spring-security:${camelVersion}",
spring_security_web: "org.springframework.security:spring-security-web:4.2.3.RELEASE",
httpclient: "org.apache.httpcomponents:httpclient:4.5.2",
guava: "com.google.guava:guava:23.0",
lettuce: "biz.paluch.redis:lettuce:4.2.2.Final",
jedis: "redis.clients:jedis:2.9.0",
spring_data_redis: dependencies.create("org.springframework.data:spring-data-redis:2.0.5.RELEASE")
{ exclude module: "slf4j-api"
force = true},
spring_core: "org.springframework:spring-core:5.0.7.RELEASE",
camel_stream: "org.apache.camel:camel-stream:${camelVersion}",
camel_xstream: "org.apache.camel:camel-xstream:2.17.0",
c3p0: "com.mchange:c3p0:0.9.5.2",
webjars_swaggerui: "org.webjars:swagger-ui:3.10.0",
// below are tests scope
junit: "junit:junit:4.12",
camel_test: "org.apache.camel:camel-test:${camelVersion}",
camel_test_spring: "org.apache.camel:camel-test-spring:${camelVersion}",
docker_client: "com.spotify:docker-client:8.9.1",
testcontainers: "org.testcontainers:testcontainers:1.4.2",
zkclient: dependencies.create("com.101tec:zkclient:0.10")
{ exclude module: "log4j"
exclude module: "slf4j-log4j12"
force = true},
kafka: dependencies.create("org.apache.kafka:kafka_2.11:0.11.0.1")
{ exclude module: "slf4j-log4j12"
force = true},
]