Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

793 B
Raw Blame
const { withGradleProperties } = require("expo/config-plugins");

/**
 * Release builds run out of heap while merging dex files with the template's 2 GB default, so give
 * the Gradle daemon more room. Lives here so `expo prebuild` keeps it.
 */
module.exports = function withGradleMemory(
  config,
  { heap = "6g", metaspace = "1g" } = {},
) {
  return withGradleProperties(config, (cfg) => {
    const value = `-Xmx${heap} -XX:MaxMetaspaceSize=${metaspace} -Dfile.encoding=UTF-8`;
    const entry = cfg.modResults.find(
      (item) => item.type === "property" && item.key === "org.gradle.jvmargs",
    );
    if (entry) entry.value = value;
    else
      cfg.modResults.push({
        type: "property",
        key: "org.gradle.jvmargs",
        value,
      });
    return cfg;
  });
};