diff --git a/Source/Cake.Recipe/Content/analyzing.cake b/Source/Cake.Recipe/Content/analyzing.cake index 2c66ba08..8e0c2fba 100644 --- a/Source/Cake.Recipe/Content/analyzing.cake +++ b/Source/Cake.Recipe/Content/analyzing.cake @@ -1,42 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // TASK DEFINITIONS /////////////////////////////////////////////////////////////////////////////// -BuildParameters.Tasks.DupFinderTask = Task("DupFinder") - .WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping due to not running on Windows") - .WithCriteria(() => BuildParameters.ShouldRunDupFinder, "Skipping because DupFinder has been disabled") - .Does(() => RequireTool(ToolSettings.ReSharperTools, () => { - var dupFinderLogFilePath = BuildParameters.Paths.Directories.DupFinderTestResults.CombineWithFilePath("dupfinder.xml"); - - var settings = new DupFinderSettings() { - ShowStats = true, - ShowText = true, - OutputFile = dupFinderLogFilePath, - ExcludeCodeRegionsByNameSubstring = new string [] { "DupFinder Exclusion" }, - ThrowExceptionOnFindingDuplicates = ToolSettings.DupFinderThrowExceptionOnFindingDuplicates ?? true - }; - - if (ToolSettings.DupFinderExcludePattern != null) - { - settings.ExcludePattern = ToolSettings.DupFinderExcludePattern; - } - - if (ToolSettings.DupFinderExcludeFilesByStartingCommentSubstring != null) - { - settings.ExcludeFilesByStartingCommentSubstring = ToolSettings.DupFinderExcludeFilesByStartingCommentSubstring; - } - - if (ToolSettings.DupFinderDiscardCost != null) - { - settings.DiscardCost = ToolSettings.DupFinderDiscardCost.Value; - } - - DupFinder(BuildParameters.SolutionFilePath, settings); - - // Pass path to dupFinder log file to Cake.Issues.Recipe - IssuesParameters.InputFiles.DupFinderLogFilePath = dupFinderLogFilePath; - }) -); - BuildParameters.Tasks.InspectCodeTask = Task("InspectCode") .WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping due to not running on Windows") .WithCriteria(() => BuildParameters.ShouldRunInspectCode, "Skipping because InspectCode has been disabled") @@ -61,5 +25,4 @@ BuildParameters.Tasks.InspectCodeTask = Task("InspectCode") ); BuildParameters.Tasks.AnalyzeTask = Task("Analyze") - .IsDependentOn("DupFinder") .IsDependentOn("InspectCode"); diff --git a/Source/Cake.Recipe/Content/build.cake b/Source/Cake.Recipe/Content/build.cake index 181cd7f0..7b56f611 100644 --- a/Source/Cake.Recipe/Content/build.cake +++ b/Source/Cake.Recipe/Content/build.cake @@ -118,7 +118,6 @@ BuildParameters.Tasks.ShowInfoTask = Task("Show-Info") Information("IsTagged: {0}", BuildParameters.IsTagged); Information("Solution FilePath: {0}", MakeAbsolute((FilePath)BuildParameters.SolutionFilePath)); - Information("Solution DirectoryPath: {0}", MakeAbsolute((DirectoryPath)BuildParameters.SolutionDirectoryPath)); Information("Source DirectoryPath: {0}", MakeAbsolute(BuildParameters.SourceDirectoryPath)); Information("Build DirectoryPath: {0}", MakeAbsolute(BuildParameters.Paths.Directories.Build)); }); @@ -504,7 +503,6 @@ public class Builder BuildParameters.Tasks.CreateNuGetPackagesTask.IsDependentOn(prefix + "Build"); BuildParameters.Tasks.CreateChocolateyPackagesTask.IsDependentOn(prefix + "Build"); BuildParameters.Tasks.TestTask.IsDependentOn(prefix + "Build"); - BuildParameters.Tasks.DupFinderTask.IsDependentOn(prefix + "Build"); BuildParameters.Tasks.InspectCodeTask.IsDependentOn(prefix + "Build"); BuildParameters.Tasks.PackageTask.IsDependentOn("Analyze"); BuildParameters.Tasks.PackageTask.IsDependentOn("Test"); diff --git a/Source/Cake.Recipe/Content/parameters.cake b/Source/Cake.Recipe/Content/parameters.cake index af0d9b79..8aa8d189 100644 --- a/Source/Cake.Recipe/Content/parameters.cake +++ b/Source/Cake.Recipe/Content/parameters.cake @@ -94,7 +94,6 @@ public static class BuildParameters public static DirectoryPath RootDirectoryPath { get; private set; } public static FilePath SolutionFilePath { get; private set; } public static DirectoryPath SourceDirectoryPath { get; private set; } - public static DirectoryPath SolutionDirectoryPath { get; private set; } public static DirectoryPath TestDirectoryPath { get; private set; } public static FilePath IntegrationTestScriptPath { get; private set; } public static string TestFilePattern { get; private set; } @@ -122,7 +121,6 @@ public static class BuildParameters public static FilePath MilestoneReleaseNotesFilePath { get; private set; } public static FilePath FullReleaseNotesFilePath { get; private set; } - public static bool ShouldRunDupFinder { get; private set; } public static bool ShouldRunInspectCode { get; private set; } public static bool ShouldRunCoveralls { get; private set; } public static bool ShouldRunCodecov { get; private set; } @@ -345,7 +343,6 @@ public static class BuildParameters DirectoryPath sourceDirectoryPath, string title, FilePath solutionFilePath = null, - DirectoryPath solutionDirectoryPath = null, DirectoryPath rootDirectoryPath = null, DirectoryPath testDirectoryPath = null, string testFilePattern = null, @@ -371,7 +368,6 @@ public static class BuildParameters bool shouldPublishGitHub = true, bool shouldGenerateDocumentation = true, bool shouldDocumentSourceFiles = true, - bool shouldRunDupFinder = true, bool shouldRunInspectCode = true, bool shouldRunCoveralls = true, bool shouldRunCodecov = true, @@ -433,7 +429,6 @@ public static class BuildParameters SourceDirectoryPath = sourceDirectoryPath; Title = title; SolutionFilePath = solutionFilePath ?? SourceDirectoryPath.CombineWithFilePath(Title + ".sln"); - SolutionDirectoryPath = solutionDirectoryPath ?? SourceDirectoryPath.Combine(Title); RootDirectoryPath = rootDirectoryPath ?? context.MakeAbsolute(context.Environment.WorkingDirectory); TestDirectoryPath = testDirectoryPath ?? sourceDirectoryPath; TestFilePattern = testFilePattern; @@ -471,7 +466,6 @@ public static class BuildParameters ShouldDownloadMilestoneReleaseNotes = shouldDownloadMilestoneReleaseNotes; ShouldNotifyBetaReleases = shouldNotifyBetaReleases; ShouldDeleteCachedFiles = shouldDeleteCachedFiles; - ShouldRunDupFinder = shouldRunDupFinder; ShouldRunInspectCode = shouldRunInspectCode; ShouldRunCoveralls = shouldRunCoveralls; ShouldRunCodecov = shouldRunCodecov; diff --git a/Source/Cake.Recipe/Content/paths.cake b/Source/Cake.Recipe/Content/paths.cake index 7b9d3b1c..33a1c612 100644 --- a/Source/Cake.Recipe/Content/paths.cake +++ b/Source/Cake.Recipe/Content/paths.cake @@ -27,7 +27,6 @@ public class BuildPaths var testResultsDirectory = buildDirectoryPath + "/TestResults"; var inspectCodeResultsDirectory = testResultsDirectory + "/InspectCode"; - var dupFinderResultsDirectory = testResultsDirectory + "/DupFinder"; var NUnitTestResultsDirectory = testResultsDirectory + "/NUnit"; var xUnitTestResultsDirectory = testResultsDirectory + "/xUnit"; var MSTestTestResultsDirectory = testResultsDirectory + "/MSTest"; @@ -64,7 +63,6 @@ public class BuildPaths chocolateyNuspecDirectory, testResultsDirectory, inspectCodeResultsDirectory, - dupFinderResultsDirectory, NUnitTestResultsDirectory, xUnitTestResultsDirectory, MSTestTestResultsDirectory, @@ -145,7 +143,6 @@ public class BuildDirectories public DirectoryPath ChocolateyNuspecDirectory { get; private set; } public DirectoryPath TestResults { get; private set; } public DirectoryPath InspectCodeTestResults { get; private set; } - public DirectoryPath DupFinderTestResults { get; private set; } public DirectoryPath NUnitTestResults { get; private set; } public DirectoryPath xUnitTestResults { get; private set; } public DirectoryPath MSTestTestResults { get; private set; } @@ -171,7 +168,6 @@ public class BuildDirectories DirectoryPath chocolateyNuspecDirectory, DirectoryPath testResults, DirectoryPath inspectCodeTestResults, - DirectoryPath dupFinderTestResults, DirectoryPath nunitTestResults, DirectoryPath xunitTestResults, DirectoryPath msTestTestResults, @@ -196,7 +192,6 @@ public class BuildDirectories ChocolateyNuspecDirectory = chocolateyNuspecDirectory; TestResults = testResults; InspectCodeTestResults = inspectCodeTestResults; - DupFinderTestResults = dupFinderTestResults; NUnitTestResults = nunitTestResults; xUnitTestResults = xunitTestResults; MSTestTestResults = msTestTestResults; diff --git a/Source/Cake.Recipe/Content/tasks.cake b/Source/Cake.Recipe/Content/tasks.cake index 596d40f5..3de8bcf3 100644 --- a/Source/Cake.Recipe/Content/tasks.cake +++ b/Source/Cake.Recipe/Content/tasks.cake @@ -1,6 +1,5 @@ public class BuildTasks { - public CakeTaskBuilder DupFinderTask { get; set; } public CakeTaskBuilder InspectCodeTask { get; set; } public CakeTaskBuilder AnalyzeTask { get; set; } public CakeTaskBuilder PrintCiProviderEnvironmentVariablesTask { get; set; } diff --git a/Source/Cake.Recipe/Content/toolsettings.cake b/Source/Cake.Recipe/Content/toolsettings.cake index 62b80c66..6c6882be 100644 --- a/Source/Cake.Recipe/Content/toolsettings.cake +++ b/Source/Cake.Recipe/Content/toolsettings.cake @@ -5,10 +5,6 @@ public static class ToolSettings SetToolPreprocessorDirectives(); } - public static string[] DupFinderExcludePattern { get; private set; } - public static string[] DupFinderExcludeFilesByStartingCommentSubstring { get; private set; } - public static int? DupFinderDiscardCost { get; private set; } - public static bool? DupFinderThrowExceptionOnFindingDuplicates { get; private set; } public static string TestCoverageFilter { get; private set; } public static string TestCoverageExcludeByAttribute { get; private set; } public static string TestCoverageExcludeByFile { get; private set; } @@ -90,7 +86,6 @@ public static class ToolSettings public static void SetToolSettings( ICakeContext context, - string[] dupFinderExcludePattern = null, string testCoverageFilter = null, string testCoverageExcludeByAttribute = null, string testCoverageExcludeByFile = null, @@ -98,25 +93,12 @@ public static class ToolSettings MSBuildToolVersion buildMSBuildToolVersion = MSBuildToolVersion.Default, int? maxCpuCount = null, DirectoryPath targetFrameworkPathOverride = null, - string[] dupFinderExcludeFilesByStartingCommentSubstring = null, - int? dupFinderDiscardCost = null, - bool? dupFinderThrowExceptionOnFindingDuplicates = null, bool skipDuplicatePackages = false ) { context.Information("Setting up tools..."); var absoluteTestDirectory = context.MakeAbsolute(BuildParameters.TestDirectoryPath); - var absoluteSourceDirectory = context.MakeAbsolute(BuildParameters.SolutionDirectoryPath); - DupFinderExcludePattern = dupFinderExcludePattern ?? - new string[] - { - string.Format("{0}/{1}.Tests/**/*.cs", absoluteTestDirectory, BuildParameters.Title), - string.Format("{0}/**/*.AssemblyInfo.cs", absoluteSourceDirectory) - }; - DupFinderExcludeFilesByStartingCommentSubstring = dupFinderExcludeFilesByStartingCommentSubstring; - DupFinderDiscardCost = dupFinderDiscardCost; - DupFinderThrowExceptionOnFindingDuplicates = dupFinderThrowExceptionOnFindingDuplicates; TestCoverageFilter = testCoverageFilter ?? string.Format("+[{0}*]* -[*.Tests]*", BuildParameters.Title); TestCoverageExcludeByAttribute = testCoverageExcludeByAttribute ?? "*.ExcludeFromCodeCoverage*"; TestCoverageExcludeByFile = testCoverageExcludeByFile ?? "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"; diff --git a/docs/input/docs/fundamentals/recipe-cake.md b/docs/input/docs/fundamentals/recipe-cake.md index e80aba2c..eb07a0df 100644 --- a/docs/input/docs/fundamentals/recipe-cake.md +++ b/docs/input/docs/fundamentals/recipe-cake.md @@ -22,7 +22,6 @@ BuildParameters.SetParameters(context: Context, BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings(context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/Source/Cake.Example.Tests/*.cs", BuildParameters.RootDirectoryPath + "/Source/Cake.Example/**/*.AssemblyInfo.cs" }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ", @@ -50,6 +49,6 @@ This recipe.cake file is broken up to distinct sections, some of which have more * A call to the [BuildParameters.PrintParameters](./print-parameters) method * It is really helpful, when running a build to know the value of the parameters that are being used. Calling this method will cause them to be printed out to the build log. * A call to the [ToolSettings.SetToolSettings](./set-tool-settings) method - * Cake.Recipe uses a number of different tools, for example, DupFinder. When required, you can override the settings that are passed to these tools. Cake.Recipe attempts to provide sensible defaults for these tools. + * Cake.Recipe uses a number of different tools, for example, InspectCode. When required, you can override the settings that are passed to these tools. Cake.Recipe attempts to provide sensible defaults for these tools. * A call to one of the three available [Build](./build) methods * Cake.Recipe has three different build modes. .NET Framework, .NET Core and NuGet. Depending on what you are doing, you call the required one here. This method is what causes the actual build to execute. diff --git a/docs/input/docs/fundamentals/set-parameters.md b/docs/input/docs/fundamentals/set-parameters.md index 54da6e43..ae541eab 100644 --- a/docs/input/docs/fundamentals/set-parameters.md +++ b/docs/input/docs/fundamentals/set-parameters.md @@ -13,7 +13,6 @@ BuildParameters.SetParameters(context: Context, buildSystem: BuildSystem, sourceDirectoryPath: "./Source", solutionFilePath: "./Source/ChocolateyGui.sln", - solutionDirectoryPath: "./Source/ChocolateyGui", resharperSettingsFileName: "ChocolateyGui.sln.DotSettings", title: "Chocolatey GUI", repositoryOwner: "chocolatey", @@ -74,18 +73,6 @@ Default Value: SourceDirectoryPath.CombineWithFilePath(Title + ".sln") ``` -### solutionDirectoryPath - -This value is only used to feed into the default value for the DupFinderExcludePattern, which can be overridden in the SetToolSettings method. - -Type: `DirectoryPath` - -Default Value: - -```csharp -SourceDirectoryPath.Combine(Title) -``` - ### rootDirectoryPath This is intended to store the root directory path for the repository that Cake.Recipe is running in. This is derived from the WorkingDirectory of Cake by default. @@ -382,18 +369,6 @@ Default Value: true ``` -### shouldRunDupFinder - -This is used as a final control variable for whether or not the DupFinder tool should be executed as part of the build. - -Type: `bool` - -Default Value: - -```csharp -true -``` - ### shouldRunInspectCode This is used as a final control variable for whether or not the InspectCode tool should be executed as part of the build. diff --git a/docs/input/docs/fundamentals/set-tool-settings.md b/docs/input/docs/fundamentals/set-tool-settings.md index 9e2cf835..beb28d2d 100644 --- a/docs/input/docs/fundamentals/set-tool-settings.md +++ b/docs/input/docs/fundamentals/set-tool-settings.md @@ -4,7 +4,7 @@ Title: SetToolSettings Method Description: Override the default tool settings used by Cake.Recipe --- -Cake.Recipe makes use of a number of different tools, for example DupFinder, MSBuild, OpenCover, etc. While Cake.Recipe attempts to provide sensible defaults for all of these tools, there are times when it is necessary to override these for specific project requirements. +Cake.Recipe makes use of a number of different tools, for example InspectCode, MSBuild, OpenCover, etc. While Cake.Recipe attempts to provide sensible defaults for all of these tools, there are times when it is necessary to override these for specific project requirements. This can be done by calling the `SetToolSettings` method. @@ -12,7 +12,6 @@ As an example, you could override some tool settings using the following: ```csharp ToolSettings.SetToolSettings(context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/Source/Cake.Example.Tests/*.cs", BuildParameters.RootDirectoryPath + "/Source/Cake.Example/**/*.AssemblyInfo.cs" }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ", @@ -24,24 +23,6 @@ ToolSettings.SetToolSettings(context: Context, The `SetToolSettings` method uses the concept of optional parameters, in fact, all but one of the parameters to the `SetToolSettings` method are optional. To override a specific tool setting, you need to use a named parameter. The following is a list of all the named parameters that can be used on the method. -### dupFinderExcludePattern - -This is used when executing the DupFinder command line tool. It provides a list of strings, representing file paths, which should be excluded from the DupFinder analysis. - -Type: `string[]` - -Default Value: - -```csharp -var absoluteSourceDirectory = context.MakeAbsolute(BuildParameters.SolutionDirectoryPath); - -new string[] - { - string.Format("{0}/{1}.Tests/**/*.cs", absoluteTestDirectory, BuildParameters.Title), - string.Format("{0}/**/*.AssemblyInfo.cs", absoluteSourceDirectory) - } -``` - ### testCoverageFilter This is used in conjunction with both OpenCover and Coverlet. It controls which assemblies/namespaces should be included within the Unit Test coverage. @@ -138,30 +119,6 @@ If a value for `targetFrameworkPathOverride` is provided, then the default value TargetFrameworkPathOverride = targetFrameworkPathOverride?.FullPath; ``` -### dupFinderExcludeFilesByStartingCommentSubstring - -This is used when executing the DupFinder command line tool. It provides a list of strings, which should be matched in the opening comments of a file, which should be excluded from the DupFinder analysis. - -Type: `string[]` - -Default Value: `null` - -### dupFinderDiscardCost - -This is used when executing the DupFinder command line tool. It allows setting a threshold for code complexity of the duplicated fragments. The fragments with lower complexity are discarded as non-duplicates. - -Type: `int?` - -Default Value: `null` - -### dupFinderThrowExceptionOnFindingDuplicates - -This is used when executing the DupFinder command line tool. If set to true, an exception will be thrown is duplicates are found. - -Type: `bool?` - -Default Value: `null` - ### skipDuplicatesPackages This is used to tell NuGet to ignore issues with trying to push package versions when the version already exist upstream, instead of failing the build. diff --git a/recipe.cake b/recipe.cake index 2145530d..dee59937 100644 --- a/recipe.cake +++ b/recipe.cake @@ -19,7 +19,6 @@ BuildParameters.SetParameters(context: Context, repositoryName: "Cake.Recipe", appVeyorAccountName: "cakecontrib", shouldRunInspectCode: false, - shouldRunDupFinder: false, shouldRunCoveralls: false, shouldRunCodecov: false, shouldRunDotNetCorePack: true,