Skip to content

inputFileChanges cannot be scoped to a task scoped to another task #7489

@johnhungerford

Description

@johnhungerford

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions