This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.LicenseHeaderUpdater.
Summary
Modifies the License Headers of all the passed in files
based on the given settings.
Syntax
public static void UpdateLicenseHeaders(this ICakeContext context, IEnumerable<FilePath> files, CakeLicenseHeaderUpdaterSettings settings)
Examples
CakeLicenseHeaderUpdaterSettings settings = new CakeLicenseHeaderUpdaterSettings();
settings.LicenseString =
@"//
// Copyright Seth Hendrick 2019-2020.
// Distributed under the MIT License.
// (See accompanying file LICENSE in the root of the repository).
//";
string old2019String =
@"//
// Copyright Seth Hendrick 2019\.
// Distributed under the MIT License\.
// \(See accompanying file LICENSE in the root of the repository\)\.
//";
settings.OldHeaderRegexPatterns.Add( old2019String );
settings.Threads = 1;
settings.DryRun = true;
settings.Verbosity = Verbosity.Diagnostic;
settings.FileFilter = delegate( FilePath path )
{
if( path.ToString().Contains( "bin" ) )
{
return false;
}
else if( path.ToString().Contains( "obj" ) )
{
return false;
}
return true;
};
CakeLicenseHeaderUpdaterRunner runner = new CakeLicenseHeaderUpdaterRunner( context );
FilePathCollection files = GetFiles( "*.cs");
UpdateLicenseHeaders( files, settings );
Attributes
Type |
Description |
CakeMethodAliasAttribute |
|
CakeAliasCategoryAttribute |
|
CakeNamespaceImportAttribute |
|
Parameters
Return Value