Caleb Cushing
09/26/2025, 12:30 PM.git/config
that I never need to read in the task (it's just for change detection to decide with the task needs to be run
@Input
val gitConfig = project.layout.projectDirectory.dir(".git").file("config")
is right? I don't ever need filename so this feels unintitive in a way.
Also since the task technically mutates it, should it have both input and output on the same property?
basically I want to run git config core.hooksPath .config/git/hooks but only if it hasn't been runVampire
09/26/2025, 12:46 PM@Input on a file input. @InputFile (and probably with path sensitivity relative and normalize line endings too) would be to declare the file as input.Vampire
09/26/2025, 12:48 PMCaleb Cushing
09/26/2025, 12:51 PMExec task? Obviously I never write tasks 😕Caleb Cushing
09/26/2025, 12:52 PMVampire
09/26/2025, 1:15 PMVampire
09/26/2025, 1:15 PMVampire
09/26/2025, 1:17 PMExec and some more, it most often is better to use a custom task that uses ExecOperations#exec in its action and does the additional work before or after that.Caleb Cushing
09/26/2025, 1:24 PMVampire
09/26/2025, 1:25 PMCaleb Cushing
09/26/2025, 1:32 PMCaleb Cushing
09/26/2025, 1:33 PMCaleb Cushing
09/26/2025, 1:33 PMVampire
09/26/2025, 1:34 PMVampire
09/26/2025, 1:35 PMCaleb Cushing
09/26/2025, 1:35 PMCaleb Cushing
09/26/2025, 1:35 PMVampire
09/26/2025, 1:35 PMVampire
09/26/2025, 1:36 PMCaleb Cushing
09/26/2025, 1:36 PMCaleb Cushing
09/26/2025, 1:36 PMCaleb Cushing
09/26/2025, 1:36 PMCaleb Cushing
09/26/2025, 1:37 PMVampire
09/26/2025, 1:37 PMCaleb Cushing
09/26/2025, 1:37 PMCaleb Cushing
09/26/2025, 1:37 PMCaleb Cushing
09/26/2025, 1:38 PMCaleb Cushing
09/26/2025, 1:38 PMCaleb Cushing
09/26/2025, 1:39 PMVampire
09/26/2025, 1:53 PMbecause gradle must already deal with that itselfIt does not have to, source dependencies are still experimental and also not CC-compatible: https://github.com/gradle/gradle/issues/13506 🙂
Vampire
09/26/2025, 1:54 PMwell... last question on this, if the output file changes external to the task, would that invalidate the task?Of course even if you would not have it as task input it should make the task out-of-date iirc, but as you even have it declared as input, external change will definitely make it out-of-date.