-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
199 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,96 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
########################################################################## | ||
# This is the Cake bootstrapper script for Linux and OS X. | ||
# This file was downloaded from https://github.com/cake-build/resources | ||
# Feel free to change this file to fit your needs. | ||
########################################################################## | ||
|
||
SCRIPT_PATH="${BASH_SOURCE[0]}"; | ||
if ([ -h "${SCRIPT_PATH}" ]) then | ||
while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done | ||
# Define directories. | ||
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
TOOLS_DIR=$SCRIPT_DIR/tools | ||
NUGET_EXE=$TOOLS_DIR/nuget.exe | ||
NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | ||
CAKE_VERSION=0.26.1 | ||
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe | ||
|
||
# Temporarily skip verification of addins. | ||
export CAKE_SETTINGS_SKIPVERIFICATION='true' | ||
|
||
# Define default arguments. | ||
TARGET="Travis" | ||
CONFIGURATION="Release" | ||
VERBOSITY="verbose" | ||
DRYRUN= | ||
SCRIPT_ARGUMENTS=() | ||
|
||
# Parse arguments. | ||
for i in "$@"; do | ||
case $1 in | ||
-t|--target) TARGET="$2"; shift ;; | ||
-c|--configuration) CONFIGURATION="$2"; shift ;; | ||
-v|--verbosity) VERBOSITY="$2"; shift ;; | ||
-d|--dryrun) DRYRUN="-dryrun" ;; | ||
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; | ||
*) SCRIPT_ARGUMENTS+=("$1") ;; | ||
esac | ||
shift | ||
done | ||
|
||
# Make sure the tools folder exist. | ||
if [ ! -d "$TOOLS_DIR" ]; then | ||
mkdir "$TOOLS_DIR" | ||
fi | ||
pushd . > /dev/null | ||
cd `dirname ${SCRIPT_PATH}` > /dev/null | ||
SCRIPT_PATH=`pwd`; | ||
popd > /dev/null | ||
|
||
if ! [ -f $SCRIPT_PATH/.nuget/nuget.exe ] | ||
then | ||
wget "https://www.nuget.org/nuget.exe" -P $SCRIPT_PATH/.nuget/ | ||
|
||
########################################################################### | ||
# INSTALL .NET CORE CLI | ||
########################################################################### | ||
|
||
echo "Installing .NET CLI..." | ||
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then | ||
mkdir "$SCRIPT_DIR/.dotnet" | ||
fi | ||
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh | ||
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.1 --install-dir .dotnet --no-path | ||
export PATH="$SCRIPT_DIR/.dotnet":$PATH | ||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
"$SCRIPT_DIR/.dotnet/dotnet" --info | ||
|
||
mono $SCRIPT_PATH/.nuget/nuget.exe update -self | ||
########################################################################### | ||
# INSTALL NUGET | ||
########################################################################### | ||
|
||
mono $SCRIPT_PATH/.nuget/nuget.exe install FAKE -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 4.25.4 | ||
# Download NuGet if it does not exist. | ||
if [ ! -f "$NUGET_EXE" ]; then | ||
echo "Downloading NuGet..." | ||
curl -Lsfo "$NUGET_EXE" $NUGET_URL | ||
if [ $? -ne 0 ]; then | ||
echo "An error occurred while downloading nuget.exe." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
mono $SCRIPT_PATH/.nuget/nuget.exe install xunit.runners -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 2.1.0 | ||
mono $SCRIPT_PATH/.nuget/nuget.exe install NBench.Runner -OutputDirectory packages -ExcludeVersion -Version 0.2.2 | ||
########################################################################### | ||
# INSTALL CAKE | ||
########################################################################### | ||
|
||
if ! [ -e $SCRIPT_PATH/packages/SourceLink.Fake/tools/SourceLink.fsx ] ; then | ||
mono $SCRIPT_PATH/.nuget/nuget.exe install SourceLink.Fake -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion | ||
if [ ! -f "$CAKE_EXE" ]; then | ||
mono "$NUGET_EXE" install Cake -Version $CAKE_VERSION -OutputDirectory "$TOOLS_DIR" | ||
if [ $? -ne 0 ]; then | ||
echo "An error occured while installing Cake." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# Make sure that Cake has been installed. | ||
if [ ! -f "$CAKE_EXE" ]; then | ||
echo "Could not find Cake.exe at '$CAKE_EXE'." | ||
exit 1 | ||
fi | ||
|
||
export encoding=utf-8 | ||
########################################################################### | ||
# RUN BUILD SCRIPT | ||
########################################################################### | ||
|
||
mono $SCRIPT_PATH/packages/FAKE/tools/FAKE.exe build.fsx "$@" | ||
# Start Cake | ||
exec mono "$CAKE_EXE" build.cake --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters