You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2024/01/06 11:01:16 UTC

(ofbiz-framework) branch release22.01 updated: Improved: Replace SvnCheckout in Gradle (OFBIZ-12868)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release22.01
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release22.01 by this push:
     new ef90eccbed Improved: Replace SvnCheckout in Gradle (OFBIZ-12868)
ef90eccbed is described below

commit ef90eccbed6dc110b969bfe09f5c084ed146527f
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Sat Jan 6 10:27:15 2024 +0100

    Improved: Replace SvnCheckout in Gradle (OFBIZ-12868)
    
    As suggested by Daniel, use "git clone --depth 1" and "--branch $branch"
    everywhere
---
 pullAllPluginsSource.bat | 17 ++++++++---------
 pullAllPluginsSource.sh  | 16 ++++++----------
 pullPluginSource.bat     | 27 ++++++++++++---------------
 pullPluginSource.sh      | 18 +++++-------------
 4 files changed, 31 insertions(+), 47 deletions(-)

diff --git a/pullAllPluginsSource.bat b/pullAllPluginsSource.bat
index b14f8d7a7e..d10f5757b8 100644
--- a/pullAllPluginsSource.bat
+++ b/pullAllPluginsSource.bat
@@ -18,22 +18,21 @@ rem specific language governing permissions and limitations
 rem under the License.
 rem #####################################################################
 
+rem Syntax: pullAllPluginsSource
+
 rem Whatever, create anew
 if EXIST plugins\ (
     cmd /c rd  /s/q plugins
 )
+
+rem Get the branch used in framework
 git branch --show-current > temp.txt
 set /p branch=<temp.txt
 del temp.txt
 
-git clone https://github.com/apache/ofbiz-plugins.git plugins
-cd plugins
-
-rem By default the clone branch is trunk
-if NOT trunk == %branch% (
-    call git switch -c %branch% --track origin/%branch%
-)
+git clone --depth 1 --single-branch --branch %branch% https://github.com/apache/ofbiz-plugins.git plugins
 
-rem Remove .git, in this case it's big useless information
-cmd /c rd  /s/q .git
+rem Remove .git, in this case it's useless information
+cd plugins
+cmd /c rd /s/q .git
 cd ..
diff --git a/pullAllPluginsSource.sh b/pullAllPluginsSource.sh
index 42bf8d27aa..c53d60db39 100755
--- a/pullAllPluginsSource.sh
+++ b/pullAllPluginsSource.sh
@@ -16,24 +16,20 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Syntax: ./pullAllPluginsSource.sh
+
 # Whatever, create anew
 if [ -d "plugins" ]
     then
         rm -rf plugins
 fi
 
-# Get the branch used by the framework
+# Get the branch used in framework
 branch=$(git branch --show-current)
 
-git clone https://github.com/apache/ofbiz-plugins.git plugins
-cd plugins
-
-# By default the clone branch is trunk
-if [ ! $branch = trunk ]
-    then
-        git switch "$branch"
-fi
+git clone --depth 1 --single-branch --branch $branch https://github.com/apache/ofbiz-plugins.git plugins
 
-# remove .git, in this case it's big useless information
+# remove .git, in this case it's useless information
+cd plugins
 rm -rf .git
 cd ..
diff --git a/pullPluginSource.bat b/pullPluginSource.bat
index c11ebcce0f..d351101f38 100644
--- a/pullPluginSource.bat
+++ b/pullPluginSource.bat
@@ -18,31 +18,28 @@ rem specific language governing permissions and limitations
 rem under the License.
 rem #####################################################################
 
+rem Syntax: eg pullPluginSource bi
+
 rem Remove plugins dir in case of all plugins present (no .git)
 if EXIST plugins\ (
     if NOT EXIST plugins\.git\ (
         cmd /c rd/s/q plugins
     )
 )
-rem Clone and set if new else simply add
-if NOT EXIST plugins\.git\ (
-        git clone --depth=1 --sparse https://github.com/apache/ofbiz-plugins.git plugins
-        cd plugins
-        git sparse-checkout set %1
-) else (
-    cd plugins
-    git sparse-checkout add %1
-)
 
 rem Get the branch used in framework
-cd ..
 git branch --show-current > temp.txt
 set /p branch=<temp.txt
 del temp.txt
 
-rem By default the cloned branch is trunk, switch if necessary
-if NOT trunk == %branch% (
-        cd plugins
-        git switch -C %branch%
-        cd ..
+rem Clone and set if new else simply add
+if NOT EXIST plugins\.git\ (
+    git clone --depth 1 --sparse --single-branch --branch %branch% https://github.com/apache/ofbiz-plugins.git plugins
+    cd plugins
+    git sparse-checkout set %1
+) else (
+    cd plugins
+    git sparse-checkout add %1
 )
+
+cd ..
\ No newline at end of file
diff --git a/pullPluginSource.sh b/pullPluginSource.sh
index ec306da844..a34d594a41 100755
--- a/pullPluginSource.sh
+++ b/pullPluginSource.sh
@@ -16,6 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Syntax: eg ./pullPluginSource.sh bi
 
 # Remove plugins dir in case of all plugins present (no .git)
 if [ -d "plugins" ]
@@ -26,10 +27,13 @@ if [ -d "plugins" ]
         fi
 fi
 
+# Get the branch used in framework
+branch=$(git branch --show-current)
+
 # Clone and set if new else simply add
 if [ ! -d "plugins/.git" ]
     then
-        git clone --depth=1 --sparse https://github.com/apache/ofbiz-plugins.git plugins
+        git clone --depth 1 --sparse --single-branch --branch $branch https://github.com/apache/ofbiz-plugins.git plugins
         cd plugins
         git sparse-checkout set "$1"
 else
@@ -37,17 +41,5 @@ else
     git sparse-checkout add "$1"
 fi
 
-
-# Get the branch used in framework
 cd ..
-git branch --show-current > temp.txt
-branch=$(cat temp.txt)
-rm temp.txt
 
-# By default the cloned branch is trunk, switch if necessary
-if [ ! "$branch" = trunk ]
-    then
-        cd plugins
-        git switch -C "$branch"
-        cd ..
-fi