We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.
> otherTask / testTask
src
The output will be NOT CHANGED in all three cases
NOT CHANGED
fileInputs does not seem to track file changes within the scope of otherTask.
fileInputs
otherTask
We should see CHANGED, CHANGED, NOT CHANGED
CHANGED
The text was updated successfully, but these errors were encountered:
As a workaround, it's pretty easy to implement the logic from the macro directly in 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 := { val changes = (otherTask / testTask / changedInputFiles).value val current = (otherTask / testTask / allInputFiles).value val previous = Previous.runtimeInEnclosingTask(otherTask / testTask / inputFileStamps).value val fileChanges = previous.map(changes).getOrElse(FileChanges.noPrevious(current)) if ((otherTask / testTask).inputFileChanges.hasChanges) { println("CHANGED") } else println("NOT CHANGED") }
Sorry, something went wrong.
No branches or pull requests
steps
add to build.sbt:
in the sbt console run
> otherTask / testTask
, change a file insrc
, and run> otherTask / testTask
, and> otherTask / testTask
again.The output will be
NOT CHANGED
in all three casesproblem
fileInputs
does not seem to track file changes within the scope ofotherTask
.expectation
We should see
CHANGED
,CHANGED
,NOT CHANGED
notes
The text was updated successfully, but these errors were encountered: