sbt-projectmatrix icon indicating copy to clipboard operation
sbt-projectmatrix copied to clipboard

Managed source directory doesn't seem to make it into IDEA

Open justinp opened this issue 2 years ago • 1 comments

I've got a matrix for different Scala versions that I'm using in combination with a code generator. Everything builds from the sbt command line, but when I import it into IDEA, it can't find the generated sources.

From the command line:

sbt:test> model/sourceDirectories
[info] * /Users/justinp/test/model/src/main/scala
[info] * /Users/justinp/test/model/src/main/scala-2.13
[info] * /Users/justinp/test/model/src/main/scala-2
[info] * /Users/justinp/test/model/src/main/java
[info] * /Users/justinp/test/model/src/main/scalajvm
[info] * /Users/justinp/test/model/src/main/scalajvm-2.13
[info] * /Users/justinp/test/model/target/jvm-2.13/src_managed/main

That last one is where my sources have been generated.

In IDEA, I see a project model whose base directory is /Users/justinp/test/.sbt/matrix/model, which contains nothing. It depends another project model-sources, which contains the generated files (by virtue of its base directory being /Users/justinp/test/model), but the directory is not marked as "Sources."

Screen Shot 2022-09-21 at 10 47 30 AM

I'd be happy to help with a PR, but I can't figure out where the breakdown occurs. If I look at the sbt-structure.xml that gets generated by IDEA, it contains the source directory I would expect (for the model project), but I don't see the model-sources project at all in there.

Thanks for any guidance you can give me. This is the last thing standing between us and upgrading (finally!) to Scala 2.13.

justinp avatar Sep 21 '22 15:09 justinp

Came here with the same issue.

Nurlan-Mammadli avatar Jan 10 '23 20:01 Nurlan-Mammadli