Skip to content

Commit

Permalink
Write a script in preparation for SHA identified LiteCore fetching du…
Browse files Browse the repository at this point in the history
…ring build
  • Loading branch information
borrrden committed Jul 8, 2017
1 parent 40cb5e4 commit d13c71e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions src/build/do_fetch_litecore.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
param(
[Parameter(Mandatory=$true)][string]$NexusRepo
)

pushd $PSScriptRoot\..\..\vendor\couchbase-lite-core\build_cmake
$sha = $(& 'C:\Program Files\Git\bin\git.exe' rev-parse HEAD)
Write-Host "Fetching variants for $sha..."
$VARIANTS = @("macosx", "linux")
$EXTENSIONS = @("zip", "tar.gz")
try {
$i = 0
foreach ($variant in $VARIANTS) {
echo "Fetching $variant..."
Invoke-WebRequest $NexusRepo/couchbase-litecore-$variant/$sha/couchbase-litecore-$variant-$sha.$($EXTENSIONS[$i]) -Out litecore-$variant.$($EXTENSIONS[$i++])
}
} catch [System.Net.WebException] {
popd
if($_.Exception.Status -eq [System.Net.WebExceptionStatus]::ProtocolError) {
$res = $_.Exception.Response.StatusCode
if($res -eq 404) {
Write-Host "$variant for $sha is not ready yet!"
exit 1
}
}

throw
}

& 7z e -y litecore-macosx.zip lib/libLiteCore.dylib
& 7z x litecore-linux.tar.gz
& 7z e -y litecore-linux.tar lib/*
rm litecore-macosx.zip
rm litecore-linux.tar
rm litecore-linux.tar.gz
popd

0 comments on commit d13c71e

Please sign in to comment.