Comments (8)
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.
from contraband.
/cc @jastice
from contraband.
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
from contraband.
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?
from contraband.
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
from contraband.
protocolProj/compile:managedSources
->protocolProj/compile:sourceGenerators
ah-ha. Thank you.
from contraband.
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.
from contraband.
It would be interesting to fix this in the close future in the spirit of getting more contributors to 1.0.
from contraband.
Related Issues (20)
- Generated code causes compiler warnings HOT 1
- Generate Shapeless Generic instances HOT 5
- Can't define singleton types
- maven plugin
- equal / hashCode inconsistencies around Array HOT 1
- always use \n for line breaks HOT 5
- Is it possible to define a Map within a type? HOT 1
- Incorrect Scaladoc
- Allow modifier to be changed from final class to sealed class
- use "boxed type".hashCode(value) instead of "boxed type".valueOf(value).hashCode() HOT 1
- Identifier conflict on "js" field when generating JSON codec with sjson new
- gh-pages could use a publish HOT 1
- +generateContrabands doesn't work with crossScalaVersions HOT 2
- Does Contraband Generated No-Arg Constructors for Java POJOs HOT 3
- Cannot resolve symbol ScalaKeywords
- Some generated code does not compile with -Xfatal-warnings
- Allow sealed interface
- Travis CI dropped
- self type specification is not enough for Scala 3
- remove lightbend-cla-validator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contraband.