Skip to content
Permalink
Browse files
Build: Implement repair-submodules function
It's not simple git submodule init/update, it will remove all folders are busy by submodules, and then will reclone them with checking out the latest master branch
  • Loading branch information
Wohlstand committed May 8, 2017
1 parent 3a6dbc9 commit 9099903fff05d7eb5075e40fbeb9856d01b6e797
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
@@ -6,6 +6,7 @@ SET MAKE_EXTRA_ARGS=-r -j 4

:argsloop
if "%1"=="clean" goto cleanX
if "%1"=="repair-submodules" goto repairSubModules
if "%1"=="nopause" SET NoPause=1
if "%1"=="noeditor" SET BuildArgs=%BuildArgs% CONFIG+=noeditor
if "%1"=="noengine" SET BuildArgs=%BuildArgs% CONFIG+=noengine
@@ -56,8 +57,32 @@ echo ==== Clear! ====
exit /B 0
goto quit;

:run
:repairSubModules
rem !!FIXME!! Implement parsing of submodules list and fill this array automatically
rem NOTE: Don't use "git submodule foreach" because broken submodule will not shown in it's list!
set SUBMODULES=_Libs\FreeImage
set SUBMODULES=%SUBMODULES% _Libs\QtPropertyBrowser
set SUBMODULES=%SUBMODULES% _Libs\sqlite3
set SUBMODULES=%SUBMODULES% _common\PGE_File_Formats
set SUBMODULES=%SUBMODULES% _common\PgeGameSave\submodule
rem \===============================================================================
for %%s in (%SUBMODULES%) do (
echo Remove folder %%s ...
if exist %%s\nul rd /Q /S %%s
)
echo Fetching new submodules...
git submodule init
git submodule update
echo.
git submodule foreach git checkout master
git submodule foreach git pull origin master
echo.
echo ==== Fixed! ====
exit /B 0
goto quit;


:run
cd %CD%\Editor
%QtDir%\lrelease.exe *.pro
cd ..\Engine
@@ -125,6 +125,33 @@ do
exit 0;
;;

repair-submodules)
#!!FIXME!! Implement parsing of submodules list and fill this array automatically
#NOTE: Don't use "git submodule foreach" because broken submodule will not shown in it's list!
SUBMODULES="_Libs/FreeImage"
SUBMODULES="${SUBMODULES} _Libs/QtPropertyBrowser"
SUBMODULES="${SUBMODULES} _Libs/sqlite3"
SUBMODULES="$SUBMODULES _common/PGE_File_Formats"
SUBMODULES="$SUBMODULES _common/PgeGameSave/submodule"
# \===============================================================================
for s in $SUBMODULES
do
if [ -d $s ];then
echo "Remove folder ${s}..."
rm -Rf $s
fi
done
echo "Fetching new submodules..."
git submodule init
git submodule update
echo ""
git submodule foreach git checkout master
git submodule foreach git pull origin master
echo ""
echo "==== Fixed! ===="
exit 0;
;;

# Enable debuggin of this script by showing states of inernal variables with pauses
debugscript)
flag_debugThisScript=true
@@ -174,11 +201,11 @@ source ./_common/functions.sh

if [ -f "$SCRDIR/_paths.sh" ]
then
source "$SCRDIR/_paths.sh"
source "$SCRDIR/_paths.sh"
else
echo ""
echo "_paths.sh is not exist! Run \"generate_paths.sh\" first!"
errorofbuild
echo ""
echo "_paths.sh is not exist! Run \"generate_paths.sh\" first!"
errorofbuild
fi

PATH=$QT_PATH:$PATH

0 comments on commit 9099903

Please sign in to comment.