From d13c71e6177e910c5a5adc079f81f6f176ecfa27 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 8 Jul 2017 12:13:50 +0900 Subject: [PATCH] Write a script in preparation for SHA identified LiteCore fetching during build --- src/build/do_fetch_litecore.ps1 | 35 +++++++++++++++++++++++++++++++++ vendor/couchbase-lite-core | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/build/do_fetch_litecore.ps1 diff --git a/src/build/do_fetch_litecore.ps1 b/src/build/do_fetch_litecore.ps1 new file mode 100644 index 000000000..5e5230efb --- /dev/null +++ b/src/build/do_fetch_litecore.ps1 @@ -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 \ No newline at end of file diff --git a/vendor/couchbase-lite-core b/vendor/couchbase-lite-core index dfb104224..ac43b1f99 160000 --- a/vendor/couchbase-lite-core +++ b/vendor/couchbase-lite-core @@ -1 +1 @@ -Subproject commit dfb1042247883bc28a7e7f9a7fae9fd475091b2a +Subproject commit ac43b1f99605fba9d63bbde63db71f9b106c5948