forked from jobrunr/jobrunr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
121 lines (103 loc) · 3.52 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
plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonarqube' version '4.4.1.3373'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'signing'
}
nexusPublishing {
packageGroup = "org.jobrunr"
repositories {
sonatype()
}
}
subprojects {
group = 'org.jobrunr'
version = System.getenv('DRONE_TAG')?.replace("v", "") ?: "v1.0.0-SNAPSHOT".replace("v", "")
}
def isNonStable = { String version ->
def isPreview = ['SNAPSHOT', 'ALPHA'].any { it -> version.toUpperCase().contains(it) }
def isRelease = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /(?!\.)(\d+(\.\d+)+)(?![\d\.])?(\.jre\d)?/
def isVersionMatch = (version ==~ regex)
def result = isPreview || !(isRelease || isVersionMatch)
return result
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
configure(subprojects.findAll { !['platform'].contains(it.name) }) {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'jacoco'
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
options.encoding = "UTF-8"
options.release = 8
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
options.encoding = "UTF-8"
}
javadoc {
options.encoding = "UTF-8"
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation platform(project(':platform'))
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'io.github.artsok:rerunner-jupiter'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.assertj:assertj-core'
testImplementation 'com.tngtech.archunit:archunit-junit5'
testImplementation 'net.javacrumbs.json-unit:json-unit-assertj'
testImplementation 'ch.qos.logback:logback-classic'
testImplementation 'org.mockito:mockito-inline'
testImplementation 'org.mockito:mockito-junit-jupiter'
}
tasks.clean.doFirst {
delete "/tmp/reports/$project.name"
println "Deleted /tmp/reports/$project.name"
}
test {
finalizedBy jacocoTestReport
reports.junitXml.destination = file("/tmp/reports/$project.name")
reports.html.destination = file("/tmp/reports/$project.name")
useJUnitPlatform()
testLogging {
minGranularity = 3
events "passed", "skipped", "failed"
}
}
sonar {
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectKey", "jobrunr_jobrunr"
property "sonar.organization", "jobrunr"
property "sonar.branch.name", System.getenv("DRONE_BRANCH") ?: "master"
property "sonar.coverage.jacoco.xmlReportPaths", "/tmp/reports/$project.name/jacocoTestCoverage.xml"
}
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
reports {
xml.required = true
xml.destination = file("/tmp/reports/$project.name/jacocoTestCoverage.xml")
csv.required = false
html.required = false
}
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}