steps
add to build.sbt:
lazy val testTask = taskKey[Unit]("test task")
lazy val otherTask = taskKey[Unit]("dummy task")
otherTask / testTask / fileInputs := Seq(
Glob(file("src").getAbsoluteFile, RelativeGlob.**)
)
otherTask / testTask := {
if ((otherTask / testTask).inputFileChanges.hasChanges) {
println("CHANGED")
} else println("NOT CHANGED")
}
in the sbt console run > otherTask / testTask, change a file in src, and run > otherTask / testTask, and > otherTask / testTask again.
The output will be NOT CHANGED in all three cases
problem
fileInputs does not seem to track file changes within the scope of otherTask.
expectation
We should see CHANGED, CHANGED, NOT CHANGED
notes