diff --git a/scripts/dev/download_libs.sh b/scripts/dev/download_libs.sh index 72ad5563469..1858a5675f1 100755 --- a/scripts/dev/download_libs.sh +++ b/scripts/dev/download_libs.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e -VER=master +VERSION="" +BRANCH=master PLATFORM="" ARCH="" OVERWRITE=1 @@ -12,7 +13,10 @@ cat << EOF Options: - -v, --version VERSION OF version to download the libraries for. Defaults to master + -t, --tag VERSION OF version (semver tag) to download the libraries for. Defaults to nightly dev + Examples: "0.10.0", "0.10.0RC4", "0.11.0" + See all options at: http://ci.openframeworks.cc/libs/ + -v, --version BRANCH OF branch to download the libraries for. Defaults to master -p, --platform PLATFORM Platorm among: android, emscritpen, ios, linux, linux64, linuxarmv6l, linuxarmv7l, msys2, osx, tvos, vs2015, vs2017 If not specified tries to autodetect the platform. -a, --arch ARCH Architecture: @@ -29,8 +33,14 @@ EOF } download(){ - echo "Downloading $1" - wget ci.openframeworks.cc/libs/$1 $SILENT_ARGS + if [-z "$VERSION"] + then + echo "Downloading latest $1" + wget ci.openframeworks.cc/libs/$1 $SILENT_ARGS + else + echo "Downloading $VERSION $1" + wget ci.openframeworks.cc/libs/$VERSION/$1 $SILENT_ARGS + fi } # trap any script errors and exit @@ -60,7 +70,11 @@ while [[ $# -gt 0 ]]; do key="$1" case $key in -v|--version) - VER="$2" + BRANCH="$2" + shift # past argument + ;; + -t|--tag) + VERSION="$2" shift # past argument ;; -p|--platform) @@ -153,41 +167,41 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" if [ "$ARCH" == "" ] && [ "$PLATFORM" == "vs2015" ]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}_32_1.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_2.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_3.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_4.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_1.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_2.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_3.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_4.zip" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_32_1.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_2.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_3.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_4.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_1.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_2.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_3.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_4.zip" elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "vs2017" ]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}_32_1.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_2.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_3.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_32_4.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_1.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_2.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_3.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_64_4.zip" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_32_1.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_2.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_3.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_32_4.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_1.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_2.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_3.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_64_4.zip" elif [ "$PLATFORM" == "msys2" ]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}_mingw${ARCH}.zip" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_mingw${ARCH}.zip" elif [ "$PLATFORM" == "vs2015" ] || [ "$PLATFORM" == "vs2017" ]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_1.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_2.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_3.zip \ - openFrameworksLibs_${VER}_${PLATFORM}_${ARCH}_4.zip" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_1.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_2.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_3.zip \ + openFrameworksLibs_${BRANCH}_${PLATFORM}_${ARCH}_4.zip" elif [ "$ARCH" == "" ] && [[ "$PLATFORM" == "osx" || "$PLATFORM" == "ios" || "$PLATFORM" == "tvos" ]]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}1.tar.bz2 \ - openFrameworksLibs_${VER}_${PLATFORM}2.tar.bz2 \ - openFrameworksLibs_${VER}_${PLATFORM}3.tar.bz2 \ - openFrameworksLibs_${VER}_${PLATFORM}4.tar.bz2" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}1.tar.bz2 \ + openFrameworksLibs_${BRANCH}_${PLATFORM}2.tar.bz2 \ + openFrameworksLibs_${BRANCH}_${PLATFORM}3.tar.bz2 \ + openFrameworksLibs_${BRANCH}_${PLATFORM}4.tar.bz2" elif [ "$ARCH" == "" ] && [ "$PLATFORM" == "android" ]; then - PKGS="openFrameworksLibs_${VER}_${PLATFORM}armv7.tar.bz2 \ - openFrameworksLibs_${VER}_${PLATFORM}arm64.tar.bz2 \ - openFrameworksLibs_${VER}_${PLATFORM}x86.tar.bz2" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}armv7.tar.bz2 \ + openFrameworksLibs_${BRANCH}_${PLATFORM}arm64.tar.bz2 \ + openFrameworksLibs_${BRANCH}_${PLATFORM}x86.tar.bz2" else # Linux - PKGS="openFrameworksLibs_${VER}_${PLATFORM}${ARCH}.tar.bz2" + PKGS="openFrameworksLibs_${BRANCH}_${PLATFORM}${ARCH}.tar.bz2" fi for PKG in $PKGS; do diff --git a/scripts/vs/download_libs.ps1 b/scripts/vs/download_libs.ps1 index 50fa34fb369..0ec04fbe2aa 100644 --- a/scripts/vs/download_libs.ps1 +++ b/scripts/vs/download_libs.ps1 @@ -5,7 +5,8 @@ # Which will load the visual studio 2015 libraries param( [String]$ver="master", - [String]$platform="vs2017" + [String]$platform="vs2017", + [String]$tag="" ) $currentPath = $pwd $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition @@ -14,6 +15,10 @@ $libsDir = $scriptPath + "\..\..\libs" function DownloadPackage{ $pkg = $args[0] $url = "http://ci.openframeworks.cc/libs/$pkg" + if(-Not [string]::IsNullOrEmpty($tag)) { + $url = "http://ci.openframeworks.cc/libs/$tag/$pkg" + } + If(Test-Path "$pkg") { echo "Deleting old package" Remove-Item $pkg