From 844fa7908edf91c088f2a31cb23232663d7d1cd9 Mon Sep 17 00:00:00 2001 From: He-Pin Date: Fri, 26 Jan 2024 21:07:29 +0800 Subject: [PATCH] x --- project/Jdk9.scala | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/project/Jdk9.scala b/project/Jdk9.scala index 7c3bfb33f63..e97e3544f6e 100644 --- a/project/Jdk9.scala +++ b/project/Jdk9.scala @@ -11,8 +11,9 @@ * Copyright (C) 2017-2022 Lightbend Inc. */ -import sbt._ -import sbt.Keys._ +import JdkOptions.isJdk8 +import sbt.* +import sbt.Keys.* object Jdk9 extends AutoPlugin { import JdkOptions.notOnJdk8 @@ -57,10 +58,18 @@ object Jdk9 extends AutoPlugin { // Compile / fullClasspath ++= (CompileJdk9 / exportedProducts).value) Compile / dependencyClasspathAsJars ++= notOnJdk8((CompileJdk9 / exportedProducts).value)) - lazy val testSettings = Seq((Test / test) := { - (Test / test).value - (TestJdk9 / test).value - }) + lazy val testSettings = Seq( + (Test / test) := Def.taskDyn { + if (isJdk8) { + Def.task { + (Test / test).value + } + } else { + Def.task { + (TestJdk9 / test).value + } + } + }.value) override lazy val trigger = noTrigger override lazy val projectConfigurations = Seq(CompileJdk9)