diff --git a/build.gradle b/build.gradle index cbfbfb8d..105fdbec 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,16 @@ java { sourceCompatibility = 1.8 targetCompatibility = 1.8 +// The Management API client is Fern-generated (~4000 types). javac's type +// inference over that tree exhausts the compiler's default heap. Because the +// Java 8 toolchain differs from the JDK running Gradle, javac is forked into a +// separate process, so org.gradle.jvmargs (the daemon heap) does not apply — +// the heap must be set on the forked compiler here. +tasks.withType(JavaCompile).configureEach { + options.fork = true + options.forkOptions.memoryMaximumSize = '2g' +} + jar { manifest { attributes 'Automatic-Module-Name': 'com.auth0.java' diff --git a/gradle.properties b/gradle.properties index cb426bef..724f91f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,7 @@ +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + GROUP=com.auth0 POM_ARTIFACT_ID=auth0 VERSION_NAME=3.0.0