Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
travis build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alhardy committed Jun 1, 2017
1 parent 2767748 commit 74847cc
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 112 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ notifications:
- al_hardy@live.com.au

language: csharp
# dotnet: 1.0.0-preview2-003131
dotnet: 1.0.4
os:
- osx
# - osx
- linux
before_script:
- chmod a+x ./build.sh
script:
- ./build_travis.sh
- ./build.sh

# .NET CLI require Ubuntu 14.04
sudo: required
Expand All @@ -24,11 +26,11 @@ addons:
- libunwind8

# .NET CLI require OSX 10.10
osx_image: xcode7.1
before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi
# osx_image: xcode7.1
# before_install:
# - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi

mono:
mono:
- 4.6.0

cache:
Expand Down
17 changes: 14 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,17 @@ var openCoverExcludeFile = "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs";
var coverIncludeFilter = "+:App.Metrics*";
var coverExcludeFilter = "-:*.Facts";
var excludeFromCoverage = "*.AppMetricsExcludeFromCodeCoverage*";
var versionSuffix = !string.IsNullOrEmpty(preReleaseSuffix) ? preReleaseSuffix + "-" + buildNumber.ToString("D4") : !AppVeyor.Environment.Repository.Tag.IsTag ? buildNumber.ToString("D4") : null;
string versionSuffix = null;

if (!string.IsNullOrEmpty(preReleaseSuffix))
{
versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
}
else if (AppVeyor.IsRunningOnAppVeyor && !AppVeyor.Environment.Repository.Tag.IsTag)
{
versionSuffix = buildNumber.ToString("D4");
}


//////////////////////////////////////////////////////////////////////
// TASKS
Expand Down Expand Up @@ -123,7 +133,8 @@ Task("Build")
Context.Information("Building using versionSuffix: " + versionSuffix);

// Workaround to fixing pre-release version package references - https://github.com/NuGet/Home/issues/4337
settings.ArgumentCustomization = args=>args.Append("/t:Restore /p:RestoreSources=" + @"""C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\""" + ";https://api.nuget.org/v3/index.json;https://www.myget.org/F/alhardy/api/v3/index.json;");
settings.ArgumentCustomization = args=>args.Append("/t:Restore /p:RestoreSources=https://api.nuget.org/v3/index.json;https://www.myget.org/F/alhardy/api/v3/index.json;");


if (IsRunningOnWindows())
{
Expand Down Expand Up @@ -232,7 +243,7 @@ Task("RunTests")
});

Task("HtmlCoverageReport")
.WithCriteria(() => FileExists(testOCoverageOutputFilePath) && coverWith != "None" && IsRunningOnWindows() && !skipHtmlCoverageReport)
.WithCriteria(() => IsRunningOnWindows() && FileExists(testOCoverageOutputFilePath) && coverWith != "None" && !skipHtmlCoverageReport)
.IsDependentOn("RunTests")
.Does(() =>
{
Expand Down
32 changes: 31 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
ADDINS_DIR=$TOOLS_DIR/Addins
MODULES_DIR=$TOOLS_DIR/Modules
NUGET_EXE=$TOOLS_DIR/nuget.exe
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
PACKAGES_CONFIG=$TOOLS_DIR/packages.config
PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config
MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config

# Define md5sum or md5 depending on Linux/OSX
MD5_EXE=
Expand Down Expand Up @@ -79,14 +83,40 @@ fi

mono "$NUGET_EXE" install -ExcludeVersion
if [ $? -ne 0 ]; then
echo "Could not restore NuGet packages."
echo "Could not restore NuGet tools."
exit 1
fi

$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5"

popd >/dev/null

# Restore addins from NuGet.
if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then
pushd "$ADDINS_DIR" >/dev/null

mono "$NUGET_EXE" install -ExcludeVersion
if [ $? -ne 0 ]; then
echo "Could not restore NuGet addins."
exit 1
fi

popd >/dev/null
fi

# Restore modules from NuGet.
if [ -f "$MODULES_PACKAGES_CONFIG" ]; then
pushd "$MODULES_DIR" >/dev/null

mono "$NUGET_EXE" install -ExcludeVersion
if [ $? -ne 0 ]; then
echo "Could not restore NuGet modules."
exit 1
fi

popd >/dev/null
fi

# Make sure that Cake has been installed.
if [ ! -f "$CAKE_EXE" ]; then
echo "Could not find Cake.exe at '$CAKE_EXE'."
Expand Down
101 changes: 0 additions & 101 deletions build_travis.sh

This file was deleted.

0 comments on commit 74847cc

Please sign in to comment.