Managed ClassPath in Runtime + Scala.js causes Intellij to Perform Full Optimized Scala.js build in project load
mdedetrich opened this issue · 10 comments
If you use sbt-web
combined with Scala.js and you use the following in your build.sbt
managedClasspath in Runtime += (packageBin in Assets).value
When you try to load the project in IntelliJ with this following line, IntelliJ tries to do a full optimized Scala.js build when you try to load the SBT project. Often this times out and causes the project to be unusable within Intellij.
I am not entirely sure if this is an issue with Scala.js or sbt-web. sbt-web is what requires you to put managedClasspath in Runtime += (packageBin in Assets).value
inside your build.sbt, but I think this clashes with Scala.js
yes I am seeing something like this too
Is there an issue filed with Jetbrains about this?
@wsargent Not that I am aware of, but is it their fault? Afaik, Intellij now uses SBT to resolve dependencies, so it seems like SBT is triggering the build of Scala.js when it shouldn't be?
Is there any progress on this, or should I make an issue at Jetbrains?
I made an issue on Intellij's bug tracker to see if its on their end https://youtrack.jetbrains.com/issue/SCL-12594
IntelliJ Scala developer here.
The IntelliJ import depends on the managedClasspath
key indirectly to set the classpath in the IntelliJ-side project model. Thus, if that task has a dependency on package, an import will trigger a full compilation. I currently don't see a way around this except not having this dependency in your build.
@wsargent So it seems like this is purely an issue with sbt-web or Scala-js, if you do this
managedClasspath in Runtime += (packageBin in Assets).value
You are literally telling SBT (and hence Intellij) that in order to evaluate my classpath you need to package all of my assets (which actually doesn't make any sense, they are seperate things).
I have also made an issue with Scala-js
@jastice Perhaps IntelliJ should read the value of managedClasspath in Compile
rather than managedClasspath in Runtime
. AFAICT, the in Compile
should contain everything needed for the project model of IntelliJ, without introducing dependencies on potentially expensive things only part of in Runtime
.
@sjrd IntelliJ actually depends on externalDependencyClasspath
which depends on managedClasspath
to extract the dependencies for all sbt configurations. It's not clear to me we should be excluding specific configurations.
I will involve the sbt guys to see whats their comment here