Shalom Ben-Zvi Kazaz
06/05/2024, 6:46 PMVampire
06/05/2024, 6:56 PMVampire
06/05/2024, 6:58 PMVampire
06/05/2024, 6:58 PMinputs.property(...) for any task for example.Shalom Ben-Zvi Kazaz
06/05/2024, 7:22 PMval compileDotNet = create("compileDotNet") {
outputs.file(digmaDll)
outputs.file(digmaPbd)
dependsOn(prepare)
doLast {
exec {
executable = "dotnet"
args = listOf(
"msbuild",
solutionFile,
"/p:Configuration=$buildConfiguration",
"/t:Restore;Rebuild"
)
workingDir = projectDir
}
}
}Vampire
06/05/2024, 7:30 PMcreate but register to leverage task-configuration avoidance
⢠you can use by creating or by registering to take the name from the variable name instead of duplicating it
⢠explicit dependsOn (except with a lifecycle-task on the left-hand side) is practically always a code-smell, instead you should wire task outputs to task inputs to get the necessary task-dependencies automatically implicitly
⢠why do you not use a task of type Exec instead if all you want to do is exec { ... }?
⢠the project dir should be the default working dir anyway if I'm not completely mistaken
⢠you declare outputs on your task but not any inputs. are there really no inputs to that task? what about solutionFile? or files it then references or compiles or whatever that command does? Each and every file or property that is influencing the outcome of the task must be declared as input, or the up-to-date checks do not work and you could also not safely make the task cacheable but would get semantically corrupted cache entries and false-hits.Shalom Ben-Zvi Kazaz
06/05/2024, 7:35 PMinputs.file(pluginPropsFile)
pluginPropsFile is a file that changed between profiles and it does what i want.
I understand what you mean with inputs and outputs, i will do it.
Thank you!Vampire
06/05/2024, 7:40 PMprepare generates and prepare properly declares it as output, just do inputs.files(tasks.prepare) and remove the manual dependsOn šShalom Ben-Zvi Kazaz
06/05/2024, 8:13 PM