Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (102 loc) · 3.67 KB
/
Copy pathbuild.gradle
File metadata and controls
115 lines (102 loc) · 3.67 KB
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
/* (c) https://github.com/MontiCore/monticore */
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'java-library'
id "io.github.themrmilchmann.ecj" version "$ecj_plugin_version" // Eclipse compiler as it's much faster than javac
id "org.sonarqube" version "$sonarqube_plugin_version"
id "jacoco"
id 'org.barfuin.gradle.jacocolog' version "$jacocolog_plugin_version"
id 'maven-publish'
}
ecj {
compilerVersion = "3.43.0"
}
allprojects {
group = "de.se_rwth.commons"
layout.buildDirectory = file("$projectDir/target")
repositories {
if(("true").equals(getProperty('useLocalRepo'))){
mavenLocal()
}
maven {
credentials.username = mavenUser
credentials.password = mavenPassword
url = repo
}
mavenCentral()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin : 'io.github.themrmilchmann.ecj'
ecj {
compilerVersion = "3.43.0"
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
// controls whether test output is shown
showStandardStreams= !("false").equals(getProperty('showTestOutput'))
showExceptions = true
showCauses = true
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
info {
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
}
}
afterTest { desc, result ->
logger.lifecycle "${desc.className} > ${desc.name} ${result.resultType}"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
logger.lifecycle startItem + output + endItem
}
}
reports {
junitXml.required = false
html.required = false
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
options.encoding = "UTF-8"
options.deprecation = false
options.warnings = false
options.fork = true
options.headerOutputDirectory.convention(null)
}
java {
withSourcesJar()
// Configure the java toolchain to use Java 21 (overriding the locally installed JDK)
// https://docs.gradle.org/current/userguide/toolchains.html
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
}
subprojects {
apply plugin: 'maven-publish'
publishing {
// We do not define a default publication, as some subprojects use the gradle-plugin plugin
repositories.maven {
credentials.username = mavenUser
credentials.password = mavenPassword
def releasesRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/se-commons-releases/"
def snapshotsRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/se-commons-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
task cleanAll {
dependsOn(this.subprojects.collect {it.tasks.withType(Delete)})
dependsOn(tasks.withType(Delete))
}
defaultTasks 'build'