-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
90 lines (77 loc) · 2.79 KB
/
Copy pathbuild.gradle
File metadata and controls
90 lines (77 loc) · 2.79 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id "java-library" // Java plus providing specific knowledge about Java libraries
id "de.monticore.generator" version "$mc_version" // MontiCore Plugin
id "com.gradleup.shadow" version "8.3.11" // for creating the all-in-one jar
id 'maven-publish'
}
allprojects {
group = 'de.monticore'
layout.buildDirectory = layout.projectDirectory.dir("target")
repositories {
if (("true").equals(getProperty('useLocalRepo'))) {
mavenLocal()
}
maven {
credentials.username = mavenUser
credentials.password = mavenPassword
url = repo
}
mavenCentral()
}
}
subprojects {
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
}
}
addTestListener(new TestListener() {
void afterTest(TestDescriptor testDescriptor, TestResult result) {
logger.lifecycle "${testDescriptor.getClassName()} > ${testDescriptor.parent && testDescriptor.parent.getName() != testDescriptor.getClassName() ? testDescriptor.parent.getName() + " " + testDescriptor.getDisplayName() : testDescriptor.getName()} ${result.resultType}"
}
void afterSuite(TestDescriptor suite, TestResult result) {
if (!suite.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
}
}
// Required for Gradle version < 9.x
void beforeSuite(TestDescriptor suite) {
}
void beforeTest(TestDescriptor testDescriptor) {
}
})
reports {
junitXml.required = false
html.required = false
}
}
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
repositories.maven {
credentials.username = mavenUser
credentials.password = mavenPassword
def releasesRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/monticore-releases/"
def snapshotsRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/monticore-snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}