Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit bf603cf

Browse files
committed
Fix cake to specific working version
1 parent fd87a20 commit bf603cf

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

build.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ $NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
5252
$NUGET_URL = "http://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
5353
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
5454
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
55+
$CAKE_PACKAGES_CONFIG = Join-Path $PSScriptRoot "cake.packages.config"
5556

5657
# Should we use mono?
5758
$UseMono = "";
@@ -81,9 +82,14 @@ if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
8182

8283
# Make sure that packages.config exist.
8384
if (!(Test-Path $PACKAGES_CONFIG)) {
84-
Write-Verbose -Message "Downloading packages.config..."
85-
try { Invoke-WebRequest -Uri http://cakebuild.net/download/bootstrapper/packages -OutFile $PACKAGES_CONFIG } catch {
86-
Throw "Could not download packages.config."
85+
if (!(Test-Path $CAKE_PACKAGES_CONFIG)) {
86+
Write-Verbose -Message "Downloading packages.config..."
87+
try { Invoke-WebRequest -Uri http://cakebuild.net/bootstrapper/packages -OutFile $PACKAGES_CONFIG } catch {
88+
Throw "Could not download packages.config."
89+
}
90+
} else {
91+
Write-Verbose -Message "using local cake.packages.config..."
92+
CopyItem $CAKE_PACKAGES_CONFIG $PACKAGES_CONFIG
8793
}
8894
}
8995

build.sh

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
# Define directories.
88
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
99
TOOLS_DIR=$SCRIPT_DIR/tools
10-
NUGET_EXE=$TOOLS_DIR/nuget.exe
10+
export NUGET_EXE=$TOOLS_DIR/nuget.exe
1111
CAKE_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.
1814
SCRIPT="build.cake"
1915
TARGET="Default"
@@ -45,38 +41,35 @@ fi
4541

4642
# Make sure that packages.config exist.
4743
if [ ! -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
5455
fi
5556

5657
# Download NuGet if it does not exist.
5758
if [ ! -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
6566
fi
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
8073
if [ ! -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
8780
fi
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.
9193
if [ ! -f "$CAKE_EXE" ]; then
9294
echo "Could not find Cake.exe at '$CAKE_EXE'."

cake.packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Cake" version="0.15.2" />
4+
</packages>

0 commit comments

Comments
 (0)