如何在gradle中使用命令行标志禁用远程生成缓存
我找到了如何在gradle中使用命令行标志禁用远程生成缓存,gradle,Gradle,我找到了--无生成缓存标志,但它禁用了远程和本地缓存 我只需要禁用遥控器。可能吗 buildCacheSettings.gradle buildCache { local { enabled = true } remote(HttpBuildCache) { url = 'http://mycache/cache' } } 没有内置的命令,但您可以自己创建。我对我的一个项目有相同的要求,并这样解决了它: ext.disableRe
--无生成缓存
标志,但它禁用了远程和本地缓存
我只需要禁用遥控器。可能吗
buildCacheSettings.gradle
buildCache {
local {
enabled = true
}
remote(HttpBuildCache) {
url = 'http://mycache/cache'
}
}
没有内置的命令,但您可以自己创建。我对我的一个项目有相同的要求,并这样解决了它:
ext.disableRemoteBuildCache = hasProperty('DISABLE_BUILD_CACHE_REMOTE') || System.getenv().containsKey('DISABLE_BUILD_CACHE_REMOTE')
buildCache {
local(DirectoryBuildCache) {
// ...
}
remote(HttpBuildCache) {
enabled = !disableRemoteBuildCache
// ...
logger.info("Remote build cache configured with enabled: $enabled and url $url")
}
}
然后创建一个名为DISABLE\u BUILD\u CACHE\u REMOTE
的环境变量,或者使用-PDISABLE\u BUILD\u CACHE\u REMOTE
运行