Reputation: 170805
For certain reasons I want to make compilation of a subproject a
require compilation of b
without b
appearing in a
's classpath. Instead, a
classes will be accessed by loading them dynamically (yes, this is generally speaking a bad idea, but it is a requirement). This question was asked before for previous SBT versions, e.g. How to depend on other tasks and do your code in SBT 0.10?.
I've tried
(compile in (a, Compile)) <<= (compile in (b, Compile), compile in (a, Compile)) {
(_, out) => out
}
(based on the above answer) and
(compile in (a, Compile)) := {
(compile in (b, Compile)).value
(compile in (a, Compile)).value
}
Neither appears to work in SBT 0.13.9.
Upvotes: 3
Views: 334
Reputation: 401
You can use dependsOn
operator to override the default compile
behavior in the settings of module a
.
lazy val a = Project(...)
.settings(compile in Compile <<= compile in Compile dependsOn (compile in Compile in b))
Upvotes: 1