Skip to content

Commit

Permalink
Making sure scala 2.13 is used when importing to IntelliJ (#3640)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghik authored Mar 27, 2024
1 parent da9a76f commit 8151c3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ val scala2_12 = "2.12.19"
val scala2_13 = "2.13.13"
val scala3 = "3.3.3"

// The `idea.managed` property is set automatically by IntelliJ when it runs sbt for build or import
val ideaManaged = System.getProperty("idea.managed", "false").toBoolean
val ideScalaVersion = if(ideaManaged) scala2_13 else scala3

val scala2Versions = List(scala2_12, scala2_13)
val scala2And3Versions = scala2Versions ++ List(scala3)
val scala2_13And3Versions = List(scala2_13, scala3)
Expand Down Expand Up @@ -67,8 +71,7 @@ val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
}
}.value,
mimaPreviousArtifacts := Set.empty, // we only use MiMa for `core` for now, using enableMimaSettings
ideSkipProject := (scalaVersion.value == scala2_12) ||
(scalaVersion.value == scala2_13) ||
ideSkipProject := (scalaVersion.value != ideScalaVersion) ||
thisProjectRef.value.project.contains("Native") ||
thisProjectRef.value.project.contains("JS"),
bspEnabled := !ideSkipProject.value,
Expand Down

0 comments on commit 8151c3d

Please sign in to comment.