aspnetcore/KoreBuild-dotnet/build/KoreBuild.sh

50 lines
1.7 KiB
Bash

#!/usr/bin/env bash
if [ -z "$koreBuildFolder" ]; then
echo "koreBuildFolder is not set."
exit 1
fi
if [ -z "$nugetPath" ]; then
echo "nugetPath is not set."
exit 1
fi
sakeFolder=$koreBuildFolder/build/Sake
if test ! -d $sakeFolder; then
mono $nugetPath install Sake -ExcludeVersion -o $koreBuildFolder/build -nocache -pre
fi
if test ! -d $koreBuildFolder/build/xunit.runner.console; then
mono $nugetPath install xunit.runner.console -ExcludeVersion -o $koreBuildFolder/build -nocache -pre
fi
# Need to set this variable because by default the install script
# requires sudo
export DOTNET_INSTALL_DIR=~/.dotnet
export PATH=~/.dotnet/bin:$PATH
export DOTNET_HOME=DOTNET_INSTALL_DIR
export KOREBUILD_FOLDER=$koreBuildFolder
source $koreBuildFolder/build/dotnet-install.sh
makefilePath=makefile.shade
if test ! -f $makefilePath; then
makefilePath=$koreBuildFolder/build/makefile.shade
fi
# Probe for Mono Reference assemblies
if test -z "$DOTNET_REFERENCE_ASSEMBLIES_PATH"; then
if test $(uname) == Darwin && test -d "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks"; then
export DOTNET_REFERENCE_ASSEMBLIES_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks"
elif test -d "/usr/local/lib/mono/xbuild-frameworks"; then
export DOTNET_REFERENCE_ASSEMBLIES_PATH="/usr/local/lib/mono/xbuild-frameworks"
elif test -d "/usr/lib/mono/xbuild-frameworks"; then
export DOTNET_REFERENCE_ASSEMBLIES_PATH="/usr/lib/mono/xbuild-frameworks"
fi
fi
echo "Using Reference Assemblies from: $DOTNET_REFERENCE_ASSEMBLIES_PATH"
mono $sakeFolder/tools/Sake.exe -I $koreBuildFolder/build -f $makefilePath "$@"