forked from resilience4j/resilience4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
156 lines (129 loc) · 4.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
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
plugins {
id "org.sonarqube" version "3.2.0"
id 'org.asciidoctor.convert' version '1.6.0'
id "org.gradle.test-retry" version "1.2.1"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id "me.champeau.jmh" version "0.6.5"
id 'idea'
}
apply from: "${rootDir}/libraries.gradle"
allprojects {
apply plugin: 'jacoco'
version = '2.0.0-SNAPSHOT'
group = 'io.github.resilience4j'
description = 'Resilience4j is a lightweight, easy-to-use fault tolerance library designed for Java8 and functional programming'
repositories {
mavenCentral()
}
jacoco {
toolVersion = "0.8.7"
}
}
ext {
coreProjects = subprojects.findAll {
p -> !p.name.endsWith("-bom")
}
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId = '64e8d6879f4e95'
}
}
}
configure(project.coreProjects) {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: "${rootDir}/publishing.gradle"
apply plugin: "org.gradle.test-retry"
apply plugin: 'me.champeau.jmh'
tasks.withType(Test).all {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
jvmArgs += [
"-XX:+AllowRedefinitionToAddDeleteMethods"
]
}
}
dependencies {
implementation (libraries.slf4j)
// JSR-305 only used for non-required meta-annotations
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
testImplementation (libraries.vavr)
testImplementation (libraries.junit)
testImplementation (libraries.assertj)
testImplementation (libraries.logback)
testImplementation (libraries.mockito)
testImplementation (libraries.powermock)
testImplementation (libraries.powermock_api_mockito)
testImplementation (libraries.powermock_module_junit4)
testImplementation (libraries.awaitility)
testImplementation (libraries.jaxws)
}
tasks.withType(JavaCompile) {
sourceCompatibility = "11"
targetCompatibility = "11"
options.deprecation = true
options.encoding = 'UTF-8'
options.compilerArgs += ["-Xlint:unchecked", "-parameters"]
}
test {
retry {
maxRetries = 3
maxFailures = 20
failOnPassedAfterRetry = true
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
afterEvaluate {
jar {
inputs.property('moduleName', moduleName)
manifest.attributes(
'Automatic-Module-Name': moduleName
)
}
}
}
def allTestCoverageFile = "${rootProject.projectDir}/build/reports/jacoco/report.xml"
sonarqube {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "resilience4j"
property "sonar.projectName", "resilience4j"
property "sonar.projectKey", "resilience4j_resilience4j"
property "sonar.links.homepage", "https://github.com/resilience4j/resilience4j"
property "sonar.links.ci", "https://travis-ci.org/resilience4j/resilience4j"
property "sonar.links.scm", "https://github.com/resilience4j/resilience4j"
property "sonar.links.issue", "https://github.com/resilience4j/resilience4j/issues"
property "sonar.language", "java"
property "sonar.coverage.jacoco.xmlReportPaths", allTestCoverageFile
}
}
task jacocoMergeTest(type: JacocoMerge) {
destinationFile = file(allTestCoverageFile)
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
}
task jacocoRootTestReport(type: JacocoReport) {
coreProjects.each { dependsOn("${it.name}:test") }
coreProjects.each { dependsOn("${it.name}:jacocoTestReport") }
additionalSourceDirs.from = coreProjects.sourceSets.main.allSource.srcDirs
sourceDirectories.from = coreProjects.sourceSets.main.allSource.srcDirs
classDirectories.from = coreProjects.sourceSets.main.output
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
onlyIf {
true
}
reports {
xml.enabled true
xml.destination file(allTestCoverageFile)
html.enabled true
csv.enabled false
}
}
tasks.check.dependsOn tasks.jacocoRootTestReport
//tasks.jacocoRootTestReport.dependsOn tasks.test