Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.

Commit eff4b4c

Browse files
committed
filter Apache copyright comments
1 parent 8859b67 commit eff4b4c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Microsoft.Content.Build.Code2Yaml.Steps/PreprocessXml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ public class PreprocessXml : IStep
2222
private static readonly Regex ToRegularizeTypeRegex = new Regex(@"^(public|protected|private)(?=.*?<.*?>)", RegexOptions.Compiled);
2323
private static readonly Regex TemplateLeftTagRegex = new Regex(@"(<)\s*", RegexOptions.Compiled);
2424
private static readonly Regex TemplateRightTagRegex = new Regex(@"\s*(>)", RegexOptions.Compiled);
25-
private static readonly string CopyRightComment = @"Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information.";
25+
private static IReadOnlyList<string> CopyRightCommentCollection = new List<string>
26+
{
27+
@"Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information.",
28+
@"Copyright Microsoft Corporation",
29+
@"Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0",
30+
@"Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
31+
};
2632

2733
public string StepName { get { return "Preprocess"; } }
2834

@@ -155,7 +161,7 @@ await Directory.EnumerateFiles(inputPath, "*.xml").ForEachInParallelAsync(
155161
// remove copyright comment
156162
foreach (var node in doc.XPathSelectElements("//para").ToList())
157163
{
158-
if (node.Value.Trim() == CopyRightComment)
164+
if (CopyRightCommentCollection.Contains(node.Value.Trim()))
159165
{
160166
node.Remove();
161167
}

0 commit comments

Comments
 (0)