Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed source dirs aren't mapped to source directories in IDEA #76

Open
dwijnand opened this issue Feb 28, 2017 · 8 comments
Open

Managed source dirs aren't mapped to source directories in IDEA #76

dwijnand opened this issue Feb 28, 2017 · 8 comments
Labels
uncategorized Used for Waffle integration

Comments

@dwijnand
Copy link
Member

dwijnand commented Feb 28, 2017

Just taking a moment to start this issue.

I wouldn't be surprised if this is:

  • a mistake on IDEA's behalf on how they derive what the source directories are
  • an sbt issue
  • something specific to how we're using contraband in the sbt modules
@dwijnand
Copy link
Member Author

dwijnand commented Mar 3, 2017

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.

@dwijnand
Copy link
Member Author

dwijnand commented Mar 3, 2017

/cc @jastice

@jastice
Copy link

jastice commented Mar 6, 2017

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

@dwijnand
Copy link
Member Author

dwijnand commented Mar 6, 2017

It seems the compile task gets the contraband source files via the output of the sourceGenerators.

Could you show me (or explain to me) how that comes to be true?

@jastice
Copy link

jastice commented Mar 6, 2017

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

@dwijnand
Copy link
Member Author

dwijnand commented Mar 6, 2017

protocolProj/compile:managedSources -> protocolProj/compile:sourceGenerators

ah-ha. Thank you.

@dwijnand
Copy link
Member Author

dwijnand commented Mar 6, 2017

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.

@jvican
Copy link
Member

jvican commented Mar 30, 2017

It would be interesting to fix this in the close future in the spirit of getting more contributors to 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
uncategorized Used for Waffle integration
Projects
None yet
Development

No branches or pull requests

4 participants