Skip to content

Instantly share code, notes, and snippets.

@runningcode
Last active January 27, 2021 10:07
Show Gist options
  • Save runningcode/eec4426fac6d713db8d82f9128384c27 to your computer and use it in GitHub Desktop.
Save runningcode/eec4426fac6d713db8d82f9128384c27 to your computer and use it in GitHub Desktop.
Tasks not to cache on CI
def tasksToNotCacheOnCi = [
"package.*Resources.*",
"merge.*Resources.*",
"merge.*Assets.*",
"process.*Resources.*",
"package.*Assets.*",
"merge.*NativeLibs",
"generate.*BuildConfig",
"generate.*ResValues",
"generate.*CompatibleScreenManifests",
// GenerateLibraryRFileTask
"generate.*RFile",
"bundle.*Classes",
// Writes annotation processors to a JSON file.
"javaPreCompile.*",
// StripDebugSymbolsTask is quick to run but generates large outputs.
"strip.*DebugSymbols",
"merge.*JavaResource",
// BundleLibraryClasses
"bundle.*ToJar.*"
]
allprojects {
afterEvaluate {
tasks.matching {
task -> tasksToNotCacheOnCi.any { task.name ==~ it }
}.configureEach {
// Only disable caching on CI environments so that the results are not stored in the remote build cache.
outputs.cacheIf { !isCi }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment