svn commit: r1865396 - in /ofbiz/branches/release16.11: gradle/init-gradle-wrapper.ps1 gradle/init-gradle-wrapper.sh init-gradle-wrapper.bat

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1865396 - in /ofbiz/branches/release16.11: gradle/init-gradle-wrapper.ps1 gradle/init-gradle-wrapper.sh init-gradle-wrapper.bat

jleroux@apache.org
Author: jleroux
Date: Sun Aug 18 15:06:37 2019
New Revision: 1865396

URL: http://svn.apache.org/viewvc?rev=1865396&view=rev
Log:
Implemented: Remove the Gradle wrapper from our release packages and add a step
to our build notes
(OFBIZ-10145)

As discussed on dev ML we will use the init-gradle-wrapper script also in R16.11
Here are the files, not tested and missing the file in Bintray

Added:
    ofbiz/branches/release16.11/gradle/init-gradle-wrapper.ps1
    ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh   (with props)
    ofbiz/branches/release16.11/init-gradle-wrapper.bat   (with props)

Added: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.ps1
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/gradle/init-gradle-wrapper.ps1?rev=1865396&view=auto
==============================================================================
--- ofbiz/branches/release16.11/gradle/init-gradle-wrapper.ps1 (added)
+++ ofbiz/branches/release16.11/gradle/init-gradle-wrapper.ps1 Sun Aug 18 15:06:37 2019
@@ -0,0 +1,28 @@
+# 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\wrapper\gradle-wrapper.jar")) -and (Test-Path -Path ((Get-Item -Path ".\").FullName + "\gradle\wrapper\gradle-wrapper.properties"))) {
+    Write-Host "The Gradle Wrapper has been already downloaded.";
+    exit
+}
+
+# This uses PowerShell Invoke-WebRequest command (aliased as wget here)
+# HTTPS is not used because it gets complicated with Powershell and .Net framework versions depending on Windows versions
+# Anyway I believe this should be only used in dev environment
+wget -outf gradle\wrapper\gradle-wrapper.jar http://dl.bintray.com/apacheofbiz/GradleWrapper/v2.13/gradle-wrapper.jar
+wget -outf gradle\wrapper\gradle-wrapper.properties http://dl.bintray.com/apacheofbiz/GradleWrapper/v2.13/gradle-wrapper.properties
+

Added: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh?rev=1865396&view=auto
==============================================================================
--- ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh (added)
+++ ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh Sun Aug 18 15:06:37 2019
@@ -0,0 +1,99 @@
+#!/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.
+
+# Variable for location
+OFBIZ_HOME="$(pwd)"
+GRADLE_OFBIZ_PATH="$OFBIZ_HOME/gradle"
+GRADLE_WRAPPER_OFBIZ_PATH="$GRADLE_OFBIZ_PATH/wrapper"
+
+# version and uri to download the wrapper
+RELEASE="2.13"
+GRADLE_WRAPPER_URI="https://dl.bintray.com/apacheofbiz/GradleWrapper/v$RELEASE/"
+GRADLE_WRAPPER_URI_BACKUP="https://github.com/gradle/gradle/raw/v$RELEASE/gradle/wrapper/"
+
+# Embded checksum shasum to control the download
+SHASUM_GRADLE_WRAPPER_FILES="12478d9829998a5433231ad971bae52978279a3d  gradle/wrapper/gradle-wrapper.jar
+05d4ab69d3f2143e017710b0917b740f75a75c07  gradle/wrapper/gradle-wrapper.properties"
+
+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 /
+}
+
+# Resolve the command to use for calling and realize the download
+downloadFile() {
+   if [ -n "$(whereIsBinary curl)" ]; then
+       GET_CMD="curl -L -o $GRADLE_WRAPPER_OFBIZ_PATH/$1 -s -w %{http_code} $2/$1";
+       if [ "$($GET_CMD)" = "200" ]; then
+           return 0;
+       fi
+   elif [ -n "$(whereIsBinary wget)" ]; then
+       GET_CMD="wget -q -O $GRADLE_WRAPPER_OFBIZ_PATH/$1 --server-response $2/$1";
+       GET_CMD="$GET_CMD"' 2>&1 > /dev/null | grep "HTTP/.* 200"';
+       if [ -n "$($GET_CMD)" ]; then
+           return 0;
+       fi
+   fi
+   return 1
+}
+
+# Call and if not succes try to use backup
+resolveFile() {
+   downloadFile $1 $GRADLE_WRAPPER_URI;
+   if [ $? -eq 1 ]; then
+       downloadFile $1 $GRADLE_WRAPPER_URI_BACKUP;
+   fi
+}
+
+echo " === Prepare operation ===";
+# Control that we work the script on a good directory
+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
+
+# check if we have on binary to download missing wrapper
+if [ -z "$(whereIsBinary curl)" ] && [ -z "$(whereIsBinary wget)" ]; then
+   echo "No command curl or wget found, please install one or install yourself gradle (more information see README.adoc or https://gradle.org/install)";
+   exit 1
+fi
+
+if [ ! -r "$GRADLE_WRAPPER_OFBIZ_PATH/$GRADLE_WRAPPER_JAR" ]; then
+    echo "$GRADLE_WRAPPER_OFBIZ_PATH/$GRADLE_WRAPPER_JAR not found, we download it"
+
+    for fileToDownload in $GRADLE_WRAPPER_FILES; do
+         echo " === Download $fileToDownload ===";
+         resolveFile $fileToDownload
+    done
+    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
+    echo " === Control downloaded files ==="
+    if [ -n "$(whereIsBinary shasum)" ]; then
+        echo "$SHASUM_GRADLE_WRAPPER_FILES" | shasum -c -;
+        exit 0;
+    fi
+
+    echo " Warning: shasum not found, skip the control process"
+    exit 1;
+fi
+echo " Nothing todo"

Propchange: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/branches/release16.11/gradle/init-gradle-wrapper.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/branches/release16.11/init-gradle-wrapper.bat
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/init-gradle-wrapper.bat?rev=1865396&view=auto
==============================================================================
--- ofbiz/branches/release16.11/init-gradle-wrapper.bat (added)
+++ ofbiz/branches/release16.11/init-gradle-wrapper.bat Sun Aug 18 15:06:37 2019
@@ -0,0 +1,23 @@
+@echo off
+rem #####################################################################
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements.  See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership.  The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License.  You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied.  See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem #####################################################################
+rem interactive DOS version of mergefromtrunk.sh.
+rem to use : launch and pass the trunk version number to merge in release
+
+Powershell.exe -executionpolicy remotesigned -File  gradle\init-gradle-wrapper.ps1
\ No newline at end of file

Propchange: ofbiz/branches/release16.11/init-gradle-wrapper.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/branches/release16.11/init-gradle-wrapper.bat
------------------------------------------------------------------------------
    svn:executable = *

Propchange: ofbiz/branches/release16.11/init-gradle-wrapper.bat
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/branches/release16.11/init-gradle-wrapper.bat
------------------------------------------------------------------------------
    svn:mime-type = text/plain