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

fix: dependency graph generator #3901

Merged
merged 7 commits into from
Aug 19, 2021
Merged
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
11 changes: 7 additions & 4 deletions build/AnalyzeDependencies/AnalyzeDepsJS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<#
.SYNOPSIS
Generate a dependency report for a set of .tgz files
Generate a dependency report for a set of .tgz files.
.PARAMETER PackagesPath
The path to the package(s) to analyze. Globs are supported.
.PARAMETER LockfilePath
Expand Down Expand Up @@ -44,7 +44,7 @@ Function Get-PackageJson($NupkgPath) {

Function Expand-Tar($tarFile, $dest) {
if (-not (Get-Command Expand-7Zip -ErrorAction Ignore)) {
Install-Package -Scope CurrentUser -Force 7Zip4PowerShell > $null
Install-Package -Scope CurrentUser -Force 7Zip4PowerShell -RequiredVersion "2.0.0" > $null
}
Expand-7Zip $tarFile $dest
# Expand the inner tar file
Expand Down Expand Up @@ -126,12 +126,14 @@ $Pkgs = @{ }
$Deps = @{ }
Resolve-Path $PackagesPath

" ";

foreach ($PkgFile in Resolve-Path $PackagesPath) {
$PackageJson = Get-PackageJson $PkgFile
$LibraryName = $PackageJson.name
$LibraryVer = $PackageJson.version

Write-Host $LibraryName
"Library: $LibraryName $LibraryVer";

$Pkgs[$LibraryName] = @{ Ver = $LibraryVer; Src = $PkgFile; Deps = New-Object System.Collections.ArrayList }
$PkgDeps = @{ }
Expand Down Expand Up @@ -166,7 +168,8 @@ foreach ($PkgFile in Resolve-Path $PackagesPath) {
}
}

Write-Host "Analyzing $($Pkgs.Count) packages..."
Write-Host " ";
Write-Host "Analyzing $($Pkgs.Count) packages...";

# Precompute some derived data for the template
$External = $Deps.Keys | Where-Object { -not ($Pkgs.ContainsKey($_)) }
Expand Down