Skip to content

Commit

Permalink
Updates to use of Dependencies including tags for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmgoossens committed Dec 2, 2023
1 parent c7c6cc5 commit a263195
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .coin-or/Dependencies
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# <Directory> <Repository> <Branch/Tag>
# 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
Cbc https://github.com/coin-or/Cbc master
5 changes: 2 additions & 3 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ 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
)
if exist Data\miplib3 (
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: |
Expand Down
1 change: 1 addition & 0 deletions MSVisualStudio/v17/Sonnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions get-dependencies.bat
Original file line number Diff line number Diff line change
@@ -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 <Directory> <Repository> <Branch/Tag>
@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
)

0 comments on commit a263195

Please sign in to comment.