I'm currently developing a multi-project Scala application in IntelliJ IDEA 14 with SBT. Projects have dependencies (dependency projects) between them and I need IntelliJ IDEA to inspect code from all projects, at least, from the projects I use from the current project (working project). I need IntelliJ IDEA to update this inspection (e.g. syntax highlighting) automatically after a change in a dependency project.
This is what I've tried:
I've tried to add a project as a library but the problem is that IntelliJ IDEA seems not to recognize the .scala files and packages.
I've also tried to set a compiled .jar of the working project as a library and set sbt in the dependency project to package the project into a .jar file every time I change a file: running
~package
in the sbt console of the dependency project. But it seems that this daemon prevents IntelliJ IDEA from reading the newly created .jar file in the working project. If I package the project manually after making a change, it works properly (I get code inspection and classes are loaded properly).I've tried SBT Multi-Project too but while this settings work for compiling the working project and the dependecy project, I don't get the IntelliJ IDEA code inspection that I need, everything that is not in the working project is highlighted in red. Or maybe I'm doing it wrong, here is the code (that's all I have done):
lazy val wcommon = RootProject(file("../WCommon")) val wrepository = Project(id = "application", base = file(".")).dependsOn(wcommon)
Any suggestion?