From ff3435f6c8d08d42206f02da9a19803312a71ed3 Mon Sep 17 00:00:00 2001 From: Robert Coltheart Date: Mon, 23 May 2016 22:16:34 +0800 Subject: [PATCH 1/4] Add ability to upload test results when running under AppVeyor --- .../Build/AppVeyor/AppVeyorProviderTests.cs | 32 +++++++++++++++++ .../Build/AppVeyor/AppVeyorProvider.cs | 36 +++++++++++++++++++ .../Build/AppVeyor/AppVeyorTestResultsType.cs | 33 +++++++++++++++++ .../Build/AppVeyor/IAppVeyorProvider.cs | 7 ++++ src/Cake.Common/Build/BuildSystemAliases.cs | 2 ++ src/Cake.Common/Cake.Common.csproj | 1 + 6 files changed, 111 insertions(+) create mode 100644 src/Cake.Common/Build/AppVeyor/AppVeyorTestResultsType.cs diff --git a/src/Cake.Common.Tests/Unit/Build/AppVeyor/AppVeyorProviderTests.cs b/src/Cake.Common.Tests/Unit/Build/AppVeyor/AppVeyorProviderTests.cs index 0ba7f2c7ae..160f9ac4f7 100644 --- a/src/Cake.Common.Tests/Unit/Build/AppVeyor/AppVeyorProviderTests.cs +++ b/src/Cake.Common.Tests/Unit/Build/AppVeyor/AppVeyorProviderTests.cs @@ -198,5 +198,37 @@ public void Should_Update_Build_Version() Arg.Is(p => p.Arguments.Render() == "UpdateBuild -Version \"build-123\"")); } } + + public sealed class TheUploadTestResultsMethod + { + [Fact] + public void Should_Throw_If_Path_Is_Null() + { + // Given + var fixture = new AppVeyorFixture(); + var appVeyor = fixture.CreateAppVeyorService(); + + // When + var result = Record.Exception(() => appVeyor.UploadTestResults(null, AppVeyorTestResultsType.XUnit)); + + // Then + Assert.IsArgumentNullException(result, "path"); + } + + [Fact] + public void Should_Throw_If_Not_Running_On_AppVeyor() + { + // Given + var fixture = new AppVeyorFixture(); + var appVeyor = fixture.CreateAppVeyorService(); + + // When + var result = Record.Exception(() => appVeyor.UploadTestResults("./file.xml", AppVeyorTestResultsType.XUnit)); + + // Then + Assert.IsExceptionWithMessage(result, + "The current build is not running on AppVeyor."); + } + } } } \ No newline at end of file diff --git a/src/Cake.Common/Build/AppVeyor/AppVeyorProvider.cs b/src/Cake.Common/Build/AppVeyor/AppVeyorProvider.cs index e853260e28..43c55d420e 100644 --- a/src/Cake.Common/Build/AppVeyor/AppVeyorProvider.cs +++ b/src/Cake.Common/Build/AppVeyor/AppVeyorProvider.cs @@ -1,4 +1,7 @@ using System; +using System.Globalization; +using System.IO; +using System.Net.Http; using Cake.Common.Build.AppVeyor.Data; using Cake.Core; using Cake.Core.IO; @@ -87,6 +90,39 @@ public void UploadArtifact(FilePath path) _processRunner.Start("appveyor", new ProcessSettings { Arguments = arguments }); } + /// + /// Uploads test results XML file to AppVeyor. Results type can be one of the following: mstest, xunit, nunit, nunit3, junit. + /// + /// The file path of the test results XML to upload. + /// The results type. Can be mstest, xunit, nunit, nunit3 or junit. + public void UploadTestResults(FilePath path, AppVeyorTestResultsType resultsType) + { + if (path == null) + { + throw new ArgumentNullException("path"); + } + + if (!IsRunningOnAppVeyor) + { + throw new CakeException("The current build is not running on AppVeyor."); + } + + var baseUri = _environment.GetEnvironmentVariable("APPVEYOR_URL").TrimEnd('/'); + + if (string.IsNullOrWhiteSpace(baseUri)) + { + throw new CakeException("Failed to get AppVeyor API url."); + } + + var url = string.Format(CultureInfo.InvariantCulture, "{0}/api/testresults/{1}/{2}", baseUri, resultsType, Environment.JobId); + + using (var stream = File.OpenRead(path.FullPath)) + using (var client = new HttpClient()) + { + client.PostAsync(url, new StreamContent(stream)).Wait(); + } + } + /// /// Updates the build version. /// diff --git a/src/Cake.Common/Build/AppVeyor/AppVeyorTestResultsType.cs b/src/Cake.Common/Build/AppVeyor/AppVeyorTestResultsType.cs new file mode 100644 index 0000000000..6a09d1cdab --- /dev/null +++ b/src/Cake.Common/Build/AppVeyor/AppVeyorTestResultsType.cs @@ -0,0 +1,33 @@ +namespace Cake.Common.Build.AppVeyor +{ + /// + /// Provides the known values for the AppVeyor test results types. + /// + public enum AppVeyorTestResultsType + { + /// + /// MSTest test results. + /// + MSTest, + + /// + /// XUnit test results. + /// + XUnit, + + /// + /// NUnit test results. + /// + NUnit, + + /// + /// NUnit v3 test results. + /// + NUnit3, + + /// + /// JUnit test results. + /// + JUnit + } +} diff --git a/src/Cake.Common/Build/AppVeyor/IAppVeyorProvider.cs b/src/Cake.Common/Build/AppVeyor/IAppVeyorProvider.cs index 8ce5cb86d9..ffdc84cdd0 100644 --- a/src/Cake.Common/Build/AppVeyor/IAppVeyorProvider.cs +++ b/src/Cake.Common/Build/AppVeyor/IAppVeyorProvider.cs @@ -30,6 +30,13 @@ public interface IAppVeyorProvider /// The file path of the artifact to upload. void UploadArtifact(FilePath path); + /// + /// Uploads test results XML file to AppVeyor. Results type can be one of the following: mstest, xunit, nunit, nunit3, junit. + /// + /// The file path of the test results XML to upload. + /// The results type. Can be mstest, xunit, nunit, nunit3 or junit. + void UploadTestResults(FilePath path, AppVeyorTestResultsType resultsType); + /// /// Updates the build version. /// diff --git a/src/Cake.Common/Build/BuildSystemAliases.cs b/src/Cake.Common/Build/BuildSystemAliases.cs index f6ece79f03..821f7448c8 100644 --- a/src/Cake.Common/Build/BuildSystemAliases.cs +++ b/src/Cake.Common/Build/BuildSystemAliases.cs @@ -60,6 +60,8 @@ public static BuildSystem BuildSystem(this ICakeContext context) /// The context. /// A instance. [CakePropertyAlias(Cache = true)] + [CakeNamespaceImport("Cake.Common.Build.AppVeyor")] + [CakeNamespaceImport("Cake.Common.Build.AppVeyor.Data")] public static IAppVeyorProvider AppVeyor(this ICakeContext context) { if (context == null) diff --git a/src/Cake.Common/Cake.Common.csproj b/src/Cake.Common/Cake.Common.csproj index 9f5404791b..79c6474062 100644 --- a/src/Cake.Common/Cake.Common.csproj +++ b/src/Cake.Common/Cake.Common.csproj @@ -53,6 +53,7 @@ + From 494acd1f9e36a74052ab8e15b93bd511f6d968bf Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Wed, 1 Jun 2016 19:25:33 +0100 Subject: [PATCH 2/4] (GH-937) Corrected Obsolete Documentation --- src/Cake.Core/Tooling/Tool.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Core/Tooling/Tool.cs b/src/Cake.Core/Tooling/Tool.cs index 2d4355d65d..af6cce8907 100644 --- a/src/Cake.Core/Tooling/Tool.cs +++ b/src/Cake.Core/Tooling/Tool.cs @@ -26,7 +26,7 @@ public abstract class Tool where TSettings : ToolSettings /// The environment. /// The process runner. /// The globber. - [Obsolete("Please use Tool(IFileSystem, ICakeEnvironment, IProcessRunner, IToolService) instead.")] + [Obsolete("Please use Tool(IFileSystem, ICakeEnvironment, IProcessRunner, IToolLocator) instead.")] protected Tool(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IGlobber globber) : this(fileSystem, environment, processRunner, (IToolLocator)null) { From d5075112b6011eede1113abd2f6030c88c2323b1 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Sun, 29 May 2016 20:36:38 +0100 Subject: [PATCH 3/4] (GH-927) Added summary informtion to aliases --- .../Tools/Chocolatey/ChocolateyAliases.cs | 7 ++++++- src/Cake.Common/Tools/DNU/DNUAliases.cs | 2 ++ .../Tools/DotCover/DotCoverAliases.cs | 9 ++++++++- .../Tools/DotNetCore/DotNetCoreAliases.cs | 7 ++++++- .../Tools/DupFinder/DupFinderAliases.cs | 9 ++++++++- src/Cake.Common/Tools/Fixie/FixieAliases.cs | 9 ++++++++- src/Cake.Common/Tools/GitLink/GitLinkAliases.cs | 9 ++++++++- .../GitReleaseManagerAliases.cs | 13 ++++++++++--- .../GitReleaseNotes/GitReleaseNotesAliases.cs | 9 ++++++++- .../Tools/GitVersion/GitVersionAliases.cs | 11 ++++++++--- src/Cake.Common/Tools/ILMerge/ILMergeAliases.cs | 5 +++-- .../Tools/ILRepack/ILRepackAliases.cs | 5 +++-- .../Tools/InspectCode/InspectCodeAliases.cs | 9 ++++++++- src/Cake.Common/Tools/MSBuild/MSBuildAliases.cs | 6 +++++- src/Cake.Common/Tools/MSTest/MSTestAliases.cs | 7 ++++++- src/Cake.Common/Tools/NSIS/NSISAliases.cs | 7 ++++++- src/Cake.Common/Tools/NUnit/NUnit3Aliases.cs | 9 ++++++++- src/Cake.Common/Tools/NUnit/NUnitAliases.cs | 11 +++++++++-- src/Cake.Common/Tools/NuGet/NuGetAliases.cs | 14 +++++++++----- .../Tools/OctopusDeploy/OctopusDeployAliases.cs | 9 ++++++++- .../Tools/OpenCover/OpenCoverAliases.cs | 9 ++++++++- .../ReportGenerator/ReportGeneratorAliases.cs | 9 ++++++++- .../Tools/ReportUnit/ReportUnitAliases.cs | 9 ++++++++- .../Tools/Roundhouse/RoundhouseAliases.cs | 9 ++++++++- .../Tools/SignTool/SignToolSignAliases.cs | 6 +++++- .../Tools/SpecFlow/SpecFlowAliases.cs | 9 ++++++++- .../Tools/TextTransform/TextTransformAliases.cs | 9 ++++++++- src/Cake.Common/Tools/WiX/WiXAliases.cs | 17 ++++++++++++----- src/Cake.Common/Tools/XBuild/XBuildAliases.cs | 6 +++++- src/Cake.Common/Tools/XUnit/XUnit2Aliases.cs | 9 ++++++++- src/Cake.Common/Tools/XUnit/XUnitAliases.cs | 9 ++++++++- 31 files changed, 223 insertions(+), 45 deletions(-) diff --git a/src/Cake.Common/Tools/Chocolatey/ChocolateyAliases.cs b/src/Cake.Common/Tools/Chocolatey/ChocolateyAliases.cs index ad2157af6d..164bdef6a5 100644 --- a/src/Cake.Common/Tools/Chocolatey/ChocolateyAliases.cs +++ b/src/Cake.Common/Tools/Chocolatey/ChocolateyAliases.cs @@ -15,7 +15,12 @@ namespace Cake.Common.Tools.Chocolatey { /// - /// Contains functionality for working with Chocolatey. + /// Contains functionality for working with Chocolatey. + /// + /// In order to use the commands for this alias, Chocolatey will require to be installed on the machine where the build script + /// is being run. See this page for details on how + /// Chocolatey can be installed. + /// /// [CakeAliasCategory("Chocolatey")] public static class ChocolateyAliases diff --git a/src/Cake.Common/Tools/DNU/DNUAliases.cs b/src/Cake.Common/Tools/DNU/DNUAliases.cs index ff66f4c2ad..724d792d72 100644 --- a/src/Cake.Common/Tools/DNU/DNUAliases.cs +++ b/src/Cake.Common/Tools/DNU/DNUAliases.cs @@ -2,6 +2,7 @@ using Cake.Common.Tools.DNU.Build; using Cake.Common.Tools.DNU.Pack; using Cake.Common.Tools.DNU.Restore; +using Cake.Common.Tools.DotNetCore; using Cake.Core; using Cake.Core.Annotations; using Cake.Core.IO; @@ -10,6 +11,7 @@ namespace Cake.Common.Tools.DNU { /// /// Contains functionality for working with the DNU Utility. + /// These aliases have been marked as Obsolete. Use the instead. /// [CakeAliasCategory("DNU")] public static class DNUAliases diff --git a/src/Cake.Common/Tools/DotCover/DotCoverAliases.cs b/src/Cake.Common/Tools/DotCover/DotCoverAliases.cs index 5828537932..86fa683078 100644 --- a/src/Cake.Common/Tools/DotCover/DotCoverAliases.cs +++ b/src/Cake.Common/Tools/DotCover/DotCoverAliases.cs @@ -8,7 +8,14 @@ namespace Cake.Common.Tools.DotCover { /// - /// Contains functionality related to DotCover. + /// Contains functionality related to DotCover. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the appropriate settings class: + /// + /// #tool "nuget:?package=JetBrains.dotCover.CommandLineTools" + /// + /// /// [CakeAliasCategory("DotCover")] public static class DotCoverAliases diff --git a/src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs b/src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs index 0cd06d037b..68ae9667db 100644 --- a/src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs +++ b/src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs @@ -13,7 +13,12 @@ namespace Cake.Common.Tools.DotNetCore { /// - /// Contains functionality for working with the .NET Core CLI. + /// Contains functionality related to .NET Core CLI. + /// + /// In order to use the commands for this alias, the .Net Core CLI tools will need to be installed on the machine where + /// the Cake script is being executed. See this page for information + /// on how to install. + /// /// [CakeAliasCategory("DotNetCore")] public static class DotNetCoreAliases diff --git a/src/Cake.Common/Tools/DupFinder/DupFinderAliases.cs b/src/Cake.Common/Tools/DupFinder/DupFinderAliases.cs index ef9990e5fa..bb5f6a8ac7 100644 --- a/src/Cake.Common/Tools/DupFinder/DupFinderAliases.cs +++ b/src/Cake.Common/Tools/DupFinder/DupFinderAliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.DupFinder { /// - /// Contains functionality related to ReSharper's duplication finder + /// Contains functionality related to ReSharper's dupFinder tool. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=JetBrains.ReSharper.CommandLineTools" + /// + /// /// [CakeAliasCategory("ReSharper")] public static class DupFinderAliases diff --git a/src/Cake.Common/Tools/Fixie/FixieAliases.cs b/src/Cake.Common/Tools/Fixie/FixieAliases.cs index 2a9ca1a1c4..8aa259c0e6 100644 --- a/src/Cake.Common/Tools/Fixie/FixieAliases.cs +++ b/src/Cake.Common/Tools/Fixie/FixieAliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.Fixie { /// - /// Contains functionality related to running Fixie tests. + /// Contains functionality related to running Fixie tests. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=Fixie" + /// + /// /// [CakeAliasCategory("Fixie")] public static class FixieAliases diff --git a/src/Cake.Common/Tools/GitLink/GitLinkAliases.cs b/src/Cake.Common/Tools/GitLink/GitLinkAliases.cs index c7dda3c705..7e4a7fae7b 100644 --- a/src/Cake.Common/Tools/GitLink/GitLinkAliases.cs +++ b/src/Cake.Common/Tools/GitLink/GitLinkAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.GitLink { /// - /// Contains functionality for working with GitLink. + /// Contains functionality related to GitLink. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=gitlink" + /// + /// /// [CakeAliasCategory("GitTools")] public static class GitLinkAliases diff --git a/src/Cake.Common/Tools/GitReleaseManager/GitReleaseManagerAliases.cs b/src/Cake.Common/Tools/GitReleaseManager/GitReleaseManagerAliases.cs index c087c0d808..b24c76de37 100644 --- a/src/Cake.Common/Tools/GitReleaseManager/GitReleaseManagerAliases.cs +++ b/src/Cake.Common/Tools/GitReleaseManager/GitReleaseManagerAliases.cs @@ -11,7 +11,14 @@ namespace Cake.Common.Tools.GitReleaseManager { /// - /// Contains functionality for working with GitReleaseManager. + /// Contains functionality related to GitReleaseManager. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the appropriate settings class: + /// + /// #tool "nuget:?package=gitreleasemanager" + /// + /// /// [CakeAliasCategory("GitReleaseManager")] public static class GitReleaseManagerAliases @@ -249,7 +256,7 @@ public static void GitReleaseManagerPublish(this ICakeContext context, string us { throw new ArgumentNullException("context"); } - + var publisher = new GitReleaseManagerPublisher(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); publisher.Publish(userName, password, owner, repository, tagName, settings); } @@ -305,7 +312,7 @@ public static void GitReleaseManagerExport(this ICakeContext context, string use { throw new ArgumentNullException("context"); } - + var publisher = new GitReleaseManagerExporter(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); publisher.Export(userName, password, owner, repository, fileOutputPath, settings); } diff --git a/src/Cake.Common/Tools/GitReleaseNotes/GitReleaseNotesAliases.cs b/src/Cake.Common/Tools/GitReleaseNotes/GitReleaseNotesAliases.cs index 09d303b4fb..1c1ea35716 100644 --- a/src/Cake.Common/Tools/GitReleaseNotes/GitReleaseNotesAliases.cs +++ b/src/Cake.Common/Tools/GitReleaseNotes/GitReleaseNotesAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.GitReleaseNotes { /// - /// Contains functionality related to GitReleaseNotes + /// Contains functionality related to GitReleaseNotes. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=GitReleaseNotes" + /// + /// /// [CakeAliasCategory("GitReleaseNotes")] public static class GitReleaseNotesAliases diff --git a/src/Cake.Common/Tools/GitVersion/GitVersionAliases.cs b/src/Cake.Common/Tools/GitVersion/GitVersionAliases.cs index 6ca69d737a..76ec0b7446 100644 --- a/src/Cake.Common/Tools/GitVersion/GitVersionAliases.cs +++ b/src/Cake.Common/Tools/GitVersion/GitVersionAliases.cs @@ -5,9 +5,14 @@ namespace Cake.Common.Tools.GitVersion { /// - /// Contains functionality related to GitVersion. - /// GitVersion Documentation - /// GitVersion NuGet Package + /// Contains functionality related to GitVersion. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=GitVersion.CommandLine" + /// + /// /// [CakeAliasCategory("GitVersion")] public static class GitVersionAliases diff --git a/src/Cake.Common/Tools/ILMerge/ILMergeAliases.cs b/src/Cake.Common/Tools/ILMerge/ILMergeAliases.cs index 586a26223b..7add66fb3b 100644 --- a/src/Cake.Common/Tools/ILMerge/ILMergeAliases.cs +++ b/src/Cake.Common/Tools/ILMerge/ILMergeAliases.cs @@ -7,9 +7,10 @@ namespace Cake.Common.Tools.ILMerge { /// - /// Contains functionality related to ILMerge. + /// Contains functionality related to ILMerge. /// - /// In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ILMergeSettings class: + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: /// /// #tool "nuget:?package=ilmerge" /// diff --git a/src/Cake.Common/Tools/ILRepack/ILRepackAliases.cs b/src/Cake.Common/Tools/ILRepack/ILRepackAliases.cs index 87439b63a6..de9785edaa 100644 --- a/src/Cake.Common/Tools/ILRepack/ILRepackAliases.cs +++ b/src/Cake.Common/Tools/ILRepack/ILRepackAliases.cs @@ -7,9 +7,10 @@ namespace Cake.Common.Tools.ILRepack { /// - /// Contains functionality related to ILRepack. + /// Contains functionality related to ILRepack. /// - /// In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the ILRepackSettings class: + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: /// /// #tool "nuget:?package=ILRepack" /// diff --git a/src/Cake.Common/Tools/InspectCode/InspectCodeAliases.cs b/src/Cake.Common/Tools/InspectCode/InspectCodeAliases.cs index 08d60f99fc..7f0c4b2dfa 100644 --- a/src/Cake.Common/Tools/InspectCode/InspectCodeAliases.cs +++ b/src/Cake.Common/Tools/InspectCode/InspectCodeAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.InspectCode { /// - /// Contains functionality related to Resharper's code inspection. + /// Contains functionality related to ReSharper's InspectCode tool. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=JetBrains.ReSharper.CommandLineTools" + /// + /// /// [CakeAliasCategory("ReSharper")] public static class InspectCodeAliases diff --git a/src/Cake.Common/Tools/MSBuild/MSBuildAliases.cs b/src/Cake.Common/Tools/MSBuild/MSBuildAliases.cs index a45949baa8..f9714d01ee 100644 --- a/src/Cake.Common/Tools/MSBuild/MSBuildAliases.cs +++ b/src/Cake.Common/Tools/MSBuild/MSBuildAliases.cs @@ -6,7 +6,11 @@ namespace Cake.Common.Tools.MSBuild { /// - /// Contains functionality related to MSBuild. + /// Contains functionality related to MSBuild. + /// + /// In order to use the commands for this alias, MSBuild will already have to be installed on the machine the Cake Script + /// is being executed. + /// /// [CakeAliasCategory("MSBuild")] public static class MSBuildAliases diff --git a/src/Cake.Common/Tools/MSTest/MSTestAliases.cs b/src/Cake.Common/Tools/MSTest/MSTestAliases.cs index 5dd004f663..e0e1465761 100644 --- a/src/Cake.Common/Tools/MSTest/MSTestAliases.cs +++ b/src/Cake.Common/Tools/MSTest/MSTestAliases.cs @@ -9,7 +9,12 @@ namespace Cake.Common.Tools.MSTest { /// - /// Contains functionality related to running MSTest unit tests. + /// Contains functionality related to running MSTest unit tests. + /// + /// In order to use the commands for this alias, MSTest will need to be installed on the machine where + /// the Cake script is being executed. This is typically achieved by having either Visual Studio installed, or by + /// using the Micrsoft Build Tools, for example, for 2015. + /// /// [CakeAliasCategory("MSTest")] public static class MSTestAliases diff --git a/src/Cake.Common/Tools/NSIS/NSISAliases.cs b/src/Cake.Common/Tools/NSIS/NSISAliases.cs index a4751058b2..ea73ea65fa 100644 --- a/src/Cake.Common/Tools/NSIS/NSISAliases.cs +++ b/src/Cake.Common/Tools/NSIS/NSISAliases.cs @@ -6,7 +6,12 @@ namespace Cake.Common.Tools.NSIS { /// - /// Contains functionality related to running NSIS. + /// Contains functionality related to NSIS. + /// + /// In order to use the commands for this alias, NSIS will need to be installed on the machine where + /// the Cake script is being executed. See this page for information + /// on how to download/install. + /// /// [CakeAliasCategory("NSIS")] // ReSharper disable once InconsistentNaming diff --git a/src/Cake.Common/Tools/NUnit/NUnit3Aliases.cs b/src/Cake.Common/Tools/NUnit/NUnit3Aliases.cs index e85a56eba2..894da623d8 100644 --- a/src/Cake.Common/Tools/NUnit/NUnit3Aliases.cs +++ b/src/Cake.Common/Tools/NUnit/NUnit3Aliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.NUnit { /// - /// Contains functionality related to running NUnit v2 and v3 unit tests. + /// Contains functionality related to running NUnit v2 and v3 unit tests. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=NUnit.ConsoleRunner" + /// + /// /// [CakeAliasCategory("NUnit v3")] public static class NUnit3Aliases diff --git a/src/Cake.Common/Tools/NUnit/NUnitAliases.cs b/src/Cake.Common/Tools/NUnit/NUnitAliases.cs index 20f9cee948..4daa3b26e2 100644 --- a/src/Cake.Common/Tools/NUnit/NUnitAliases.cs +++ b/src/Cake.Common/Tools/NUnit/NUnitAliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.NUnit { /// - /// Contains functionality related to running NUnit unit tests. + /// Contains functionality related to running NUnit tests. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=NUnit.Runners&version=2.6.4" + /// + /// /// [CakeAliasCategory("NUnit")] public static class NUnitAliases @@ -49,7 +56,7 @@ public static void NUnit(this ICakeContext context, string pattern) /// /// /// NUnit("./src/UnitTests/*.dll", new NUnitSettings { - /// Timeout = 4000, + /// Timeout = 4000, /// StopOnError = true /// }); /// diff --git a/src/Cake.Common/Tools/NuGet/NuGetAliases.cs b/src/Cake.Common/Tools/NuGet/NuGetAliases.cs index f7c419f744..aa5256521a 100644 --- a/src/Cake.Common/Tools/NuGet/NuGetAliases.cs +++ b/src/Cake.Common/Tools/NuGet/NuGetAliases.cs @@ -16,8 +16,12 @@ namespace Cake.Common.Tools.NuGet { /// - /// Contains functionality for working with NuGet. + /// Contains functionality for working with NuGet. /// + /// + /// Since Cake requires NuGet to be available very early in the build pipeline, we recommend that NuGet is made + /// available via the Cake BootStrapper. + /// [CakeAliasCategory("NuGet")] public static class NuGetAliases { @@ -693,7 +697,7 @@ public static void NuGetInstallFromConfig(this ICakeContext context, FilePath pa /// /// /// var packageConfigs = GetFiles("./**/packages.config"); - /// + /// /// NuGetInstallFromConfig(packageConfigs); /// /// @@ -744,7 +748,7 @@ public static void NuGetInstallFromConfig(this ICakeContext context, FilePath pa /// /// /// var packageConfigs = GetFiles("./**/packages.config"); - /// + /// /// NuGetInstallFromConfig(packageConfigs, new NuGetInstallSettings { /// ExcludeVersion = true, /// OutputDirectory = "./tools" @@ -894,7 +898,7 @@ public static void NuGetUpdate(this ICakeContext context, FilePath targetFile) /// /// /// var targets = GetFiles("./**/packages.config"); - /// + /// /// NuGetUpdate(targets); /// /// @@ -944,7 +948,7 @@ public static void NuGetUpdate(this ICakeContext context, FilePath targetFile, N /// /// /// var targets = GetFiles("./**/packages.config"); - /// + /// /// NuGetUpdate(targets, new NuGetUpdateSettings { /// Prerelease = true, /// }); diff --git a/src/Cake.Common/Tools/OctopusDeploy/OctopusDeployAliases.cs b/src/Cake.Common/Tools/OctopusDeploy/OctopusDeployAliases.cs index 5aa843cf3e..1c250dbbfa 100644 --- a/src/Cake.Common/Tools/OctopusDeploy/OctopusDeployAliases.cs +++ b/src/Cake.Common/Tools/OctopusDeploy/OctopusDeployAliases.cs @@ -5,7 +5,14 @@ namespace Cake.Common.Tools.OctopusDeploy { /// - /// Contains functionality for working with Octopus Deploy. + /// Contains functionality related to Octopus Deploy. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the appropriate settings class: + /// + /// #tool "nuget:?package=OctopusTools" + /// + /// /// [CakeAliasCategory("Octopus Deploy")] public static class OctopusDeployAliases diff --git a/src/Cake.Common/Tools/OpenCover/OpenCoverAliases.cs b/src/Cake.Common/Tools/OpenCover/OpenCoverAliases.cs index 719a0e7c4e..68a0d483f9 100644 --- a/src/Cake.Common/Tools/OpenCover/OpenCoverAliases.cs +++ b/src/Cake.Common/Tools/OpenCover/OpenCoverAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.OpenCover { /// - /// Contains functionality related to OpenCover. + /// Contains functionality related to OpenCover. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=OpenCover" + /// + /// /// [CakeAliasCategory("OpenCover")] public static class OpenCoverAliases diff --git a/src/Cake.Common/Tools/ReportGenerator/ReportGeneratorAliases.cs b/src/Cake.Common/Tools/ReportGenerator/ReportGeneratorAliases.cs index 1925070193..2dc2fe6f6a 100644 --- a/src/Cake.Common/Tools/ReportGenerator/ReportGeneratorAliases.cs +++ b/src/Cake.Common/Tools/ReportGenerator/ReportGeneratorAliases.cs @@ -7,7 +7,14 @@ namespace Cake.Common.Tools.ReportGenerator { /// - /// Contains functionality related to ReportGenerator. + /// Contains functionality related to ReportGenerator. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=ReportGenerator" + /// + /// /// [CakeAliasCategory("ReportGenerator")] public static class ReportGeneratorAliases diff --git a/src/Cake.Common/Tools/ReportUnit/ReportUnitAliases.cs b/src/Cake.Common/Tools/ReportUnit/ReportUnitAliases.cs index c200e1decb..2450ad7488 100644 --- a/src/Cake.Common/Tools/ReportUnit/ReportUnitAliases.cs +++ b/src/Cake.Common/Tools/ReportUnit/ReportUnitAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.ReportUnit { /// - /// Contains functionality related to ReportUnit. + /// Contains functionality related to ReportUnit. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=ReportUnit" + /// + /// /// [CakeAliasCategory("ReportUnit")] public static class ReportUnitAliases diff --git a/src/Cake.Common/Tools/Roundhouse/RoundhouseAliases.cs b/src/Cake.Common/Tools/Roundhouse/RoundhouseAliases.cs index 86b39f236a..8f8169f503 100644 --- a/src/Cake.Common/Tools/Roundhouse/RoundhouseAliases.cs +++ b/src/Cake.Common/Tools/Roundhouse/RoundhouseAliases.cs @@ -5,7 +5,14 @@ namespace Cake.Common.Tools.Roundhouse { /// - /// Contains functionality to execute Roundhouse tasks. + /// Contains functionality related to RoundhousE. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=roundhouse" + /// + /// /// [CakeAliasCategory("Roundhouse")] public static class RoundhouseAliases diff --git a/src/Cake.Common/Tools/SignTool/SignToolSignAliases.cs b/src/Cake.Common/Tools/SignTool/SignToolSignAliases.cs index 674ff66271..17514b7246 100644 --- a/src/Cake.Common/Tools/SignTool/SignToolSignAliases.cs +++ b/src/Cake.Common/Tools/SignTool/SignToolSignAliases.cs @@ -8,7 +8,11 @@ namespace Cake.Common.Tools.SignTool { /// - /// Contains functionality related to signing assemblies with PFX certificates. + /// Contains functionality related to signing assemblies with PFX certificates using SignTool. + /// + /// In order to use the commands for this alias, SignTool will need to be installed on the machine where + /// the Cake script is being executed. This is typically achieved by installing the correct Windows SDK. + /// /// [CakeAliasCategoryAttribute("Signing")] public static class SignToolSignAliases diff --git a/src/Cake.Common/Tools/SpecFlow/SpecFlowAliases.cs b/src/Cake.Common/Tools/SpecFlow/SpecFlowAliases.cs index 9c2d63f546..996485ab61 100644 --- a/src/Cake.Common/Tools/SpecFlow/SpecFlowAliases.cs +++ b/src/Cake.Common/Tools/SpecFlow/SpecFlowAliases.cs @@ -8,7 +8,14 @@ namespace Cake.Common.Tools.SpecFlow { /// - /// Contains functionality for working with SpecFlow. + /// Contains functionality related to SpecFlow. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the appropriate settings class: + /// + /// #tool "nuget:?package=SpecFlow" + /// + /// /// [CakeAliasCategory("SpecFlow")] public static class SpecFlowAliases diff --git a/src/Cake.Common/Tools/TextTransform/TextTransformAliases.cs b/src/Cake.Common/Tools/TextTransform/TextTransformAliases.cs index 51ef1c6cef..30cde84da2 100644 --- a/src/Cake.Common/Tools/TextTransform/TextTransformAliases.cs +++ b/src/Cake.Common/Tools/TextTransform/TextTransformAliases.cs @@ -6,7 +6,14 @@ namespace Cake.Common.Tools.TextTransform { /// - /// Contains functionality related to transforming templates + /// Contains functionality related to TextTransform. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=Mono.TextTransform" + /// + /// /// [CakeAliasCategory("Text")] public static class TextTransformAliases diff --git a/src/Cake.Common/Tools/WiX/WiXAliases.cs b/src/Cake.Common/Tools/WiX/WiXAliases.cs index 87d4c0a563..65c11df856 100644 --- a/src/Cake.Common/Tools/WiX/WiXAliases.cs +++ b/src/Cake.Common/Tools/WiX/WiXAliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.WiX { /// - /// Contains functionality related to running WiX tools. + /// Contains functionality related to WiX. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the appropriate settings class: + /// + /// #tool "nuget:?package=WiX.Toolset" + /// + /// /// [CakeAliasCategory("WiX")] public static class WiXAliases @@ -23,7 +30,7 @@ public static class WiXAliases /// Architecture = Architecture.X64, /// Verbose = true /// }; - /// WiXCandle("./src/*.wxs", settings); + /// WiXCandle("./src/*.wxs", settings); /// /// /// The context. @@ -58,7 +65,7 @@ public static void WiXCandle(this ICakeContext context, string pattern, CandleSe /// Architecture = Architecture.X64, /// Verbose = true /// }; - /// WiXCandle(files, settings); + /// WiXCandle(files, settings); /// /// /// The context. @@ -85,7 +92,7 @@ public static void WiXCandle(this ICakeContext context, IEnumerable so /// LightSettings settings = new LightSettings { /// RawArguments = "-O1 -pedantic -v" /// }; - /// WiXLight("./src/*.wixobj", settings); + /// WiXLight("./src/*.wixobj", settings); /// /// /// The context. @@ -119,7 +126,7 @@ public static void WiXLight(this ICakeContext context, string pattern, LightSett /// LightSettings settings = new LightSettings { /// RawArguments = "-O1 -pedantic -v" /// }; - /// WiXLight(files, settings); + /// WiXLight(files, settings); /// /// /// The context. diff --git a/src/Cake.Common/Tools/XBuild/XBuildAliases.cs b/src/Cake.Common/Tools/XBuild/XBuildAliases.cs index d78977b7dc..be9a059abb 100644 --- a/src/Cake.Common/Tools/XBuild/XBuildAliases.cs +++ b/src/Cake.Common/Tools/XBuild/XBuildAliases.cs @@ -6,7 +6,11 @@ namespace Cake.Common.Tools.XBuild { /// - /// Contains functionality related to XBuild. + /// Contains functionality related to XBuild. + /// + /// In order to use the commands for this alias, XBuild (which is part of Mono) will already have to be installed on the machine the + /// Cake Script is being executed. + /// /// [CakeAliasCategory("XBuild")] public static class XBuildAliases diff --git a/src/Cake.Common/Tools/XUnit/XUnit2Aliases.cs b/src/Cake.Common/Tools/XUnit/XUnit2Aliases.cs index 42bab36009..e4c083d435 100644 --- a/src/Cake.Common/Tools/XUnit/XUnit2Aliases.cs +++ b/src/Cake.Common/Tools/XUnit/XUnit2Aliases.cs @@ -9,7 +9,14 @@ namespace Cake.Common.Tools.XUnit { /// - /// Contains functionality related to running xUnit.net tests. + /// Contains functionality related to running xunit tests. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=xunit.runner.console" + /// + /// /// [CakeAliasCategory("xUnit v2")] public static class XUnit2Aliases diff --git a/src/Cake.Common/Tools/XUnit/XUnitAliases.cs b/src/Cake.Common/Tools/XUnit/XUnitAliases.cs index 4987134310..2be32ab08a 100644 --- a/src/Cake.Common/Tools/XUnit/XUnitAliases.cs +++ b/src/Cake.Common/Tools/XUnit/XUnitAliases.cs @@ -8,7 +8,14 @@ namespace Cake.Common.Tools.XUnit { /// - /// Contains functionality related to running xUnit.net tests. + /// Contains functionality related to running xunit tests. + /// + /// In order to use the commands for this alias, include the following in your build.cake file to download and + /// install from NuGet.org, or specify the ToolPath within the class: + /// + /// #tool "nuget:?package=xunit.runners&version=1.9.2" + /// + /// /// [CakeAliasCategory("xUnit")] public static class XUnitAliases From ff13b245ca093ec302df5e1b7d80eb203cba76e8 Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Thu, 2 Jun 2016 11:19:04 +0200 Subject: [PATCH 4/4] Fixes invalid AppVeyor check in parameters.cake * Fixes #941 --- build/parameters.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/parameters.cake b/build/parameters.cake index 8fa4aba9eb..8c03ffdfa9 100644 --- a/build/parameters.cake +++ b/build/parameters.cake @@ -56,7 +56,7 @@ public class BuildParameters IsLocalBuild = buildSystem.IsLocalBuild, IsRunningOnUnix = context.IsRunningOnUnix(), IsRunningOnWindows = context.IsRunningOnWindows(), - IsRunningOnAppVeyor = context.IsRunningOnWindows(), + IsRunningOnAppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor, IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest, IsMainCakeRepo = StringComparer.OrdinalIgnoreCase.Equals("cake-build/cake", buildSystem.AppVeyor.Environment.Repository.Name), IsMainCakeBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildSystem.AppVeyor.Environment.Repository.Branch),