This message was deleted.
# plugin-development
s
This message was deleted.
g
Don't know about the first question. Answering the second one, you can turn off caching and up-to-date checking like this
Copy code
tasks.named("thatTask") {
  outputs.cacheIf { false }
  outputs.upToDateWhen { false }
}
m
I would only turn off build cache, so that would be the first I guess? I saw that, but the documentation on that wasnt really clear if it means both, but since there is the second one, I assume so, ill take a look, thank you another thing somebody elsewhere suggested was zipping out the output
v
What kind of task is it? By default a task is not cacheable, only if you explicitly mark it as cacheable. To just disable the cachability of an otherwise cachable task, you can use
cacheIf
, yes. But the question is, whether really only cache is affected. If you run the task, then delete something in the
.git
directory and run the task again, is it up-to-date, it rerun properly? If it is up-to-date, you might also need to disable up-to-date checks, but not with the
upToDateWhen
@Gabriel Feo mentioned. That is an abuse with drawbacks that was needed as work-around in older times. Nowadays your would use
doNotTrackState()
or
@UntrackedTask
. That would also disable both, up-to-date checking and caching.
Btw. have a look at Example 27 at https://docs.gradle.org/current/userguide/working_with_files.html#sec:file_trees, that shows how to make
.git
for example not ignored by default