Skip to content

Commit

Permalink
Merge pull request cake-build#799 from gep13/DupFinderExamples
Browse files Browse the repository at this point in the history
Added DupFinder Sample Code
  • Loading branch information
devlead committed Mar 29, 2016
2 parents 0d24d67 + 9860aee commit 02c3130
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/Cake.Common/Tools/DupFinder/DupFinderAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public static class DupFinderAliases
/// </summary>
/// <param name="context">The context.</param>
/// <param name="file">The file to analyze.</param>
/// <example>
/// <code>
/// DupFinder("./src/MySolution.sln");
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, FilePath file)
Expand All @@ -34,6 +39,24 @@ public static void DupFinder(this ICakeContext context, FilePath file)
/// <param name="context">The context.</param>
/// <param name="file">The file to analyze.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <code>
/// var buildOutputDirectory = Directory("./.build");
/// var resharperReportsDirectory = buildOutputDirectory + Directory("_ReSharperReports");
/// var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory);
///
/// DupFinder("./src/MySolution.sln", new DupFinderSettings {
/// ShowStats = true,
/// ShowText = true,
/// ExcludePattern = new String[]
/// {
/// rootDirectoryPath + "/**/*Designer.cs",
/// },
/// OutputFile = resharperReportsDirectory + File("dupfinder-output.xml"),
/// ThrowExceptionOnFindingDuplicates = true
/// });
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, FilePath file, DupFinderSettings settings)
Expand All @@ -47,6 +70,12 @@ public static void DupFinder(this ICakeContext context, FilePath file, DupFinder
/// </summary>
/// <param name="context">The context.</param>
/// <param name="files">The files to analyze.</param>
/// <example>
/// <code>
/// var projects = GetFiles("./src/**/*.csproj");
/// DupFinder(projects);
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, IEnumerable<FilePath> files)
Expand All @@ -61,6 +90,25 @@ public static void DupFinder(this ICakeContext context, IEnumerable<FilePath> fi
/// <param name="context">The context.</param>
/// <param name="files">The files to analyze.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <code>
/// var buildOutputDirectory = Directory("./.build");
/// var resharperReportsDirectory = buildOutputDirectory + Directory("_ReSharperReports");
/// var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory);
///
/// var projects = GetFiles("./src/**/*.csproj");
/// DupFinder(projects, new DupFinderSettings {
/// ShowStats = true,
/// ShowText = true,
/// ExcludePattern = new String[]
/// {
/// rootDirectoryPath + "/**/*Designer.cs",
/// },
/// OutputFile = resharperReportsDirectory + File("dupfinder-output.xml"),
/// ThrowExceptionOnFindingDuplicates = true
/// });
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, IEnumerable<FilePath> files, DupFinderSettings settings)
Expand All @@ -79,6 +127,11 @@ public static void DupFinder(this ICakeContext context, IEnumerable<FilePath> fi
/// </summary>
/// <param name="context">The context.</param>
/// <param name="pattern">The pattern.</param>
/// <example>
/// <code>
/// DupFinder("*.cs");
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, string pattern)
Expand All @@ -93,6 +146,16 @@ public static void DupFinder(this ICakeContext context, string pattern)
/// <param name="context">The context.</param>
/// <param name="pattern">The pattern.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <code>
/// var buildOutputDirectory = Directory("./.build");
/// var resharperReportsDirectory = buildOutputDirectory + Directory("_ReSharperReports");
///
/// DupFinder("*.cs", new DupFinderSettings {
/// OutputFile = resharperReportsDirectory + File("dupfinder-output.xml"),
/// });
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinder(this ICakeContext context, string pattern, DupFinderSettings settings)
Expand Down Expand Up @@ -123,6 +186,11 @@ public static void DupFinder(this ICakeContext context, string pattern, DupFinde
/// </summary>
/// <param name="context">The context.</param>
/// <param name="configFile">The config file.</param>
/// <example>
/// <code>
/// DupFinder("./src/dupfinder.config");
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("DupFinder")]
public static void DupFinderFromConfig(this ICakeContext context, FilePath configFile)
Expand Down

0 comments on commit 02c3130

Please sign in to comment.