Looking to buy a vowel: ```task cmakeGenericLinuxR...
# community-support
m
Looking to buy a vowel:
Copy code
task cmakeGenericLinuxRelease(type:Exec) {
	workingDir = "${projectDir}"
	if (cArch.contains("aarch64")) {
		environment("CXXFLAGS","-fPIC")
	} else {
		environment("CXXFLAGS","-fPIC -march=westmere")
	}
	commandLine 'cmake', "-CStardogCache.txt", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_LIBDIR=lib/main/release", "-B", "$projectDir", "-S", "$projectDir"
			//	dependsOn unZipSource

	inputs.file("$projectDir/AUTHORS")
	outputs.dir("$projectDir/CMakeFiles")

	if (0) {
	dependsOn ':lz4:assemble'
	dependsOn ':snappy:assemble'
	dependsOn ':zlib:assemble'
				} else {
	dependsOn ':libs:lz4:assemble'
	dependsOn ':libs:snappy:assemble'
	dependsOn ':libs:zlib:assemble'
	}
}
The above task does not execute, gradle says "UP-TO-DATE". But the output directory "$projectDir/CMakeFiles" does not exist. I have intentionally left all the debug cruft in the task in case that inspires/contributes to an answer.
v
The only input you define is the
AUTHORS
file. So as long as that does not change and the outputs since the last successful execution did not change, the task is up to date.
m
So removal of the output directory is not sufficient?
v
If the was anything in it after the last successful execution it should be sufficient. If either inputs or outputs changed, task will be reexecuted (unless the up to date state has some bug which occasionally happens)
m
• "touch AUTHORS" was not sufficient, but "echo bob >AUTHORS" worked • After the above, I removed the CMakeFiles directory and task executed as expected. Guessing I somehow got gradle's state of that directory screwed up during other changes Thank you for the assist.
šŸ‘Œ 1
v
Touch of course does not change anything, that does not change the files content. In almost all cases the modify timestamp is irrelevant for the outcome. And if you for example switch branches in a VCS, files' modify dates would change but their content not and thus being out of date would be a bad thing. In the very rare cases where a modification date is relevant for the outcome, it would need to be added as additional input separately.