diff options
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-x | init-tools.sh | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/init-tools.sh b/init-tools.sh index 326e6519ea..759a2ec89a 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -73,42 +73,55 @@ if [ "$__DistroName" == "rhel" ]; then __DOTNET_PKG=dotnet-dev-centos-x64 fi +# Work around mac build issue +if [ "$OS"=="OSX" ]; then + echo Raising file open limit - otherwise Mac build may fail + echo ulimit -n 2048 + ulimit -n 2048 +fi + __CLIDownloadURL=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz echo ".NET CLI will be downloaded from $__CLIDownloadURL" +echo "Locating $__PROJECT_JSON_FILE to see if we already downloaded .NET CLI tools..." if [ ! -e $__PROJECT_JSON_FILE ]; then - if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi - - if [ ! -e $__DOTNET_PATH ]; then - # curl has HTTPS CA trust-issues less often than wget, so lets try that first. - which curl > /dev/null 2> /dev/null - if [ $? -ne 0 ]; then - mkdir -p "$__DOTNET_PATH" - wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL - else - curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL - fi - cd $__DOTNET_PATH - tar -xf $__DOTNET_PATH/dotnet.tar - if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then - find $__DOTNET_PATH -name *.ni.* | xargs rm 2>/dev/null - cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin - cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin/dnx - cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/runtime/coreclr - fi + echo "$__PROJECT_JSON_FILE not found. Proceeding to download .NET CLI tools. " + if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi + + if [ ! -e $__DOTNET_PATH ]; then + # curl has HTTPS CA trust-issues less often than wget, so lets try that first. + which curl > /dev/null 2> /dev/null + if [ $? -ne 0 ]; then + mkdir -p "$__DOTNET_PATH" + wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL + echo "wget -q -O $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL" + else + curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL + echo "curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar $__CLIDownloadURL" + fi + cd $__DOTNET_PATH + tar -xf $__DOTNET_PATH/dotnet.tar + if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then + find $__DOTNET_PATH -name *.ni.* | xargs rm 2>/dev/null + cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin + cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin/dnx + cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/runtime/coreclr + fi - cd $__scriptpath - fi + cd $__scriptpath + fi - mkdir "$__PROJECT_JSON_PATH" - echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" + mkdir "$__PROJECT_JSON_PATH" + echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" - if [ ! -e $__BUILD_TOOLS_PATH ]; then - $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE - fi + if [ ! -e $__BUILD_TOOLS_PATH ]; then + $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE + fi - # On ubuntu 14.04, /bin/sh (symbolic link) calls /bin/dash by default. - $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR + # On ubuntu 14.04, /bin/sh (symbolic link) calls /bin/dash by default. + $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR - chmod a+x $__TOOLRUNTIME_DIR/corerun + chmod a+x $__TOOLRUNTIME_DIR/corerun +else + echo "$__PROJECT_JSON_FILE found. Skipping .NET CLI installation." fi |