From d8046cba27f78ecd05f282e1b50c523610032d2c Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Mon, 8 Jul 2019 13:10:42 +0000 Subject: [PATCH] Reverted: Remove the Gradle wrapper from our release packages and add a step to our build notes (OFBIZ-10145) As discussed in dev ML and OFBIZ-11133, reverts all commits done for OFBIZ-10145: r1862356, r1862354, r1862353, r1861783, r1861766 But keeps in README.doc the added line in r1861766: ==== Clean system and load the complete OFBiz data I'm uncertain about what will happen with the gradle/wrapper directory and the wrapper version there (currently 5.5 and in between these commits). But anyway not a big deal to get it back git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862745 13f79535-47bb-0310-9956-ffa450edef68 --- .gitignore | 1 - .hgignore | 1 - README.adoc | 13 ------- gradle/init-gradle-wrapper.ps1 | 26 -------------- gradle/init-gradle-wrapper.sh | 62 ---------------------------------- gradlew | 7 ---- gradlew.bat | 5 +-- 7 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 gradle/init-gradle-wrapper.ps1 delete mode 100755 gradle/init-gradle-wrapper.sh diff --git a/.gitignore b/.gitignore index f8faa2cc95..6c8252f18a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ bin/ build/ applications/*/build framework/*/build -gradle/wrapper plugins/ runtime/git-rebase/* runtime/SvnInfo.ftl diff --git a/.hgignore b/.hgignore index 2783e46fbd..39d5b52d9d 100644 --- a/.hgignore +++ b/.hgignore @@ -1,6 +1,5 @@ syntax: regexp ^(framework|applications|plugins)/[^/]+/build/.*$ -^gradle/wrapper/.*$ ^ofbiz\.jar$ ^runtime/data/derby/.*$ ^runtime/logs/.*(log|html)(|.\d+)$ diff --git a/README.adoc b/README.adoc index 7b87554d2d..4f990a27b4 100644 --- a/README.adoc +++ b/README.adoc @@ -72,19 +72,6 @@ the command line at the OFBiz top level directory (folder). [[prepare-ofbiz]] === Prepare OFBiz: -==== Setting up the Gradle Wrapper - -*Unix-like OS*: ensure that your system have `curl` or `wget` and run `./gradlew` - -*MS Windows*: run `gradlew` - -if some inconveniences appear please remove `OFBiz-root/gradle/wrapper` directory and run again. - -*Manual setting* - -* Get to https://github.com/gradle/gradle/blob/v5.0.0/gradle/wrapper, gradle-wrapper.jar and gradle-wrapper.properties -* Copy both files in your OFBiz-root\gradle\wrapper directory, that's it. - ==== Clean system and load the complete OFBiz data _________________________________________________________________________________________________________________________________________________________________________________________________________________ _Note_: Depending on your Internet connection speed it might take a long time diff --git a/gradle/init-gradle-wrapper.ps1 b/gradle/init-gradle-wrapper.ps1 deleted file mode 100644 index 2a8c7a7e31..0000000000 --- a/gradle/init-gradle-wrapper.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -if (! (Test-Path -Path ((Get-Item -Path ".\").FullName + "\gradle\"))) { - Write-Host "Location seems to be incorrect, please run the 'sh gradle/init-gradle-wrapper.ps1' script from Apache OFBiz root."; - exit -} - -# 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 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 diff --git a/gradle/init-gradle-wrapper.sh b/gradle/init-gradle-wrapper.sh deleted file mode 100755 index ae2e9b015b..0000000000 --- a/gradle/init-gradle-wrapper.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -OFBIZ_HOME="$(pwd)" -GRADLE_OFBIZ_PATH="$OFBIZ_HOME/gradle" -GRADLE_WRAPPER_OFBIZ_PATH="$GRADLE_OFBIZ_PATH/wrapper" -RELEASE="5.5.0" -#GRADLE_WRAPPER_URI="https://github.com/gradle/gradle/blob/v${RELEASE}/gradle/wrapper" -GRADLE_WRAPPER_URI="https://svn.apache.org/repos/asf/ofbiz/tools/Buildbot/Gradle/Wrapper/trunk/" -GRADLE_WRAPPER_JAR="gradle-wrapper.jar" -GRADLE_WRAPPER_PROPERTIES="gradle-wrapper.properties" -GRADLE_WRAPPER_FILES="$GRADLE_WRAPPER_JAR $GRADLE_WRAPPER_PROPERTIES" - -whereIsBinary() { - whereis $1 | grep / -} - -if [ ! -d "$GRADLE_OFBIZ_PATH" ]; then - echo "Location seems to be uncorrected, please take care to run 'sh gradle/init-gradle-wrapper.sh' at the Apache OFBiz home"; - exit -1; -fi - -if [ ! -d "$GRADLE_WRAPPER_OFBIZ_PATH" ]; then - mkdir $GRADLE_WRAPPER_OFBIZ_PATH -fi - -if [ ! -r "$GRADLE_WRAPPER_OFBIZ_PATH/$GRADLE_WRAPPER_JAR" ]; then - echo "$GRADLE_WRAPPER_OFBIZ_PATH/$GRADLE_WRAPPER_JAR not found, we download it" - - if [ ! -r "$GRADLE_ZIP_RELEASE" ]; then - if [ -n "$(whereIsBinary curl)" ]; then - GET_CMD="curl -L -o"; - elif [ -n "$(whereIsBinary wget)" ]; then - GET_CMD="wget -O"; - else - echo "No command curl or wget found, please install one or install yourself gradle (more information see https://gradle.org/install)"; - exit -1 - fi - for fileToDownload in $GRADLE_WRAPPER_FILES; do - $GET_CMD $GRADLE_WRAPPER_OFBIZ_PATH/$fileToDownload $GRADLE_WRAPPER_URI/$fileToDownload?raw=true; - done - fi - if [ ! $? -eq 0 ]; then - rm -f $GRADLE_WRAPPER_OFBIZ_PATH/* - echo "\nDownload files $GRADLE_WRAPPER_FILES from $GRADLE_WRAPPER_URI failed.\nPlease check the log to found the reason and run the script again." - fi -fi diff --git a/gradlew b/gradlew index 4a8936e68c..8e25e6c19d 100755 --- a/gradlew +++ b/gradlew @@ -1,11 +1,4 @@ #!/usr/bin/env sh -##################################################################### -# Apache OFBiz part -# if the gradle-wrapper.jar isn't present, call init to download it -##################################################################### -if [ ! -r ./gradle/wrapper/gradle-wrapper.jar ]; then - sh ./gradle/init-gradle-wrapper.sh -fi # # Copyright 2015 the original author or authors. diff --git a/gradlew.bat b/gradlew.bat index 7b9d054d3a..9618d8d960 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -78,11 +78,8 @@ set CMD_LINE_ARGS=%* :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar -@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 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @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%