2015-06-23 20:46:47 +03:00
|
|
|
#!/usr/bin/env bash
|
2015-06-08 02:34:01 +03:00
|
|
|
|
|
|
|
if test `uname` = Darwin; then
|
|
|
|
cachedir=~/Library/Caches/KBuild
|
|
|
|
else
|
|
|
|
if [ -z $XDG_DATA_HOME ]; then
|
|
|
|
cachedir=$HOME/.local/share
|
|
|
|
else
|
|
|
|
cachedir=$XDG_DATA_HOME;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
mkdir -p $cachedir
|
2015-09-18 04:33:14 +03:00
|
|
|
nugetVersion=latest
|
|
|
|
cachePath=$cachedir/nuget.$nugetVersion.exe
|
2015-06-08 02:34:01 +03:00
|
|
|
|
2015-09-18 04:33:14 +03:00
|
|
|
url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe
|
2015-06-08 02:34:01 +03:00
|
|
|
|
2015-09-18 04:33:14 +03:00
|
|
|
if test ! -f $cachePath; then
|
|
|
|
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null
|
2015-06-08 02:34:01 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test ! -e .nuget; then
|
|
|
|
mkdir .nuget
|
2015-09-18 04:33:14 +03:00
|
|
|
cp $cachePath .nuget/nuget.exe
|
2015-06-08 02:34:01 +03:00
|
|
|
fi
|
|
|
|
|
2015-10-09 05:00:27 +03:00
|
|
|
if test ! -d packages/Sake; then
|
2015-06-08 02:34:01 +03:00
|
|
|
mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
|
2015-10-09 05:00:27 +03:00
|
|
|
mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
|
2015-06-08 02:34:01 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ! type dnvm > /dev/null 2>&1; then
|
|
|
|
source packages/KoreBuild/build/dnvm.sh
|
|
|
|
fi
|
|
|
|
|
2015-10-09 05:00:27 +03:00
|
|
|
if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then
|
|
|
|
dnvm install latest -runtime coreclr -alias default
|
|
|
|
dnvm install default -runtime mono -alias default
|
|
|
|
else
|
|
|
|
dnvm use default -runtime mono
|
2015-06-08 02:34:01 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@"
|