sbt / zinc

Scala incremental compiler library, used by sbt and other build tools
Apache License 2.0
334 stars 120 forks source link

`compiler-bridge-test` & `zinc-scripted` do not show up in IntelliJ #1296

Closed Friendseeker closed 9 months ago

Friendseeker commented 9 months ago

steps

Open zinc via IntelliJ

problem

compiler-bridge-test & zinc-scripted are not properly recognized by IntelliJ.

Hence none of the smart IDE features work when editing files from compiler-bridge-test & zinc-scripted.

expectation

The two projects should are recognized by IntelliJ.

notes

This is certainly possible. In fact the following changes make IntelliJ recognize compiler-bridge-test & zinc-scripted.

Index: build.sbt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.sbt b/build.sbt
--- a/build.sbt (revision acd9ad679eae93105b31daf3fe054c13b1e5218c)
+++ b/build.sbt (date 1701506401387)
@@ -533,11 +533,11 @@
  * (Zinc API Info, which transitively depends on IO).
  */
 lazy val compilerBridgeTest = (project in internalPath / "compiler-bridge-test")
-  .dependsOn(zinc.jvm(scala213) % "compile->compile;test->test", compilerInterface.jvm(false))
+  .dependsOn(zinc.jvm(scala212) % "compile->compile;test->test", compilerInterface.jvm(false))
   .settings(
     name := "Compiler Bridge Test",
     baseSettings,
-    scalaVersion := scala213,
+    scalaVersion := scala212,
     compilerVersionDependentScalacOptions,
     // we need to fork because in unit tests we set usejavacp = true which means
     // we are expecting all of our dependencies to be on classpath so Scala compiler
@@ -548,6 +548,7 @@
     Test / javaOptions += "-Xmx1G",
     Test / javaOptions += s"-Dzinc.build.compilerbridge.scalaVersion=${scalaVersion.value}",
     publish / skip := true,
+    ideSkipProject := false,
   )

 val scalaPartialVersion = Def.setting(CrossVersion.partialVersion(scalaVersion.value))
@@ -656,7 +657,6 @@
   .enablePlugins(BuildInfoPlugin)
   .settings(
     baseSettings,
-    ideSkipProject := true, // otherwise IntelliJ complains
     publish / skip := true,
     name := "zinc Scripted",
     Compile / buildInfo := Nil, // Only generate build info for tests
@@ -668,7 +668,7 @@
   .defaultAxes(VirtualAxis.jvm, VirtualAxis.scalaPartialVersion(scala212))
   .jvmPlatform(scalaVersions = List(scala212))
   .configure(
-    _.dependsOn(compilerBridge210, compilerBridge211, compilerBridge212, compilerBridge213)
+    _.dependsOn(compilerBridge212)
   )
   .configure(addSbtUtilScripted)