-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
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
inputFileChanges cannot be scoped to a task scoped to another task #7489
Labels
Comments
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")
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: