This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch release18.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit c57cf89ffc008c8ef3eae7f9fc2d666fbd560b77 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Sun Dec 31 10:01:06 2023 +0100 Implemented: Replace SvnCheckout in Gradle (OFBIZ-12868) As mentionned in https://lists.apache.org/thread/on7n6nsbj0w237sqgmw7bfmw31116wcy the SvnCheckout Gradle plugin will not be usable after January 8, 2024. This is a replacement using OS scripts. Only for now to test with BuildBot --- pullAllPluginsSource.bat | 39 ++++++++++++++++++++++++++++++++++++ pullAllPluginsSource.sh | 40 +++++++++++++++++++++++++++++++++++++ pullPluginSource.bat | 48 +++++++++++++++++++++++++++++++++++++++++++++ pullPluginSource.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 178 insertions(+) diff --git a/pullAllPluginsSource.bat b/pullAllPluginsSource.bat new file mode 100644 index 0000000000..b14f8d7a7e --- /dev/null +++ b/pullAllPluginsSource.bat @@ -0,0 +1,39 @@ +@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 Whatever, create anew +if EXIST plugins\ ( + cmd /c rd /s/q plugins +) +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% +) + +rem Remove .git, in this case it's big useless information +cmd /c rd /s/q .git +cd .. diff --git a/pullAllPluginsSource.sh b/pullAllPluginsSource.sh new file mode 100644 index 0000000000..eaa5f7e016 --- /dev/null +++ b/pullAllPluginsSource.sh @@ -0,0 +1,40 @@ +#!/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. + +# Whatever, create anew +if [ -d "plugins" ] + then + rm -rf plugins +fi + +git branch --show-current > temp.txt +branch=$(cat temp.txt) +rm temp.txt + +git clone https://github.com/apache/ofbiz-plugins.git plugins +cd plugins + +# By default the clone branch is trunk +if [ ! trunk == "$branch" ] + then + git switch -c "$branch" --track origin/"$branch" +fi + +# remove .git, in this case it's big useless information +rm -rf .git +cd .. diff --git a/pullPluginSource.bat b/pullPluginSource.bat new file mode 100644 index 0000000000..a3d5960157 --- /dev/null +++ b/pullPluginSource.bat @@ -0,0 +1,48 @@ +@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 Remove plugins dir in case of all plugins present +if EXIST plugins\ ( + if NOT EXIST plugins\.git\ ( + cmd /c rd/s/q plugins + ) +) +rem Clone if new else simply init sparse-checkout +if NOT EXIST plugins\.git\ ( + git clone --filter=blob:none --sparse https://github.com/apache/ofbiz-plugins.git plugins + cd plugins +) else ( + cd plugins + rem the documentation says init is deprecated but set does work here: https://git-scm.com/docs/git-sparse-checkout + git sparse-checkout init --cone --sparse-index +) + +rem Add the plugin +git sparse-checkout add %1 + + +git branch --show-current > temp.txt +set /p branch=<temp.txt +del temp.txt +rem By default the clone branch is trunk +if NOT trunk == %branch% ( + call git switch -c %1 --track origin/%1 +) +cd .. diff --git a/pullPluginSource.sh b/pullPluginSource.sh new file mode 100644 index 0000000000..c4de388afd --- /dev/null +++ b/pullPluginSource.sh @@ -0,0 +1,51 @@ +#!/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. + + +# Remove plugins dir in case of all plugins present +if [ -d "plugins" ] + then + if [ ! -d "plugins\.git" ] + then + rm -rf plugins + fi +fi + +# Clone if new else simply init sparse-checkout +if [ ! -d "plugins\.git" ] + then + git clone --filter=blob:none --sparse https://github.com/apache/ofbiz-plugins.git plugins + cd plugins +else + cd plugins + # the documentation says init is deprecated but set does work here: https://git-scm.com/docs/git-sparse-checkout + git sparse-checkout init --cone --sparse-index +fi + +# Add the plugin +git sparse-checkout add "$1" +git branch --show-current > temp.txt +branch=$(cat temp.txt) +rm temp.txt + +# By default the clone branch is trunk +if [ ! trunk == "$branch" ] + then + call git switch -c "$1" --track origin/"$1" +fi +cd ..