forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eng/common directory with azure-sdk-tools for PR 4985 (Azure#32682)
* Give the csv flexibility to onboard not new package to Docs.Ms * Use placeholder if the accurate msservice not decided yet * add deprecated message to display name * reformat * typo * Add package helper to common * typo again * Update eng/common/scripts/Helpers/Package-Helpers.ps1 Co-authored-by: Ben Broderick Phillips <[email protected]> Co-authored-by: sima-zhu <[email protected]> Co-authored-by: Sima Zhu <[email protected]> Co-authored-by: Ben Broderick Phillips <[email protected]>
- Loading branch information
Showing
4 changed files
with
44 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,47 @@ | ||
function GetPackageKey($pkg) { | ||
$pkgKey = $pkg.Package | ||
$groupId = $null | ||
|
||
if ($pkg.PSObject.Members.Name -contains "GroupId") { | ||
$groupId = $pkg.GroupId | ||
} | ||
|
||
if ($groupId) { | ||
$pkgKey = "${groupId}:${pkgKey}" | ||
} | ||
|
||
return $pkgKey | ||
$pkgKey = $pkg.Package | ||
$groupId = $null | ||
|
||
if ($pkg.PSObject.Members.Name -contains "GroupId") { | ||
$groupId = $pkg.GroupId | ||
} | ||
|
||
if ($groupId) { | ||
$pkgKey = "${groupId}:${pkgKey}" | ||
} | ||
|
||
return $pkgKey | ||
} | ||
|
||
# Different language needs a different way to index the package. Build a map in convienice to lookup the package. | ||
# E.g. <groupId>:<packageName> is the package key in java. | ||
function GetPackageLookup($packageList) { | ||
$packageLookup = @{} | ||
|
||
foreach ($pkg in $packageList) { | ||
$pkgKey = GetPackageKey $pkg | ||
|
||
# We want to prefer updating non-hidden packages but if there is only | ||
# a hidden entry then we will return that | ||
if (!$packageLookup.ContainsKey($pkgKey) -or $packageLookup[$pkgKey].Hide -eq "true") { | ||
$packageLookup[$pkgKey] = $pkg | ||
} | ||
else { | ||
# Warn if there are more then one non-hidden package | ||
if ($pkg.Hide -ne "true") { | ||
Write-Host "Found more than one package entry for $($pkg.Package) selecting the first non-hidden one." | ||
} | ||
# Different language needs a different way to index the package. Build a map in convienice to lookup the package. | ||
# E.g. <groupId>:<packageName> is the package key in java. | ||
function GetPackageLookup($packageList) { | ||
$packageLookup = @{} | ||
|
||
foreach ($pkg in $packageList) { | ||
$pkgKey = GetPackageKey $pkg | ||
|
||
# We want to prefer updating non-hidden packages but if there is only | ||
# a hidden entry then we will return that | ||
if (!$packageLookup.ContainsKey($pkgKey) -or $packageLookup[$pkgKey].Hide -eq "true") { | ||
$packageLookup[$pkgKey] = $pkg | ||
} | ||
else { | ||
# Warn if there are more then one non-hidden package | ||
if ($pkg.Hide -ne "true") { | ||
Write-Host "Found more than one package entry for $($pkg.Package) selecting the first non-hidden one." | ||
} | ||
} | ||
return $packageLookup | ||
} | ||
return $packageLookup | ||
} | ||
|
||
# For deprecated packages, add "(deprecated)" besides of display name. | ||
function GetDocsTocDisplayName($pkg) { | ||
$displayName = $pkg.DisplayName | ||
if ('deprecated' -eq $pkg.Support) { | ||
LogWarning "The pkg $($pkg.Package) is deprecated. Adding 'deprecated' beside the display name." | ||
$displayName += " (deprecated)" | ||
} | ||
return $displayName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters