一下配置增量变异从1min多缩小到30-40s
gradle.properties:
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 -XX:+UseG1GC
kotlin.daemon.jvm.options=-Xmx4g -XX:+UseG1GC
android.useAndroidX=true
android.enableJetifier=true
android.injected.testOnly=false
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
kotlin.incremental=true
kotlin.incremental.java=true
kotlin.incremental.js=true
kotlin.caching.enabled=true
kotlin.parallel.tasks.in.project=true
kapt.use.worker.api=true
kapt.incremental.apt=true
kapt.include.compile.classpath=false
注意
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
这两个参数是实验性质的api,可能会和某些插件发生冲突导致编译失败,则情启用。