-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.gradle
157 lines (131 loc) · 4.24 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'org.asciidoctor.jvm.convert' version '4.0.3'
id 'org.ajoberstar.git-publish' version '4.2.2'
}
gradle.rootProject {
apply plugin: 'distribution'
}
buildScan {
if (System.getenv('CI')) {
publishAlways()
tag 'CI'
}
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
allprojects {
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'test-report-aggregation'
//apply plugin: 'findbugs'
version = consensusjVersion // set in gradle.properties
group = 'com.msgilligan'
repositories {
mavenCentral()
}
// tasks.withType(FindBugs) {
// reports {
// xml.enabled false
// html.enabled true
// }
// }
}
subprojects {
dependencies {
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}")
testImplementation "org.apache.groovy:groovy:${groovyVersion}"
testImplementation("org.spockframework:spock-core:${spockVersion}") {
exclude module: "groovy-all"
}
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly "net.bytebuddy:byte-buddy:1.14.12" // allows Spock to mock classes (in addition to interfaces)
testRuntimeOnly "org.objenesis:objenesis:3.3" // Allow Spock to mock classes with constructor arguments
testRuntimeOnly "org.slf4j:slf4j-jdk14:${slf4jVersion}" // Runtime implementation of slf4j
}
configurations.configureEach {
resolutionStrategy {
force "org.apache.groovy:groovy:${groovyVersion}"
force "org.apache.groovy:groovy-json:${groovyVersion}"
}
// Ensure usage of Groovy 4.0 which has new Maven co-ordinates
resolutionStrategy.capabilitiesResolution.all {
if (capability.group.equals("org.codehaus.groovy")) {
selectHighestVersion()
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
compileJava {
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
options.encoding = 'UTF-8'
options.release = 11
}
tasks.withType(GroovyCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(AbstractArchiveTask).configureEach {
// This should result in reproducible JAR builds
// See: https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(Jar).configureEach {
// Normalize permissions for reproducible builds
dirMode = 0755
fileMode = 0644
}
tasks.withType(Javadoc).configureEach {
// Support reproducible JavaDoc builds
options.noTimestamp = true
}
tasks.withType(Test).configureEach {
useJUnitPlatform() // We're using Spock 2 and JUnit 5
}
}
apply from: 'gradle/idea.gradle'
apply from: 'gradle/javadoc.gradle'
apply from: 'gradle/asciidoctor.gradle'
apply from: 'gradle/github-pages.gradle'
apply from: 'gradle/maven-publish.gradle'
dependencies {
testReportAggregation project(':').subprojects
}
reporting {
reports {
testAggregateTestReport(AggregateTestReport) {
testType = TestSuiteType.UNIT_TEST
}
}
}
tasks.named('check') {
dependsOn tasks.named('testAggregateTestReport', TestReport)
}
build.dependsOn subprojects.build
tasks.register('buildCI') { dependsOn build, javadocAll, asciidoctor }
tasks.named('installDist').configure {
destinationDir = layout.buildDirectory.dir('artifacts').get().getAsFile()
}
distributions {
main {
contents {
project.subprojects.each { sub ->
into(sub.name) {
from sub.jar
from sub.sourcesJar
from sub.javadocJar
from sub.generatePomFileForJarPublication
from sub.generateMetadataFileForJarPublication
}
}
}
}
}