From a1e69cdbb6c38b9bacab78df0559da14467fd671 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Sun, 28 Jul 2024 20:23:19 -0500 Subject: [PATCH] make test not require coverage --- build.gradle.kts | 2 +- java-api/build.gradle.kts | 11 +++++++++++ .../jvmdg/test/integration/ClassRunner.java | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7a28b31d..84ab27cc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -193,7 +193,7 @@ tasks.test { dependsOn( project(":downgradetest").tasks.build, - project(":java-api").tasks.build + project(":java-api").tasks.named("testJar") ) javaLauncher = javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(testVersion.toInt())) diff --git a/java-api/build.gradle.kts b/java-api/build.gradle.kts index c87a4fc4..7713bb4d 100644 --- a/java-api/build.gradle.kts +++ b/java-api/build.gradle.kts @@ -173,6 +173,17 @@ tasks.jar { isReproducibleFileOrder = true } +val testJar by tasks.registering(Jar::class) { + from(*((fromVersion..toVersion).map { sourceSets["java${it.ordinal + 1}"].output }).toTypedArray()) + from(rootProject.sourceSets.getByName("shared").output) + from(sourceSets.main.get().output) + + destinationDirectory = temporaryDir + + isPreserveFileTimestamps = false + isReproducibleFileOrder = true +} + tasks.getByName("sourcesJar") { from(*((fromVersion..toVersion).map { sourceSets["java${it.ordinal + 1}"].allSource }).toTypedArray()) from(rootProject.sourceSets.getByName("shared").allSource) diff --git a/src/test/java/xyz/wagyourtail/jvmdg/test/integration/ClassRunner.java b/src/test/java/xyz/wagyourtail/jvmdg/test/integration/ClassRunner.java index 0222dafb..84fe2d2e 100644 --- a/src/test/java/xyz/wagyourtail/jvmdg/test/integration/ClassRunner.java +++ b/src/test/java/xyz/wagyourtail/jvmdg/test/integration/ClassRunner.java @@ -42,7 +42,7 @@ public class ClassRunner { private static final Path original = Path.of("./downgradetest/build/libs/downgradetest-1.0.0.jar"); - private static final Path javaApi = Path.of("./java-api/build/libs/jvmdowngrader-java-api-" + System.getProperty(JVMDG_VERSION_KEY) + ".jar"); + private static final Path javaApi = Path.of("./java-api/build/tmp/testJar/jvmdowngrader-java-api-" + System.getProperty(JVMDG_VERSION_KEY) + ".jar"); private static final Path sharedClasses = Path.of("./build/classes/java/shared"); private static final List downgradeClasspath = Arrays.stream(System.getProperty(DOWNGRADE_CLASSPATH).split(File.pathSeparator)).map(Path::of).toList();