From d1a1759016815c550442aeff2751201477e2ef18 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Thu, 25 Feb 2016 17:23:04 +0200 Subject: [PATCH 1/3] Use a fixed revision of OpenCOLLADA in order to prevent introducing breaking changes. Closes #36, related to #38 --- win/build-deps.cmd | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/win/build-deps.cmd b/win/build-deps.cmd index d7d8b44b35..81140aa78b 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -205,7 +205,8 @@ IF EXIST "%DEPS_DIR%\icu-55.1-vs%VS_VER%\". ( :: Note OpenCOLLADA has only Release and Debug builds. set DEPENDENCY_NAME=OpenCOLLADA set DEPENDENCY_DIR=%DEPS_DIR%\OpenCOLLADA -call :GitCloneOrPullRepository https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" +:: Use a fixed revision in order to prevent introducing breaking changes +call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6 IF NOT %ERRORLEVEL%==0 GOTO :Error cd "%DEPENDENCY_DIR%" :: Debug build of OpenCOLLADAValidator fails (https://github.com/KhronosGroup/OpenCOLLADA/issues/377) so @@ -386,6 +387,28 @@ IF NOT EXIST %2. ( popd exit /b %RET% +:: GitCloneAndCheckoutRevision - Clones a Git repository and checks out a specific revision +:: Params: %1 gitUrl, %2 destDir, %3 revision +:: F.ex. call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6 +:GitCloneAndCheckoutRevision +IF NOT EXIST %2. ( + call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %2." + pushd "%DEPS_DIR%" + call git clone %1 %2 + pushd "%2" + call cecho.cmd 0 13 "Checking out %DEPENDENCY_NAME% revision %3." + call git checkout %3 + set RET=%ERRORLEVEL% + popd +) ELSE ( + call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Skipping." + pushd %2 + call git pull + set RET=0 +) +popd +exit /b %RET% + :: RunCMake - Runs CMake for a CMake-based project :: Params: %* cmakeOptions :: NOTE cd to root CMakeLists.txt folder before calling this if the CMakeLists.txt is not in the repo root. From 7ed219af70b67f787d1209bbb665c15c985cddd2 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Thu, 25 Feb 2016 17:31:47 +0200 Subject: [PATCH 2/3] Use a fixed revision of OpenCOLLADA in order to prevent introducing breaking changes. Closes #36, related to #38 --- win/build-deps.cmd | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/win/build-deps.cmd b/win/build-deps.cmd index 81140aa78b..a8ce258f0f 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -391,7 +391,7 @@ exit /b %RET% :: Params: %1 gitUrl, %2 destDir, %3 revision :: F.ex. call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6 :GitCloneAndCheckoutRevision -IF NOT EXIST %2. ( +IF NOT EXIST "%2". ( call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %2." pushd "%DEPS_DIR%" call git clone %1 %2 @@ -402,8 +402,6 @@ IF NOT EXIST %2. ( popd ) ELSE ( call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Skipping." - pushd %2 - call git pull set RET=0 ) popd From 851fadb4ec0b2651516afe9b26707e57347806e0 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Sat, 27 Feb 2016 17:44:45 +0200 Subject: [PATCH 3/3] build-deps.cmd: GitCloneAndCheckoutRevision - always checkout the revision, so that users don't have the nuke their existing clones before running the script. --- win/build-deps.cmd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/win/build-deps.cmd b/win/build-deps.cmd index a8ce258f0f..8fa1c63830 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -395,15 +395,17 @@ IF NOT EXIST "%2". ( call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %2." pushd "%DEPS_DIR%" call git clone %1 %2 - pushd "%2" - call cecho.cmd 0 13 "Checking out %DEPENDENCY_NAME% revision %3." - call git checkout %3 set RET=%ERRORLEVEL% + if not %RET%==0 exit /b %RET% popd ) ELSE ( - call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Skipping." + call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned." set RET=0 ) +pushd "%2" +call cecho.cmd 0 13 "Checking out %DEPENDENCY_NAME% revision %3." +call git checkout %3 +set RET=%ERRORLEVEL% popd exit /b %RET%