Stop invoking bitrise cache for tasks
Gradle task.
#62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was poking around at the cache utilization diagnostics where I work and noticed a rather interesting trend: approximately 25% of our cache invocations were for
tasks --all
, a gradle task that the diagnostics report is not cacheable because it takes the entire project state as an input:We don't directly invoke the
tasks
task in any of our workflows, so I started tracing it down and found that it was mostly called by the Android lint and unit test Bitrise steps. Those steps in turn make use of theGetVariants
function defined in this repository, which appears to be wheretasks --all
is invoked.Passing the
--no-build-cache
flag to Gradle at execution time should disable the build cache for thetasks
task and fix the problem. There may be a slight risk that this increases build times for customers with significantly complexbuildSrc
or included build logic, but in testing with a local cache in our project I couldn't figure out a way to cause those tasks to come from the cache anyways.This may also might not be the only solution, there'd be several efficient ways to do this with a custom Gradle plugin, this is just what appeared to me to be the simplest solution given my lack of experience with the step framework