Last active
January 27, 2021 10:07
-
-
Save runningcode/eec4426fac6d713db8d82f9128384c27 to your computer and use it in GitHub Desktop.
Tasks not to cache on CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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