Config plugin: parallel Gradle with all cores + build cache

Clean arm64 release rebuild drops ~2m40s -> ~1m on 32 threads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 17:57:51 -07:00
parent 08b9579839
commit 0ed7ec0624

View File

@@ -40,6 +40,17 @@ module.exports = function withReleaseSigning(config) {
if (jdk && !cfg.modResults.some((p) => p.key === 'org.gradle.java.home')) {
cfg.modResults.push({ type: 'property', key: 'org.gradle.java.home', value: jdk });
}
/* use every core: parallel module builds + build cache */
const set = (key, value) => {
const hit = cfg.modResults.find((p) => p.key === key);
if (hit) hit.value = value;
else cfg.modResults.push({ type: 'property', key, value });
};
set('org.gradle.parallel', 'true');
set('org.gradle.caching', 'true');
set('org.gradle.configuration-cache', 'false');
set('org.gradle.workers.max', String(os.cpus().length));
set('org.gradle.jvmargs', '-Xmx6g -XX:MaxMetaspaceSize=1g');
return cfg;
});
return withAppBuildGradle(config, (cfg) => {