From bbe1301d6379453988ccc65773484ec9c3a009f3 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 1 Nov 2012 11:04:58 +0100 Subject: [PATCH] Remove -XX:MaxHeapSize=256m from default GRADLE_OPTS This setting was causing failures in the CI build, and was not present prior to the recent updates to gradle wrapper generation. This commit also simplifies the gradle wrapper customizations by placing the logic in a doLast block within the original 'wrapper' task, as to creating a second wrapper task and extending from the first. --- build.gradle | 20 ++++++++++---------- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- gradlew.bat | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index b4c57a609f9f..0ba74eaf88f9 100644 --- a/build.gradle +++ b/build.gradle @@ -802,15 +802,15 @@ configure(rootProject) { task wrapper(type: Wrapper) { description = 'Generates gradlew[.bat] scripts' gradleVersion = '1.2' - } -} -def defaultWrapper = tasks["wrapper"] -task wrapper(overwrite: true, dependsOn: defaultWrapper) << { - def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m -XX:MaxHeapSize=256m" - File wrapperFile = file('gradlew') - wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=", "GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=") - File wrapperBatFile = file('gradlew.bat') - wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=", "set GRADLE_OPTS=$gradleOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=") + doLast() { + def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m" + File wrapperFile = file('gradlew') + wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=", + "GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=") + File wrapperBatFile = file('gradlew.bat') + wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=", + "set GRADLE_OPTS=$gradleOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=") + } + } } - diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7a4bcc298e54..6c76938a4226 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Wed Oct 31 17:27:34 PDT 2012 +#Thu Nov 01 11:02:41 CET 2012 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index d73b83250eee..9e5a6688231e 100755 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ ############################################################################## # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -GRADLE_OPTS="-XX:MaxPermSize=1024m -Xmx1024m -XX:MaxHeapSize=256m $GRADLE_OPTS" +GRADLE_OPTS="-XX:MaxPermSize=1024m -Xmx1024m $GRADLE_OPTS" DEFAULT_JVM_OPTS="" APP_NAME="Gradle" diff --git a/gradlew.bat b/gradlew.bat index e05bf9133f8f..bd5d33bbcdd0 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -9,7 +9,7 @@ if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set GRADLE_OPTS=-XX:MaxPermSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS% +set GRADLE_OPTS=-XX:MaxPermSize=1024m -Xmx1024m %GRADLE_OPTS% set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0