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.
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))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With