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
addPlugins does not work when used in a build.sbt file located in a subdirectory #1299
Comments
This is a fundamental limitation in our loading system right now. We do not merge "instances of the project class" so the first one we see wins, in this case the one defined in root/build.sbt. The current workaround is to define the addPlugins in that build.sbt file. |
Also, sbt should be detecting this. Which version of sbt are you using? In 0.13.5-M4 I see:
|
Oh, also one final thing: WIth sbt-multi-project you need always run from the root directory. Sbt does not support the maven-style mechanism of cd-ing into a subdirectory and building. Internal to the sbt console you can swap the active-project via the |
Yeah, I’m using 0.13.5-M2.
I’d like to! So, by adding the |
So, you should see: #1213 . We plan to resolve this issue and that one at the same time. Basically, inside the lower build.sbt you'll be able to do manipulations to the project object inline, like: enablePlugins(Web)
configs(Foo)
libraryDependencies ++= Seq(...) So, the Project.* methods become available for .sbt files directly and apply to the project located in the same directory as the directory the .sbt file resides. This requires restructuring how sbt loads files so that we can capture these functions and redoing the ordering of loads so we can apply these methods appropriately. Therefore, that work has been delayed until 0.13.6. If you have any concerns/questions, would love to hear them! |
It's implemented, but still needs run through the ringer. Just a note for myself: 52e3e6f |
Oh, also this still doesn't do project merging. we could after this improvement, but I'm not sure that's healthy for us right now until we get rid of some public APIs that shouldn't be public. For now, this just allows |
So i'm going to close this for now. We're not sure we'll ever do the "merge project instances" thing between different .sbt/.scala files, but you should be able to declare the plugins in the sub-.sbt file and just reference the project from the master build.scala/build.sbt. |
I have the following structure:
The
root/build.sbt
file just aggregates the sub projects:And, in both
root/project-a/build.sbt
androot/project-b/build.sbt
I useaddPlugins
:If I run sbt from the
root/
directory the sub-projects are loaded but they behave is if theaddPlugins
were missing.If I run sbt from the
root/project-a/
orroot/project-b/
directory everything works as expected.The text was updated successfully, but these errors were encountered: