Working on some scala software in IDEA IntelliJ. (It also features Android if it is essential). Suppose I have two projects:
P1, written in scala, uses sbt as the build tool
P2, written in java, uses gradle as the build tool
I want to call some code from P2, having its full source. So I import P2 as a module in my IntelliJ scala project. But when I compile my sbt project using sbt-shell, it tells me an error that it cannot find any definitions of classes and packages declared in P2. I guess I need to create a proper reference in my build.sbt file so it could understand where the definitions come from. I've found one solution which suggests adding unmanaged java source paths to build.sbt like so:
unmanagedSourceDirectories in Compile += file("mydependency")
but thing is that dependency has dependencies itself. When I try to compile that, sbt tells me that it cannot find definitions of that dependency. So I need a way to reference full java project in build.sbt so that I could then compille whole thing via sbt shell (in fact, I forced to use the very sbt shell).
Any suggestions?