我已经配置了buildCache {}
部分并启用了远程缓存,但是日志显示
Task output caching is enabled, but no build caches are configured or enabled
我想念什么?
最佳答案
当启用了构建缓存但为both the local and remote caches are disabled时,将记录此警告。
您是否无意中以某种方式禁用了它们,例如通过某些isCiServer
逻辑无法按预期工作?您可以共享buildCache配置吗?
将以下内容添加到settings.gradle中(使用适合您的缓存实例的url):
ext.isCiServer = System.getenv().containsKey("CI")
buildCache {
local {
enabled = !isCiServer
}
remote(HttpBuildCache) {
url = 'https://example.com:8123/cache/'
push = isCiServer
}
}
并添加
org.gradle.caching=true
到您的
gradle.properties
,或--build-cache
命令行应该足以使构建缓存正常工作。
关于gradle - 任务输出缓存已启用,但未配置或启用任何构建缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50245273/