Skip to content

Commit

Permalink
Improved: Remove the Gradle wrapper from our release packages and add…
Browse files Browse the repository at this point in the history
… a step to

our build notes
(OFBIZ-10145)

Applies the last waiting gradlew.bat.patch in OFBIZ-10145 
Fixes a trivial issue in Mathieu last commits: repeated "-Xms64m" in gradlew 
scripts.
Uses HTTP in init-gradle-wrapper.ps1 instead of HTTP. Not everyone has an HTTPS 
access to the tools repo.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862353 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
JacquesLeRoux committed Jun 30, 2019
1 parent 9fba501 commit 55a493c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gradle/init-gradle-wrapper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ if (! (Test-Path -Path ((Get-Item -Path ".\").FullName + "\gradle\"))) {

# This uses  PowerShell Invoke-WebRequest command (aliased as wget here)
# https is not used because we don't want users to be asked for a credential (not sure about that, maybe https is OK)
wget -outf gradle\wrapper\gradle-wrapper.jar https://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.jar
wget -outf gradle\wrapper\gradle-wrapper.properties https://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.properties
wget -outf gradle\wrapper\gradle-wrapper.jar http://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.jar
wget -outf gradle\wrapper\gradle-wrapper.properties http://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/gradle-wrapper.properties
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='"-Xmx64m"
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
12 changes: 4 additions & 8 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down Expand Up @@ -78,16 +78,12 @@ set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem check if Gradle is installed
if exist "%CLASSPATH%" goto GradleOK

md %APP_HOME%\gradle\wrapper\
Powershell.exe -executionpolicy remotesigned -File %APP_HOME%\init-gradle-wrapper.ps1
@rem Overwrites the local Gradle Wrapper files from tools repo in all cases (it's only 55kb).
@rem This way we are sure to always use the latest version. At least when an Internet connexion is available.
Powershell.exe -executionpolicy remotesigned -File %APP_HOME%\gradle\init-gradle-wrapper.ps1

:GradleOK
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

Expand Down

0 comments on commit 55a493c

Please sign in to comment.