externalDependencyClasspath depending on managedClasspath in Runtime
See original GitHub issuesteps
Use an sbt-plugin such as sbt-web, and have the following included in your build.sbt
managedClasspath in Runtime += (packageBin in Assets).value
You can clone https://github.com/vmunier/akka-http-with-scalajs-example if you want a live example
Finally load the project in Intellij
problem
When using Intellij which resolves dependencies via sbt, Intellij runs the externalDependencyClasspath
task to resolve the dependencies it needs. It appears that this task depends on managedClasspath in Runtime
. Since plugins such as sbt-web compile Scala.js artifacts to managedClasspath in Runtime
, this causes Intellij to do a scala-js fullOptJs
when loading dependencies for such a project, taking easily 20+ minutes and sometimes causing Intellij to freeze
expectation
Need to clarify if externalDependencyClasspath
should actually depend on managedClasspath in Runtime
. According to @sjrd, managedClasspath in Compile
should be enough to get the dependencies needed for the project. If externalDependencyClasspath
depending on managedClasspath in Runtime
is correct, then scala-js/sbt-web needs to re-evaluate how it uses sbt?
notes
Related ticket is https://github.com/sbt/sbt-web/issues/154 Also scala-js (ticket is closed) https://github.com/scala-js/scala-js/issues/3145
Also on Intellij bug tracker as https://youtrack.jetbrains.com/issue/SCL-12594
sbt version: 0.13.x
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:29 (16 by maintainers)
@eed3si9n Thanks a lot for the help, going to make an issue with akka-http-with-scalajs-example. It is also however mentioned on sbt-web, see https://github.com/sbt/sbt-web/blob/master/README.md#packaging-and-publishing
The membership into
Universal / packageBin
is calledUniversal / mapping
. sbt-native-packager populates it by usingJavaAppPackaging
(or “Java Application Archetype”).https://github.com/sbt/sbt-native-packager/blob/v1.5.2/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala#L52-L64
If you need to stuff more files into the
Universal / mappings ++= List(...)
you can probably do that first frombuild.sbt
, but it might be a good idea to define a custom archetype that extendsJavaAppPackaging
likeJavaServerAppPackaging
.