@
imzhoukunqiang C:\Users\yourUserName\.gradle\init.gradle
ext {
buildRamdiskDir = null
}
static String getRamdiskDir() {
return "R:/"
}
allprojects {
repositories {
maven {url "
http://maven.aliyun.com/nexus/content/groups/public/"}
}
if (buildRamdiskDir == null) {
buildRamdiskDir = getRamdiskDir()
if (buildRamdiskDir == null) {
buildRamdiskDir = "";
}
System.err.println("Build Ramdisk: " + buildRamdiskDir)
}
if (buildRamdiskDir != null && buildRamdiskDir.length() > 0) {
buildDir = "${buildRamdiskDir}/build/${
rootProject.name}/${
project.name}"
}
tasks.withType(JavaCompile) {
// 忽略 gradle 的编译警告
options.compilerArgs << '-Xlint:none'
//在单独的守护进程中启用编译
options.fork = true
// 增量
options.incremental = true
options.encoding = "UTF-8"
}
}
我配置了全局 gradle 配置, 启用增量编译, 守护进程, ramdisk
你看着改.
还有, 尽量用高版本的 gradle 和高版本 jvm. 至少 gradle 不能低于 4.10