【发布时间】:2018-10-19 02:15:00
【问题描述】:
我已配置buildCache {} 部分启用远程缓存,但日志显示
已启用任务输出缓存,但未配置或启用构建缓存
我错过了什么?
【问题讨论】:
-
您能否从您的构建文件中添加提取物,以便我们有机会查看可能出现的问题?
标签: gradle gradle-plugin gradle-cache
我已配置buildCache {} 部分启用远程缓存,但日志显示
已启用任务输出缓存,但未配置或启用构建缓存
我错过了什么?
【问题讨论】:
标签: gradle gradle-plugin gradle-cache
在启用构建缓存但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
到您的命令行应该足以让构建缓存正常工作。
【讨论】: