Skip to content

Commit

Permalink
Merge pull request #978 from DustinCampbell/fix-build
Browse files Browse the repository at this point in the history
Pin .NET Core SDK and fix Travis OSX build
  • Loading branch information
DustinCampbell authored Oct 10, 2017
2 parents ec0afaf + 45e6b8f commit 0c78b88
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
global:
secure: m2PtYwYOhaK0uFMZ19ZxApZwWZeAIq1dS//jx/5I3txpIWD+TfycQMAWYxycFJ/GJkeVF29P4Zz1uyS2XKKjPJpp2Pds98FNQyDv3OftpLAVa0drsjfhurVlBmSdrV7GH6ncKfvhd+h7KVK5vbZc+NeR4dH7eNvN/jraS//AMJg=
mono: latest
dotnet: 2.0.0
os:
- linux
- osx
Expand Down Expand Up @@ -39,9 +38,20 @@ install:
sudo rm -rf /usr/local/src/libuv-1.14.0
sudo ldconfig
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update
# Need to install openssl for .NET Core SDK 1.0 (legacy tests)
brew install openssl
mkdir -p /usr/local/lib
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/
brew install libuv
fi
- export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
- export PATH="$PWD/.dotnet:$PATH"

notifications:
slack:
rooms:
Expand Down
10 changes: 8 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Task("Setup")
.IsDependentOn("InstallMonoAssets")
.IsDependentOn("CreateMSBuildFolder");

void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, string installFolder, bool sharedRuntime = false)
void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, string installFolder, bool sharedRuntime = false, bool noPath = false)
{
if (!DirectoryHelper.Exists(installFolder))
{
Expand Down Expand Up @@ -137,6 +137,11 @@ void InstallDotNetSdk(BuildEnvironment env, BuildPlan plan, string version, stri
argList.Add("-SharedRuntime");
}

if (noPath)
{
argList.Add("-NoPath");
}

Run(env.ShellCommand, $"{env.ShellArgument} {scriptFilePath} {string.Join(" ", argList)}").ExceptionOnError($"Failed to Install .NET Core SDK {version}");
}

Expand All @@ -163,7 +168,8 @@ Task("InstallDotNetCoreSdk")
// Install legacy .NET Core SDK (used to 'dotnet restore' project.json test projects)
InstallDotNetSdk(env, buildPlan,
version: buildPlan.LegacyDotNetVersion,
installFolder: env.Folders.LegacyDotNetSdk);
installFolder: env.Folders.LegacyDotNetSdk,
noPath: true);
}
Run(env.DotNetCommand, "--info");
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.0.0"
}
}

0 comments on commit 0c78b88

Please sign in to comment.