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