Skip to content

Commit

Permalink
Merge branch 'master' into feature/1469-dotnet-version-variable
Browse files Browse the repository at this point in the history
  • Loading branch information
snovak7 authored Oct 17, 2018
2 parents eb9f090 + fa6a2b7 commit 8dfa5e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ Task("Publish-AppVeyor")
Task("Publish-AzurePipeline")
.WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AzurePipeline works only on Windows agents.")
.WithCriteria(() => parameters.IsRunningOnAzurePipeline, "Publish-AzurePipeline works only on AzurePipeline.")
.WithCriteria(() => !parameters.IsPullRequest, "Publish-AzurePipeline works only for non-PR commits.")
.IsDependentOn("Pack")
.IsDependentOn("Release-Notes")
.Does(() =>
Expand Down
9 changes: 4 additions & 5 deletions build/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class BuildParameters
public string FullFxVersion { get; private set; } = "net40";

public bool EnabledUnitTests { get; private set; }
public bool EnabledSetVersion { get; private set; }
public bool EnabledPublishGem { get; private set; }
public bool EnabledPublishTfs { get; private set; }
public bool EnabledPublishNuget { get; private set; }
Expand Down Expand Up @@ -61,7 +60,6 @@ public class BuildParameters
Configuration = context.Argument("configuration", "Release"),

EnabledUnitTests = IsEnabled(context, "ENABLED_UNIT_TESTS"),
EnabledSetVersion = IsEnabled(context, "ENABLED_SET_VERSION"),
EnabledPublishGem = IsEnabled(context, "ENABLED_PUBLISH_GEM"),
EnabledPublishTfs = IsEnabled(context, "ENABLED_PUBLISH_TFS"),
EnabledPublishNuget = IsEnabled(context, "ENABLED_PUBLISH_NUGET"),
Expand Down Expand Up @@ -170,12 +168,13 @@ public class BuildParameters
}
if (buildSystem.IsRunningOnTravisCI)
{
return !string.IsNullOrWhiteSpace(buildSystem.TravisCI.Environment.Repository.PullRequest)
&& !string.Equals(buildSystem.TravisCI.Environment.Repository.PullRequest, false.ToString(), StringComparison.InvariantCultureIgnoreCase);
var value = buildSystem.TravisCI.Environment.Repository.PullRequest;
return !string.IsNullOrWhiteSpace(value) && !string.Equals(value, false.ToString(), StringComparison.InvariantCultureIgnoreCase);
}
else if (buildSystem.IsRunningOnVSTS)
{
return false; // need a way to check if it is from a PR on azure pipelines
var value = context.EnvironmentVariable("SYSTEM_PULLREQUEST_ISFORK");
return !string.IsNullOrWhiteSpace(value) && !string.Equals(value, false.ToString(), StringComparison.InvariantCultureIgnoreCase);
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion build/utils.cake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GitVersion GetVersion(BuildParameters parameters)

var gitVersion = GitVersion(settings);

if (parameters.EnabledSetVersion)
if (!(parameters.IsRunningOnAzurePipeline && parameters.IsPullRequest))
{
settings.UpdateAssemblyInfo = true;
settings.LogFilePath = "console";
Expand Down

0 comments on commit 8dfa5e9

Please sign in to comment.