Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed ClassPath in Runtime + Scala.js causes Intellij to Perform Full Optimized Scala.js build in project load #154

Open
mdedetrich opened this issue Mar 2, 2017 · 10 comments

Comments

@mdedetrich
Copy link
Contributor

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

@LogicalTime
Copy link

yes I am seeing something like this too

@wsargent
Copy link

wsargent commented Aug 2, 2017

Is there an issue filed with Jetbrains about this?

@mdedetrich
Copy link
Contributor Author

mdedetrich commented Aug 2, 2017

@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?

@mdedetrich
Copy link
Contributor Author

Is there any progress on this, or should I make an issue at Jetbrains?

@mdedetrich
Copy link
Contributor Author

I made an issue on Intellij's bug tracker to see if its on their end https://youtrack.jetbrains.com/issue/SCL-12594

@jastice
Copy link

jastice commented Sep 20, 2017

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.

@mdedetrich
Copy link
Contributor Author

mdedetrich commented Sep 21, 2017

@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

@sjrd
Copy link

sjrd commented Sep 21, 2017

@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.

@jastice
Copy link

jastice commented Sep 22, 2017

@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.

@mdedetrich
Copy link
Contributor Author

I will involve the sbt guys to see whats their comment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants