Skip to content

Commit

Permalink
Latest build conventions (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
big-andy-coates authored Aug 8, 2023
1 parent cb58cba commit f6b2368
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 85 deletions.
25 changes: 0 additions & 25 deletions annotation/src/test/resources/junit-platform.properties

This file was deleted.

3 changes: 3 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
* limitations under the License.
*/

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
}
17 changes: 12 additions & 5 deletions buildSrc/src/main/kotlin/creek-common-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*
* <p>Apply to all java modules, usually excluding the root project in multi-module sets.
*
* <p>Version: 1.7
* <p>Version: 1.8
* - 1.8: Tweak test config to reduce build speed.
* - 1.7: Switch to setting Java version via toolchain
* - 1.6: Remove GitHub packages for snapshots
* - 1.5: Add filters to exclude generated sources
Expand Down Expand Up @@ -70,8 +71,8 @@ tasks.withType<JavaCompile> {

tasks.test {
useJUnitPlatform()
setForkEvery(1)
maxParallelForks = 4
setForkEvery(5)
maxParallelForks = Runtime.getRuntime().availableProcessors()
testLogging {
showStandardStreams = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
Expand Down Expand Up @@ -117,17 +118,23 @@ if (rootProject.name != project.name) {
}
}

tasks.register("format") {
val format = tasks.register("format") {
group = "creek"
description = "Format the code"

dependsOn("spotlessCheck", "spotlessApply")
}

tasks.register("static") {
val static = tasks.register("static") {
group = "creek"
description = "Run static code analysis"

dependsOn("checkstyleMain", "checkstyleTest", "spotbugsMain", "spotbugsTest")

shouldRunAfter(format)
}

tasks.test {
shouldRunAfter(static)
}

25 changes: 0 additions & 25 deletions schema/src/test/resources/junit-platform.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

import java.lang.reflect.InvocationTargetException;
import java.time.Duration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.Isolated;
import org.junitpioneer.jupiter.SetEnvironmentVariable;

@Isolated // This test uses @SetEnvironmentVariable, which modifies global env
@Execution(SAME_THREAD) // ...this isn't thread-safe. So isolate from other tests.
class SystemEnvTest {

@SetEnvironmentVariable(key = "a-key", value = "-109")
Expand Down
25 changes: 0 additions & 25 deletions type/src/test/resources/junit-platform.properties

This file was deleted.

0 comments on commit f6b2368

Please sign in to comment.