mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-01 18:13:08 +08:00
White-listing packages.config as None target in projects
This commit is contained in:
parent
0e6955c624
commit
e587a48e75
@ -109,7 +109,7 @@
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<Content Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
@ -95,7 +95,7 @@
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<Content Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
@ -108,13 +108,18 @@ namespace MSBuild.Orchard.Tasks {
|
||||
}
|
||||
|
||||
private static bool IsValidExcludeFile(string filePath) {
|
||||
var validFilenames = new[] { "packages.config" };
|
||||
var validExtensions = new[] { ".sass", ".scss", ".less", ".coffee", ".ls", ".ts", ".md", ".docx" };
|
||||
if (string.IsNullOrEmpty(filePath)) return true;
|
||||
|
||||
var fileExtension = Path.GetExtension(filePath);
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
if (string.IsNullOrEmpty(fileExtension)) return false;
|
||||
|
||||
return validExtensions.Contains(fileExtension, StringComparer.InvariantCultureIgnoreCase);
|
||||
return
|
||||
validExtensions.Contains(fileExtension, StringComparer.InvariantCultureIgnoreCase) ||
|
||||
validFilenames.Contains(filePath, StringComparer.InvariantCultureIgnoreCase)
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckCodeAnalysisRuleSet(XDocument document) {
|
||||
|
Loading…
Reference in New Issue
Block a user