Open dwijnand opened 7 years ago
Some details:
Contraband, in its baseContrabandSettings, which it runs through inConfig(Compile)
and inConfig(Test)
defines (among other things):
sourceManaged in generateContrabands := sourceManaged.value
And then protocolProj in sbt defines:
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala"
So everything is task-scoped.
/cc @jastice
It seems the compile
task gets the contraband source files via the output of the sourceGenerators
. Which works just fine for sbt, but since IntelliJ knows only directory-level sources can't be easily imported, and also can't be imported without actually calling the generators. You might just want to add the contraband directory to themanagedSourceDirectories
setting :\
Alternatively, it might be possible to import task-scoped source directories, but I'm not clear on how to do that robustly
It seems the
compile
task gets the contraband source files via the output of thesourceGenerators
.
Could you show me (or explain to me) how that comes to be true?
Following the inspect rabbithole: protocolProj/compile -> protocolProj/compile:manipulateBytecode -> protocolProj/compile:compileIncremental -> protocolProj/compile:compile::compileInputs -> protocolProj/compile:compile::sources -(provided by) -> protocolProj/compile:sources -> protocolProj/compile:managedSources -> protocolProj/compile:sourceGenerators -> protocolProj/compile:generateContrabands
protocolProj/compile:managedSources
->protocolProj/compile:sourceGenerators
ah-ha. Thank you.
I guess given this we can't solve this at the root (sbt), at least for now. We'll have to fix it on a case-by-case basis and by convention.
It would be interesting to fix this in the close future in the spirit of getting more contributors to 1.0.
Just taking a moment to start this issue.
I wouldn't be surprised if this is: