Skip to content

Commit

Permalink
Housekeeping: Allow explicit specification of VS and MSBuild path (re…
Browse files Browse the repository at this point in the history
…activeui#1821)

Some test scenarios cannot depend on cake locating VS/MSBuild correctly.
  • Loading branch information
kdubau authored and glennawatson committed Oct 17, 2018
1 parent e929120 commit 68d3683
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if (string.IsNullOrWhiteSpace(target))
}

var includePrerelease = Argument("includePrerelease", false);
var vsLocationString = Argument("vsLocation", string.Empty);
var msBuildPathString = Argument("msBuildPath", string.Empty);

//////////////////////////////////////////////////////////////////////
// PREPARATION
Expand All @@ -47,7 +49,8 @@ var isPullRequest = !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariabl
var isRepository = StringComparer.OrdinalIgnoreCase.Equals("reactiveui/reactiveui", TFBuild.Environment.Repository.RepoName);

var vsWhereSettings = new VSWhereLatestSettings() { IncludePrerelease = includePrerelease };
var msBuildPath = VSWhereLatest(vsWhereSettings).CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe");
var vsLocation = string.IsNullOrWhiteSpace(vsLocationString) ? VSWhereLatest(vsWhereSettings) : new DirectoryPath(vsLocationString);
var msBuildPath = string.IsNullOrWhiteSpace(msBuildPathString) ? vsLocation.CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe") : new FilePath(msBuildPathString);

var informationalVersion = EnvironmentVariable("GitAssemblyInformationalVersion");

Expand Down Expand Up @@ -119,7 +122,7 @@ Task("GenerateEvents")
{
var eventBuilder = "./src/EventBuilder/bin/Release/net461/EventBuilder.exe";
var workingDirectory = "./src/EventBuilder/bin/Release/Net461";
var referenceAssembliesPath = VSWhereLatest(vsWhereSettings).CombineWithFilePath("./Common7/IDE/ReferenceAssemblies/Microsoft/Framework");
var referenceAssembliesPath = vsLocation.CombineWithFilePath("./Common7/IDE/ReferenceAssemblies/Microsoft/Framework");

Information(referenceAssembliesPath.ToString());

Expand Down

0 comments on commit 68d3683

Please sign in to comment.