Browse files

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.
  • Loading branch information...
1 parent c0baea5 commit bbe1301d6379453988ccc65773484ec9c3a009f3 @cbeams cbeams committed Nov 1, 2012
Showing with 13 additions and 13 deletions.
  1. +10 −10 build.gradle
  2. +1 −1 gradle/wrapper/gradle-wrapper.properties
  3. +1 −1 gradlew
  4. +1 −1 gradlew.bat
View
20 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=")
+ }
+ }
}
-
View
2 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
View
2 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"
View
2 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

2 comments on commit bbe1301

@philwebb
Spring member

@cbeams The --XX:MaxHeapSize setting was added to the Windows build a little while ago [1]. I assumed that it would be harmless in the default build as well.

Nice to see how to run additional code after a task. I searched so much, with no avail, for that info.

[1] 8e7622b#L0L11

@cbeams
Please sign in to comment.