diff --git a/.coin-or/Dependencies b/.coin-or/Dependencies index 7c78265..8349510 100644 --- a/.coin-or/Dependencies +++ b/.coin-or/Dependencies @@ -1,7 +1,11 @@ +# +# If a tag is provided, then the checkout will be with detached head. +# Example: Cbc https://github.com/coin-or/Cbc releases/2.10.11 +../pthreads https://github.com/GerHobbelt/pthread-win32 master Data/Sample https://github.com/coin-or-tools/Data-Sample master Data/miplib3 https://github.com/coin-or-tools/Data-miplib3 master CoinUtils https://github.com/coin-or/CoinUtils master Osi https://github.com/coin-or/Osi master Clp https://github.com/coin-or/Clp master Cgl https://github.com/coin-or/Cgl master -Cbc https://github.com/coin-or/Cbc master \ No newline at end of file +Cbc https://github.com/coin-or/Cbc master diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index c87493a..07856d0 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -37,7 +37,7 @@ jobs: - name: Checkout dependenies sources shell: cmd run: | - for /f "tokens=1,2,3" %%i in (sonnet\.coin-or\Dependencies) do ( + for /f "eol=# tokens=1,2,3" %%i in (sonnet\.coin-or\Dependencies) do ( echo Cloning into folder %%i from github project %%j at branch %%k git clone --depth=1 --branch=%%k %%j %%i ) @@ -45,8 +45,7 @@ jobs: 7z x -bso0 -oData\miplib3 Data\miplib3\*.gz erase /f Data\miplib3\*.gz ) - git clone --depth=1 --branch=master https://github.com/GerHobbelt/pthread-win32.git ..\pthreads - + - name: Prepare for build shell: pwsh run: | diff --git a/MSVisualStudio/v17/Sonnet.sln b/MSVisualStudio/v17/Sonnet.sln index a276e49..2f44077 100644 --- a/MSVisualStudio/v17/Sonnet.sln +++ b/MSVisualStudio/v17/Sonnet.sln @@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\..\AUTHORS.txt = ..\..\AUTHORS.txt ..\..\build-third-party-license.bat = ..\..\build-third-party-license.bat ..\..\CHANGELOG.txt = ..\..\CHANGELOG.txt + ..\..\get-dependencies.bat = ..\..\get-dependencies.bat ..\..\LICENSE.txt = ..\..\LICENSE.txt ..\..\NOTICE.txt = ..\..\NOTICE.txt ..\..\README.md = ..\..\README.md diff --git a/appveyor.yml b/appveyor.yml index 3a65581..71b64f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -50,7 +50,7 @@ install: - ps: | cd c:\projects $env:GIT_REDIRECT_STDERR = '2>&1' - $deps = Get-Content sonnet\.coin-or\Dependencies | ConvertFrom-String -Delimiter "\s+" -PropertyNames i,j,k + $deps = (Get-Content sonnet\.coin-or\Dependencies) -match "^[^#]" | ConvertFrom-String -Delimiter "\s+" -PropertyNames i,j,k foreach ($d in $deps) { Write-Host "git clone --depth 1 -b" $d.k $d.j $d.i @@ -63,7 +63,6 @@ install: 7z x -bso0 -oData\miplib3 Data\miplib3\*.gz Remove-Item -Force -Path Data\miplib3\*.gz } - git clone --depth 1 https://github.com/GerHobbelt/pthread-win32.git -b master ..\pthreads - set RELEASE_TYPE=undefined - set RELEASE_NAME=undefined diff --git a/get-dependencies.bat b/get-dependencies.bat new file mode 100644 index 0000000..a0c7b4f --- /dev/null +++ b/get-dependencies.bat @@ -0,0 +1,25 @@ +@rem Read .coin-or\Dependencies and clone if the directory does not exist, or fetch and checkout. +@rem The Dependencies file has lines like +@echo off + +set depfile=.coin-or\Dependencies +if not exist %depfile% echo ERROR: File %depfile% not found. && exit /b 1 + +for /f "eol=# tokens=1,2,3" %%i in (%depfile%) do ( + echo. + echo ********************************** + echo INFO: Directory: ..\%%i + echo INFO: Repo: %%j + echo INFO: Branch/Tag: %%k + if not exist ..\%%i ( + echo INFO: Folder ..\%%i does not exist. Now cloning. + git clone --depth 1 %%j -b %%k ..\%%i + if errorlevel 1 pause + ) else ( + echo INFO: Folder ..\%%i exists. Fetch and Checkout %%k. + git -C ..\%%i fetch --all + git -C ..\%%i checkout %%k + if errorlevel 1 pause + ) + echo INFO: Finished with ..\%%i +)