11// Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>
22
33lazy val checkPluginXml = taskKey[Unit ](" Verify that the generated Maven plugin descriptor exists under target." )
4+ lazy val runCompatTests = taskKey[Unit ](" Run scripted fixture tests only on sbt versions with a compatible ScalaTest." )
45
56lazy val root = project
67 .in(file(" ." ))
@@ -12,17 +13,25 @@ lazy val root = project
1213 target.value / " classes" / " META-INF" / " maven" / " plugin.xml"
1314 } else {
1415 target.value / " resource_managed" / " main" / " META-INF" / " maven" / " plugin.xml"
15- }
16+ }
1617 require(pluginXml.isFile, s " Expected generated plugin.xml at $pluginXml" )
1718 },
19+ runCompatTests := {
20+ if (sbtBinaryVersion.value == " 1.0" ) {
21+ (Test / test).value
22+ } else {
23+ // TODO Re-enable Test / test on sbt 2 once ScalaTest publishes a Scala 3 version compatible with sbt 2's Scala.
24+ streams.value.log.info(" Skipping Test / test on sbt 2 until a compatible ScalaTest version is available." )
25+ }
26+ },
1827 crossPaths := false ,
1928 autoScalaLibrary := false ,
2029 organization := " com.example" ,
2130 name := " Simple" ,
2231 mavenPluginGoalPrefix := " simple" ,
2332 mavenLaunchOpts += version.apply { v => s " -Dplugin.version= $v" }.value,
2433 libraryDependencies ++= Seq (
25- " org.scalatest" %% " scalatest" % " 3.2.16 " % Test ,
26- " org.scalatest" %% " scalatest-wordspec" % " 3.2.16 " % Test ,
34+ " org.scalatest" %% " scalatest" % " 3.2.20 " % Test ,
35+ " org.scalatest" %% " scalatest-wordspec" % " 3.2.20 " % Test ,
2736 )
2837 )
0 commit comments