Skip to content

Commit

Permalink
Updated build scipts to allow settings artificats path via command line
Browse files Browse the repository at this point in the history
  • Loading branch information
ravensorb committed Jan 7, 2020
1 parent c1acca3 commit 255c76f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:
script: 'build.cake'
target: 'Nuget-Package'
verbosity: 'Verbose'
arguments: '-ArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)'
arguments: '-NugetArtifactsPath=$(Build.ArtifactStagingDirectory) -configuration=$(buildConfiguration)'

- task: VSBuild@1
displayName: 'Build Solution'
Expand All @@ -50,6 +50,7 @@ steps:

- task: PublishTestResults@2
displayName: 'NUnit Tests: Publish results'
enabled: false
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'tests/**/TEST-*.xml'
Expand Down
1 change: 0 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ Task("UnitTest-DotNetCore")
Configuration = settings.Configuration,
Logger = "trx",
ResultsDirectory = settings.Test.ResultsPath,
//VSTestReportPath = settings.Test.ResultsPath,
NoBuild = true
};
Expand Down
12 changes: 11 additions & 1 deletion build.version.json
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
{"Major":1,"Minor":1,"Build":10,"PreRelease":1,"ReleaseNotes":[],"Semantic":null,"Milestone":null,"CakeVersion":"0.33.0.0","IsPreRelease":true}
{
"Major": 1,
"Minor": 1,
"Build": 10,
"PreRelease": 1,
"ReleaseNotes": [],
"Semantic": null,
"Milestone": null,
"CakeVersion": "0.33.0.0",
"IsPreRelease": true
}
22 changes: 14 additions & 8 deletions tools/settingsUtils.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#addin "nuget:?package=Cake.Json&version=4.0.0"
#addin "nuget:?package=Newtonsoft.Json&version=11.0.2"
#addin "nuget:?package=Newtonsoft.Json&version=12.0.3"

using Newtonsoft.Json;

Expand Down Expand Up @@ -71,15 +71,15 @@ public class SettingsUtils

if (obj.NuGet == null) obj.NuGet = new NuGetSettings();

obj.NuGet.BuildType = context.Argument<string>("BuildType", obj.NuGet.BuildType);
obj.NuGet.PublishType = context.Argument<string>("PublishType", obj.NuGet.PublishType);
obj.NuGet.BuildType = context.Argument<string>("NugetBuildType", obj.NuGet.BuildType);
obj.NuGet.PublishType = context.Argument<string>("NugetPublishType", obj.NuGet.PublishType);
obj.NuGet.FeedUrl = context.Argument<string>("nugetFeed", obj.NuGet.FeedUrl);
obj.NuGet.FeedUrl = context.Argument<string>("nugetFeedUrl", obj.NuGet.FeedUrl);
obj.NuGet.ArtifactsPath = context.Argument<string>("Artifacts", obj.NuGet.ArtifactsPath);
obj.NuGet.ArtifactsPath = context.Argument<string>("ArtifactsPath", obj.NuGet.ArtifactsPath);
obj.NuGet.NuSpecPath = context.Argument<string>("NuSpec", obj.NuGet.NuSpecPath);
obj.NuGet.NuSpecPath = context.Argument<string>("NuSpecPath", obj.NuGet.NuSpecPath);
obj.NuGet.NuGetConfig = context.Argument<string>("NuGetConfig", obj.NuGet.NuGetConfig);
obj.NuGet.ArtifactsPath = context.Argument<string>("NugetArtifacts", obj.NuGet.ArtifactsPath);
obj.NuGet.ArtifactsPath = context.Argument<string>("NugetArtifactsPath", obj.NuGet.ArtifactsPath);
obj.NuGet.NuSpecPath = context.Argument<string>("NugetNuspec", obj.NuGet.NuSpecPath);
obj.NuGet.NuSpecPath = context.Argument<string>("NugetNuspecPath", obj.NuGet.NuSpecPath);
obj.NuGet.NuGetConfig = context.Argument<string>("NugetConfig", obj.NuGet.NuGetConfig);

obj.NuGet.FeedApiKey = context.Argument<string>("nugetApiKey", obj.NuGet.FeedApiKey);

Expand All @@ -91,6 +91,12 @@ public class SettingsUtils
obj.NuGet.NuGetConfig = ExpandSettingsPath(obj.NuGet.NuGetConfig, obj.RootPath);
obj.NuGet.FeedUrl = ExpandSettingsPath(obj.NuGet.FeedUrl, obj.RootPath);

if (obj.Test == null) obj.Test = new TestSettings();

obj.Test.SourcePath = context.Argument<string>("TestSourcePath", obj.Test.SourcePath);
obj.Test.ResultsPath = context.Argument<string>("TestResultsPath", obj.Test.ResultsPath);
obj.Test.FileSpec = context.Argument<string>("TestFileSpec", obj.Test.FileSpec);

return obj;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/versionUtils.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#addin "nuget:?package=Cake.Json&version=4.0.0"
#addin "nuget:?package=Newtonsoft.Json&version=11.0.2"
#addin "nuget:?package=Newtonsoft.Json&version=12.0.3"
#addin "nuget:?package=Cake.FileHelpers&version=3.2.1"
#tool "nuget:?package=GitVersion.CommandLine&version=5.1.3"

Expand Down

0 comments on commit 255c76f

Please sign in to comment.