diff --git a/build.gradle.kts b/build.gradle.kts index 6da2f35..d0f9692 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,7 +30,6 @@ subprojects { targetCompatibility = JavaVersion.VERSION_19 } - // Spotless (code formatting/linting) apply(plugin = "com.diffplug.spotless") configure { java { @@ -39,7 +38,6 @@ subprojects { } } - // Checkstyle (static analysis - code quality/style) apply(plugin = "checkstyle") configure { toolVersion = "10.12.0" @@ -49,7 +47,6 @@ subprojects { isIgnoreFailures = false } - // SpotBugs (static analysis - find possible bugs, performance issues etc.) apply(plugin = "com.github.spotbugs") configure { effort.set(Effort.MAX) @@ -58,25 +55,20 @@ subprojects { excludeFilter.set(rootProject.file("./spotbugs-exclude.xml")) } tasks.withType { - reports.create("xml").required.set(true) reports.create("html").required.set(true) } tasks.withType { - // run tests in parallel, assumes they're threadsafe maxParallelForks = Runtime.getRuntime().availableProcessors() - // use JUnit 5 engine useJUnitPlatform() testLogging { events = setOf(TestLogEvent.FAILED, TestLogEvent.SKIPPED) - // log the full failure messages exceptionFormat = TestExceptionFormat.FULL showExceptions = true showCauses = true showStackTraces = true - // log the overall results (based on https://stackoverflow.com/a/36130467/6122976) afterSuite(KotlinClosure2({ desc: TestDescriptor, result: TestResult -> - if (desc.parent == null) { // will match the outermost suite + if (desc.parent == null) { println( "Results: ${result.resultType} " + "(${result.testCount} test${if (result.testCount > 1) "s" else ""}, " + @@ -90,16 +82,24 @@ subprojects { finalizedBy(tasks.withType()) } - // JaCoCo (code coverage reporting) apply(plugin = "jacoco") tasks.withType { reports { xml.required.set(true) - html.required.set(true) - csv.required.set(false) } } + val previewFeatures = listOf("--enable-preview") + tasks.withType { + options.compilerArgs = previewFeatures + } + tasks.withType { + jvmArgs = previewFeatures + } + tasks.withType { + jvmArgs = previewFeatures + } + dependencies { val log4jVersion = "2.20.0" val guavaVersion = "32.0.1-jre" @@ -116,12 +116,11 @@ subprojects { testImplementation("org.mockito:mockito-core:$mockitoVersion") testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") - // dependency cleanup configurations.all { - exclude("org.assertj") // using truth instead - exclude("junit") // using junit5 + exclude("org.assertj") + exclude("junit") resolutionStrategy { - force("com.google.guava:guava:$guavaVersion") // so the android version isn't pulled in + force("com.google.guava:guava:$guavaVersion") // exclude android version } } } diff --git a/hello-world/build.gradle.kts b/hello-world/build.gradle.kts index 4d6ecd5..a963759 100644 --- a/hello-world/build.gradle.kts +++ b/hello-world/build.gradle.kts @@ -2,4 +2,6 @@ plugins { id("org.unbroken-dome.test-sets") version "4.0.0" } -testSets { create("integrationTest") } +testSets { + create("integrationTest") +} \ No newline at end of file