是什么控制了Intellij IDEA IDE构建/重建如何使用gradle构建缓存和并行选项?
我已经设置了gradle build缓存,如果我通过IDEA runConfiguration运行gradle,我会看到以下内容:
45s clean build --parallel -x test
34s build --parallel -x test
如果我点击锤子来构建或者选择build : rebuild,我会看到2m10s以上的时间。
我是如何启用缓存的
在命令行和通过runConfiguration,速度的提高是极好的。当通过Intellij的锤子构建时,速度要慢得多
gradle.properties
# Enable gradle build cache
org.gradle.caching=true
gradle.cache.push=false
settings.gradle
ext.inJenkins = System.getenv().containsKey("BUILD_NUMBER")
buildCache {
local {
enabled = !inJenkins
}
remote(HttpBuildCache) {
enabled = true
url = "${artifactory_url}/gradlecache-generic-development-local/"
...
push = inJenkins
}
}
发布于 2019-10-15 23:50:14
您可能没有在gradle属性中启用并行性。
添加到gradle.properties
org.gradle.parallel=true
祝你今天愉快
https://stackoverflow.com/questions/58398302
复制相似问题