Reputation: 3064
I want to modify the publish
task and execute it conditionally (0.13.8). Here is what I tried (simplified):
publish := {
Def.taskDyn {
if (true) {
Def.task {
publish.value
}
} else {
Def.task()
}
}.value
}
This fails with the following exception:
[error] (root/*:publish) sbt.Init$RuntimeUndefined: References to undefined settings at runtime.
Any ideas?
Upvotes: 3
Views: 227
Reputation: 8996
Try this:
publish := {
if( true ) {
publish
} else Def.task {
println("something else")
}
}.value
Upvotes: 3