Skip to content

Commit

Permalink
chore: Fix spiTest configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstdio committed Mar 25, 2022
1 parent b75532a commit 5d5dbbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")

import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import java.lang.Boolean as JavaBoolean

Expand All @@ -25,6 +26,8 @@ plugins {
id("de.jjohannes.extra-java-module-info")
}

val isCI = System.getenv("CI").toBoolean();

group = "io.github.nstdio"

java {
Expand All @@ -43,6 +46,13 @@ configurations.getByName("spiTestImplementation") {
extendsFrom(configurations.testImplementation.get())
}

mapOf(
"spiTestImplementation" to "testImplementation",
"spiTestRuntimeOnly" to "testRuntimeOnly",
).forEach { (t, u) ->
configurations.getByName(t) { extendsFrom(configurations.getByName(u)) }
}

val notModularConfigurations =
setOf("testRuntimeClasspath", "testCompileClasspath", "spiTestRuntimeClasspath", "spiTestCompileClasspath")
configurations.names
Expand Down Expand Up @@ -123,10 +133,12 @@ tasks.withType<JavaCompile>().configureEach {

tasks.withType<Test> {
useJUnitPlatform()

reports {
html.required.set(!isCI)
}
testLogging {
events("skipped", "failed")
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
exceptionFormat = FULL
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id("org.sonarqube")
}

val isCI = System.getenv("CI").toBoolean()


sonarqube {
properties {
Expand All @@ -37,6 +37,7 @@ jacoco {

tasks.withType<JacocoReport> {
reports {
val isCI = System.getenv("CI").toBoolean()
xml.required.set(isCI)
html.required.set(!isCI)
}
Expand Down

0 comments on commit 5d5dbbf

Please sign in to comment.