From 92e0c16499d9703ac2b1f89efbc5d29ee96d436f Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 23 May 2014 03:15:48 -0700 Subject: [PATCH] Made universe mono ready - Added build.sh to universe - Updated makefile to run build.sh instead of build.cmd - Updated build.sh script --- build-template/build.sh | 14 ++++++++++++-- build.sh | 40 ++++++++++++++++++++++++++++++++++++++++ makefile.shade | 18 ++++++++++++++++-- 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100755 build.sh diff --git a/build-template/build.sh b/build-template/build.sh index db1e0c3dde..a918165425 100644 --- a/build-template/build.sh +++ b/build-template/build.sh @@ -4,9 +4,9 @@ if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild else if x$XDG_DATA_HOME = x; then - cachedir=$HOME/.local/share + cachedir=$HOME/.local/share else - cachedir=$XDG_DATA_HOME; + cachedir=$XDG_DATA_HOME; fi fi mkdir -p $cachedir @@ -27,4 +27,14 @@ if test ! -d packages/KoreBuild; then mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion fi +KRE_VERSION=$(mono .nuget/nuget.exe install KRE-mono45-x86 -pre -o ~/.kre/packages | head -1 | sed "s/.*KRE-mono45-x86 \([^']*\).*/\1/") +KRE_BIN=~/.kre/packages/KRE-mono45-x86.$KRE_VERSION/bin + +chmod +x $KRE_BIN/k +chmod +x $KRE_BIN/klr +chmod +x $KRE_BIN/kpm +chmod +x $KRE_BIN/k-build + +export PATH=$KRE_BIN:$PATH + mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..ff2570f4c7 --- /dev/null +++ b/build.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if test `uname` = Darwin; then + cachedir=~/Library/Caches/KBuild +else + if x$XDG_DATA_HOME = x; then + cachedir=$HOME/.local/share + else + cachedir=$XDG_DATA_HOME; + fi +fi +mkdir -p $cachedir + +url=https://www.nuget.org/nuget.exe + +if test ! -f $cachedir/nuget.exe; then + wget -o $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null +fi + +if test ! -e .nuget; then + mkdir .nuget + cp $cachedir/nuget.exe .nuget +fi + +if test ! -d packages/KoreBuild; then + mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre + mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion +fi + +KRE_VERSION=$(mono .nuget/nuget.exe install KRE-mono45-x86 -pre -o ~/.kre/packages | head -1 | sed "s/.*KRE-mono45-x86 \([^']*\).*/\1/") +KRE_BIN=~/.kre/packages/KRE-mono45-x86.$KRE_VERSION/bin + +chmod +x $KRE_BIN/k +chmod +x $KRE_BIN/klr +chmod +x $KRE_BIN/kpm +chmod +x $KRE_BIN/k-build + +export PATH=$KRE_BIN:$PATH + +mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" \ No newline at end of file diff --git a/makefile.shade b/makefile.shade index 0ed76d34d6..4204faecb1 100644 --- a/makefile.shade +++ b/makefile.shade @@ -126,7 +126,14 @@ var repos='${new Dictionary { try { Log.Info(string.Format("Building {0}", repo.Key)); - Exec("build.cmd", "compile", repo.Key); + if (IsMono) + { + Exec("build.sh", "compile", repo.Key); + } + else + { + Exec("build.cmd", "compile", repo.Key); + } Log.Info(string.Format("Build {0} succeeded", repo.Key)); } catch(Exception ex) @@ -153,7 +160,14 @@ var repos='${new Dictionary { @{ foreach(var repo in repos) { - Exec("build.cmd", "install", repo.Key); + if (IsMono) + { + Exec("build.sh", "install", repo.Key); + } + else + { + Exec("build.cmd", "install", repo.Key); + } } }