sbt-eclipse
sbt-eclipse copied to clipboard
add recommendations for multiprojects and crossprojects
I am having huge issues with cross ScalaJVM/JS projects and projects with macroses. By experimenting I managed to figure out that without
EclipseKeys.useProjectId := true,
EclipseKeys.skipParents := false,
It cannot even import crossprojects. But even after importing I get a huge number (400+) compile errors for totally valid (in sbt console and in Intellij projects) =(
I suspect it is also connected with this issue https://github.com/typesafehub/sbteclipse/issues/272
cross projects are easy to setup (see my example in the linked issue). You must have a more complex setup when the setup in the linked issue still does not work for you. If you would share your build config, it would be possible to help you. Otherwise I need a crystal ball.
@sschaef sorry for the delay here is a development branch of my scala-js-binding library that fails with 500+ errors

The main problem here is actually the same as in the linked issue: The dependencies rely on the crossProject instead of either the JS or the JVM side. Manually, this is easy to fix however. Just do a right click on the project with a exclamation mark and select "Properties > Java Build Path > Projects" and replace the referenced XXXX project with either XXXXJVM or XXXXJS (depends on which side you are).
Another problem was that transitive dependencies to other projects are not added automatically. Therefore I added all the dependencies to each project, see this diff: https://gist.github.com/sschaef/a0ebd68ffc048fc6e725
This diff also contains a change in the source because some macro call did not want to compile.
I also had to add previewJS as dependency to previewJVM. After that I only got compilation errors in previewJVM because the Scala.js dependency could not be found. I don't know where to get it from for a JVM project, please have a look at that by yourself.
There are quite some problems and manually fixing this errors means that the next time new build files are generated, everything has to be done again. I will consider better ScalaJS support for the upcoming sbt-server integration in Scala IDE, hopefully all problems can be solved there.