Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the logic of dependency check #20040

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@
<Target Name="StaticAnalysis" DependsOnTargets="StaticAnalysisBreakingChange;StaticAnalysisDependency;StaticAnalysisSignature;StaticAnalysisHelp;StaticAnalysisExample;StaticAnalysisFileChange">
<Message Importance="high" Text="Running static analysis..." />

<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />

<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/StaticAnalysis/CollectStaticAnalysisPipelineResult.ps1 -StaticAnalysisOutputDirectory $(StaticAnalysisOutputDirectory) &quot;"/>
<Exec Command="dotnet $(RepoArtifacts)StaticAnalysis/StaticAnalysis.Netcore.dll -p $(RepoArtifacts)$(Configuration) -r $(StaticAnalysisOutputDirectory) --analyzers check-error" />
<OnError ExecuteTargets="StaticAnalysisErrorMessage" />
Expand Down
2 changes: 1 addition & 1 deletion tools/ExecuteCIStep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ If ($StaticAnalysisBreakingChange)
}
Return
}

If ($StaticAnalysisDependency)
{
If ($PSBoundParameters.ContainsKey("TargetModule"))
Expand All @@ -234,6 +233,7 @@ If ($StaticAnalysisDependency)
If ("" -Ne $DependencyCheckModuleList)
{
dotnet $RepoArtifacts/StaticAnalysis/StaticAnalysis.Netcore.dll -p $RepoArtifacts/$Configuration -r $StaticAnalysisOutputDirectory --analyzers dependency -u -m $DependencyCheckModuleList
.($PSScriptRoot + "/CheckAssemblies.ps1") -BuildConfig $Configuration
}
Return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ private static bool IsFrameworkAssembly(string name)

private void ProcessDirectory(string directoryPath)
{
directoryPath = System.IO.Path.GetFullPath(directoryPath);
var savedDirectory = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(directoryPath);
var moduleAlcAssemblySet = LoadModuleAclAssembly(directoryPath);
Expand Down