Skip to content

Commit

Permalink
make test not require coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jul 29, 2024
1 parent a632b07 commit a1e69cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
11 changes: 11 additions & 0 deletions java-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Jar>("sourcesJar") {
from(*((fromVersion..toVersion).map { sourceSets["java${it.ordinal + 1}"].allSource }).toTypedArray())
from(rootProject.sourceSets.getByName("shared").allSource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Path> downgradeClasspath = Arrays.stream(System.getProperty(DOWNGRADE_CLASSPATH).split(File.pathSeparator)).map(Path::of).toList();
Expand Down

0 comments on commit a1e69cd

Please sign in to comment.