Skip to content

Commit 9b789a0

Browse files
committed
Consolidate duplicated config from subprojects and root into allprojects
1 parent bebc618 commit 9b789a0

File tree

2 files changed

+34
-38
lines changed

2 files changed

+34
-38
lines changed

build.gradle.kts

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,57 @@ version = "$pluginVersion$versionSuffix"
119119

120120
allprojects {
121121
apply(plugin = "java")
122+
apply(plugin = "com.adarshr.test-logger")
123+
122124
configure<JavaPluginExtension> {
123125
sourceCompatibility = JavaVersion.VERSION_21
124126
targetCompatibility = JavaVersion.VERSION_21
125127
}
126128
tasks.withType<JavaCompile> {
127129
options.encoding = "UTF-8"
128130
}
131+
132+
repositories {
133+
mavenCentral()
134+
}
135+
136+
dependencies {
137+
testImplementation("junit:junit:4.13.2")
138+
testImplementation("org.opentest4j:opentest4j:1.3.0")
139+
}
140+
141+
// Configure test-logger plugin for consistent console output across all projects
142+
configure<com.adarshr.gradle.testlogger.TestLoggerExtension> {
143+
theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
144+
showExceptions = true
145+
showStackTraces = true
146+
showFullStackTraces = false
147+
showCauses = true
148+
slowThreshold = 2000
149+
showSummary = true
150+
showStandardStreams = false
151+
showPassedStandardStreams = false
152+
showSkippedStandardStreams = false
153+
showFailedStandardStreams = true
154+
}
155+
156+
tasks.withType<Test> {
157+
testLogging {
158+
exceptionFormat = TestExceptionFormat.FULL
159+
}
160+
}
129161
}
130162

131163
subprojects {
132164
apply(plugin = "org.jetbrains.intellij.platform.module")
165+
133166
repositories {
134-
mavenCentral()
135167
intellijPlatform {
136168
defaultRepositories()
137169
}
138170
}
139-
dependencies {
140-
testImplementation("junit:junit:4.13.2")
141-
testImplementation("org.opentest4j:opentest4j:1.3.0")
142171

172+
dependencies {
143173
intellijPlatform {
144174
create(providers.gradleProperty("platformType"), provider { actualPlatformVersion })
145175

@@ -303,25 +333,6 @@ tasks.named<Test>("test") {
303333
exclude("**/org/elixir_lang/parser_definition/ParsingTestCase.class")
304334
exclude("**/org/elixir_lang/parser_definition/matched_call_operation/ParsingTestCase.class")
305335
exclude("**/org/elixir_lang/parser_definition/matched_dot_operator_call_operation/ParsingTestCase.class")
306-
307-
testLogging {
308-
exceptionFormat = TestExceptionFormat.FULL
309-
}
310-
}
311-
312-
// Configure test-logger plugin for better console output
313-
testlogger {
314-
theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
315-
showExceptions = true
316-
showStackTraces = true
317-
showFullStackTraces = false
318-
showCauses = true
319-
slowThreshold = 2000
320-
showSummary = true
321-
showStandardStreams = false
322-
showPassedStandardStreams = false
323-
showSkippedStandardStreams = false
324-
showFailedStandardStreams = true
325336
}
326337

327338
// Get the list of platforms from gradle.properties
@@ -357,7 +368,6 @@ intellijPlatformTesting {
357368

358369
repositories {
359370
maven { url = uri("https://maven-central.storage.googleapis.com") }
360-
mavenCentral()
361371
intellijPlatform {
362372
defaultRepositories()
363373
}
@@ -379,9 +389,6 @@ dependencies {
379389
implementation(project(":jps-shared"))
380390
implementation(files("lib/OtpErlang.jar"))
381391
implementation(group = "commons-io", name = "commons-io", version = "2.21.0")
382-
383-
testImplementation("junit:junit:4.13.2")
384-
testImplementation("org.opentest4j:opentest4j:1.3.0")
385392
}
386393

387394
tasks.named("compileJava") {

jps-builder/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2-
31
tasks.jar {
42
archiveFileName.set("jps-builder.jar")
53
}
@@ -33,15 +31,6 @@ tasks.test {
3331
environment("ELIXIR_VERSION", elixirVersion)
3432

3533
include("**/*Test.class")
36-
37-
testLogging {
38-
events("passed", "skipped", "failed", "standardOut", "standardError")
39-
exceptionFormat = TestExceptionFormat.FULL
40-
showStandardStreams = true
41-
showExceptions = true
42-
showCauses = true
43-
showStackTraces = true
44-
}
4534
}
4635

4736
dependencies {

0 commit comments

Comments
 (0)