diff options
author | Eric Bailey <git@esb.lol> | 2025-03-06 22:21:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-06 20:21:54 -0800 |
commit | 27ae829698eed3d73faaba5d9144f06452d8ada2 (patch) | |
tree | 4da229f5a4d18769213a8a2023df3aa94723a60a | |
parent | ada2ac8b9169c5ebc4dbb1ce6a24a0accea39557 (diff) | |
download | voidsky-27ae829698eed3d73faaba5d9144f06452d8ada2.tar.zst |
Add plugin to bump gradle jvm heap size (#7922)
-rw-r--r-- | app.config.js | 1 | ||||
-rw-r--r-- | plugins/withGradleJVMHeapSizeIncrease.js | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/app.config.js b/app.config.js index 97e416f03..9539292ff 100644 --- a/app.config.js +++ b/app.config.js @@ -240,6 +240,7 @@ module.exports = function (config) { }, ], './plugins/starterPackAppClipExtension/withStarterPackAppClip.js', + './plugins/withGradleJVMHeapSizeIncrease.js', './plugins/withAndroidManifestPlugin.js', './plugins/withAndroidManifestFCMIconPlugin.js', './plugins/withAndroidStylesAccentColorPlugin.js', diff --git a/plugins/withGradleJVMHeapSizeIncrease.js b/plugins/withGradleJVMHeapSizeIncrease.js new file mode 100644 index 000000000..690b8ee75 --- /dev/null +++ b/plugins/withGradleJVMHeapSizeIncrease.js @@ -0,0 +1,34 @@ +const {withGradleProperties} = require('expo/config-plugins') + +function setGradlePropertiesValue(config, key, value) { + return withGradleProperties(config, exportedConfig => { + const keyIdx = exportedConfig.modResults.findIndex( + item => item.type === 'property' && item.key === key, + ) + if (keyIdx >= 0) { + exportedConfig.modResults.splice(keyIdx, 1, { + type: 'property', + key, + value, + }) + } else { + exportedConfig.modResults.push({ + type: 'property', + key, + value, + }) + } + + return exportedConfig + }) +} + +module.exports = function withGradleJVMHeapSizeIncrease(config) { + config = setGradlePropertiesValue( + config, + 'org.gradle.jvmargs', + '-Xmx4096m -XX:MaxMetaspaceSize=1024m', //Set data of your choice + ) + + return config +} |