From 567988186cbe704255aefdc6bc970cff7d01be00 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Wed, 18 Dec 2024 09:48:04 +0000 Subject: [PATCH] Cross-build sbt-metals for sbt2 --- build.sbt | 13 +++++++++++++ project/V.scala | 1 + 2 files changed, 14 insertions(+) diff --git a/build.sbt b/build.sbt index 8e922a8287a..f06322f9f6f 100644 --- a/build.sbt +++ b/build.sbt @@ -526,7 +526,20 @@ lazy val `sbt-metals` = project "lastSupportedSemanticdb" -> SemanticDbSupport.last, ), scalaVersion := V.scala212, + crossScalaVersions := Seq(V.scala212, V.scala3ForSBT2), scriptedLaunchOpts ++= Seq(s"-Dplugin.version=${version.value}"), + (pluginCrossBuild / sbtVersion) := { + scalaBinaryVersion.value match { + case "2.12" => "1.5.8" + case _ => "2.0.0-M3" + } + }, + scalacOptions ++= { + scalaBinaryVersion.value match { + case "2.12" => "-Xsource:3" :: Nil + case _ => Nil + } + }, ) .settings(sharedScalacOptions) .enablePlugins(BuildInfoPlugin, SbtPlugin) diff --git a/project/V.scala b/project/V.scala index 41bd538236f..cb6f5a7e3ed 100644 --- a/project/V.scala +++ b/project/V.scala @@ -7,6 +7,7 @@ object V { val scala213 = "2.13.15" val lastPublishedScala3 = "3.3.3" val scala3 = "3.3.4" + val scala3ForSBT2 = "3.6.2" // When you can add to removedScalaVersions in MtagsResolver.scala with the last released version val sbtScala = "2.12.18"