From 88b1492d524c4a96bb000f2c46f7b05552d7aea6 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Fri, 30 Nov 2018 11:57:16 +0100 Subject: [PATCH] Introduce 'junit-jupiter' module Introduce 'junit-jupiter' as an almost empty aggregator module easing the configuration required to get started with JUnit Jupiter. Addresses #1629 --- build.gradle.kts | 1 + junit-jupiter/junit-jupiter.gradle.kts | 15 +++++++++ .../projects/gradle-starter/build.gradle | 4 +-- .../junit-jupiter.expected.txt | 4 +++ .../projects/maven-starter/pom.xml | 33 ++----------------- .../platform/tooling/support/HelperTests.java | 1 + settings.gradle.kts | 1 + 7 files changed, 26 insertions(+), 33 deletions(-) create mode 100644 junit-jupiter/junit-jupiter.gradle.kts create mode 100644 platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt diff --git a/build.gradle.kts b/build.gradle.kts index cf5d31df3dbe..92aa8bde1cd3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -43,6 +43,7 @@ val platformProjects by extra(listOf( )) val jupiterProjects by extra(listOf( + project(":junit-jupiter"), project(":junit-jupiter-api"), project(":junit-jupiter-engine"), project(":junit-jupiter-migrationsupport"), diff --git a/junit-jupiter/junit-jupiter.gradle.kts b/junit-jupiter/junit-jupiter.gradle.kts new file mode 100644 index 000000000000..f8be206d3265 --- /dev/null +++ b/junit-jupiter/junit-jupiter.gradle.kts @@ -0,0 +1,15 @@ +description = "JUnit Jupiter (Aggregator)" + +dependencies { + api(project(":junit-jupiter-api")) + api(project(":junit-jupiter-params")) + runtimeOnly(project(":junit-jupiter-engine")) +} + +tasks.jar { + manifest { + attributes( + "Automatic-Module-Name" to "org.junit.jupiter" + ) + } +} diff --git a/platform-tooling-support-tests/projects/gradle-starter/build.gradle b/platform-tooling-support-tests/projects/gradle-starter/build.gradle index c88951f13625..83e1b049c0b0 100644 --- a/platform-tooling-support-tests/projects/gradle-starter/build.gradle +++ b/platform-tooling-support-tests/projects/gradle-starter/build.gradle @@ -25,9 +25,7 @@ repositories { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") + testImplementation("org.junit.jupiter:junit-jupiter:${jupiterVersion}") } test { diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt new file mode 100644 index 000000000000..61f3691be103 --- /dev/null +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt @@ -0,0 +1,4 @@ +>> 1 line header: No module descriptor found. Derived automatic module. >> + +org.junit.jupiter@${jupiterVersion} automatic +requires java.base mandated diff --git a/platform-tooling-support-tests/projects/maven-starter/pom.xml b/platform-tooling-support-tests/projects/maven-starter/pom.xml index 144aa6b28970..f432ff455312 100644 --- a/platform-tooling-support-tests/projects/maven-starter/pom.xml +++ b/platform-tooling-support-tests/projects/maven-starter/pom.xml @@ -9,27 +9,14 @@ UTF-8 - 10 + 11 ${env.JUNIT_JUPITER_VERSION} - ${env.JUNIT_PLATFORM_VERSION} org.junit.jupiter - junit-jupiter-api - ${junit.jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-params - ${junit.jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-engine + junit-jupiter ${junit.jupiter.version} test @@ -39,11 +26,7 @@ maven-compiler-plugin - 3.7.0 - - ${java.version} - ${java.version} - + 3.8.0 maven-surefire-plugin @@ -52,14 +35,4 @@ - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java index 91b8367ce90b..43065423a62a 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java @@ -30,6 +30,7 @@ class HelperTests { @Test void loadModuleDirectoryNames() { assertLinesMatch(List.of( // + "junit-jupiter", // "junit-jupiter-api", // "junit-jupiter-engine", // "junit-jupiter-migrationsupport", // diff --git a/settings.gradle.kts b/settings.gradle.kts index 3a720f079c93..7316a1401c63 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,6 +26,7 @@ require(javaVersion.isJava11Compatible) { rootProject.name = "junit5" include("documentation") +include("junit-jupiter") include("junit-jupiter-api") include("junit-jupiter-engine") include("junit-jupiter-migrationsupport")