Skip to content

Instantly share code, notes, and snippets.

@adamralph
Created August 21, 2016 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamralph/7ad59f33198ec4b226bf033f076b3758 to your computer and use it in GitHub Desktop.
Save adamralph/7ad59f33198ec4b226bf033f076b3758 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# options
set -e
set -o pipefail
set -x
# determine cache dir
if [ -z $XDG_DATA_HOME ]; then
NUGET_CACHE_DIR=$HOME/.local/share
else
NUGET_CACHE_DIR=$XDG_DATA_HOME;
fi
# download nuget to cache dir
NUGET_URL="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
if test ! -f $NUGET_CACHE_DIR/nuget.exe; then
mkdir -p $NUGET_CACHE_DIR
echo Downloading latest version of NuGet.exe...
wget -O $NUGET_CACHE_DIR/nuget.exe $NUGET_URL 2>/dev/null || curl -o $NUGET_CACHE_DIR/nuget.exe --location $NUGET_URL /dev/null
fi
# copy nuget locally
if test ! -f .nuget/nuget.exe; then
mkdir -p .nuget
cp $NUGET_CACHE_DIR/nuget.exe .nuget/nuget.exe
fi
# restore packages
mono .nuget/nuget.exe restore Dude.sln
# build solution
mkdir -p artifacts
xbuild Dude.sln /property:Configuration=Release /nologo /verbosity:normal
# run tests
mono packages/xunit.runner.console.2.1.0/tools/xunit.console.exe tests/DudeTests.Acceptance/bin/Release/DudeTests.Acceptance.dll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment