77# Define directories.
88SCRIPT_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd )
99TOOLS_DIR=$SCRIPT_DIR /tools
10- NUGET_EXE=$TOOLS_DIR /nuget.exe
10+ export NUGET_EXE=$TOOLS_DIR /nuget.exe
1111CAKE_EXE=$TOOLS_DIR /Cake/Cake.exe
1212
13- # BEGIN TEMP WORKAROUND
14- SYSIOCOMP=$TOOLS_DIR /System.IO.Compression.dll
15- # END TEMP WORKAROUND
16-
1713# Define default arguments.
1814SCRIPT=" build.cake"
1915TARGET=" Default"
4541
4642# Make sure that packages.config exist.
4743if [ ! -f " $TOOLS_DIR /packages.config" ]; then
48- echo " Downloading packages.config..."
49- curl -Lsfo " $TOOLS_DIR /packages.config" http://cakebuild.net/download/bootstrapper/packages
50- if [ $? -ne 0 ]; then
51- echo " An error occured while downloading packages.config."
52- exit 1
44+ if [ ! -f " $SCRIPT_DIR /cake.packages.config" ]; then
45+ echo " Downloading packages.config..."
46+ curl -Lsfo " $TOOLS_DIR /packages.config" http://cakebuild.net/bootstrapper/packages
47+ if [ $? -ne 0 ]; then
48+ echo " An error occured while downloading packages.config."
49+ exit 1
50+ fi
51+ else
52+ echo " using local cake.packages.config..."
53+ cp " $SCRIPT_DIR /cake.packages.config" " $TOOLS_DIR /packages.config"
5354 fi
5455fi
5556
5657# Download NuGet if it does not exist.
5758if [ ! -f " $NUGET_EXE " ]; then
5859 echo " Downloading NuGet..."
59- # For now grab explicit 3.4.4 version instead of: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
6060 curl -Lsfo " $NUGET_EXE " https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe
61+ # v3/Latest URL: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
6162 if [ $? -ne 0 ]; then
6263 echo " An error occured while downloading nuget.exe."
6364 exit 1
6465 fi
6566fi
6667
67- # Restore tools from NuGet.
68- pushd " $TOOLS_DIR " > /dev/null
69- mono " $NUGET_EXE " install -ExcludeVersion
70- if [ $? -ne 0 ]; then
71- echo " Could not restore NuGet packages."
72- exit 1
73- fi
74- popd > /dev/null
75-
7668# BEGIN TEMP WORKAROUND
7769# There is a bug in Mono's System.IO.Compression
7870# This binary fixes the bug for now
7971# Download System.IO.Compression if it does not exist.
72+ SYSIOCOMP=$TOOLS_DIR /System.IO.Compression.dll
8073if [ ! -f " $SYSIOCOMP " ]; then
8174 echo " Downloading System.IO.Compression.dll ..."
8275 curl -Lsfo " $SYSIOCOMP " http://xamarin-components-binaries.s3.amazonaws.com/System.IO.Compression.dll
@@ -87,6 +80,15 @@ if [ ! -f "$SYSIOCOMP" ]; then
8780fi
8881# END TEMP WORKAROUND
8982
83+ # Restore tools from NuGet.
84+ pushd " $TOOLS_DIR " > /dev/null
85+ mono " $NUGET_EXE " install -ExcludeVersion
86+ if [ $? -ne 0 ]; then
87+ echo " Could not restore NuGet packages."
88+ exit 1
89+ fi
90+ popd > /dev/null
91+
9092# Make sure that Cake has been installed.
9193if [ ! -f " $CAKE_EXE " ]; then
9294 echo " Could not find Cake.exe at '$CAKE_EXE '."
0 commit comments