From 8151c3d61d3a666532cb451df4d035fc2c716793 Mon Sep 17 00:00:00 2001 From: Roman Janusz Date: Wed, 27 Mar 2024 12:10:17 +0100 Subject: [PATCH] Making sure scala 2.13 is used when importing to IntelliJ (#3640) --- build.sbt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 3cccfc5086..64eee6a9fd 100644 --- a/build.sbt +++ b/build.sbt @@ -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) @@ -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,