Open drhr opened 10 years ago
Update on this: It's not too big of a deal. It really only happens when you update build.sbt
or manually refresh the SBT project associated with your IDEA project. I actually started up another project recently as a desktop application and noticed something very similar - the various Source Roots would get redefined, which would break all the package names in imports in all my source files. Seems like more of an IDEA issue than SBT, but figured somebody has run into this already and perhaps solved it.
that sounds like IDEA issue, try to disable auto-import of changes in IDEA SBT settings
I still don't know how to mark a directory as generated sources root, but I got sbt to mark it as a source root in general, which is good enough for avoiding errors in your IDE. just add this to you build.sbt:
managedSourceDirectories in Compile += baseDirectory.value / "gen"
Sorry if this is the wrong place to ask this, but I wondered if the sbt-idea plugin could somehow solve this problem I'm having.
I have an Android project that I'm importing into IntelliJ with the help of sbt-idea. It uses
android-sdk-plugin
and abuild.sbt
configuration file. The problem is that if you link IntelliJ's SBT up to the project (to automatically refresh the build when you make changes to yourbuild.sbt
configuration), it basically removes the "Generated Sources Root" designation from thegen
directory, which as you might already know is an important source directory that the rest of your Android source code needs in order to identify resources like layouts, images, etc. So every time this SBT refresh happens, I have to right-clickgen
and Mark Directory As "Generated Source Root".I tried adding this line to the end of
build.sbt
:but I think I'm barking up the wrong tree with that one.
Does anyone have any thoughts?