Call GetDocsMsDevLanguageSpecificPackageInfoFn if it's defined (#5468)

Co-authored-by: James Suplizio <jasupliz@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-03-26 15:50:34 -04:00 committed by GitHub
parent 7cf80b5cf7
commit 6cabca1743
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,18 +111,13 @@ function GetPackageInfoJson ($packageInfoJsonLocation) {
$packageInfoJson = Get-Content $packageInfoJsonLocation -Raw
$packageInfo = ConvertFrom-Json $packageInfoJson
if ($GetDocsMsDevLanguageSpecificPackageInfoFn -and (Test-Path "Function:$GetDocsMsDevLanguageSpecificPackageInfoFn")) {
$packageInfo = &$GetDocsMsDevLanguageSpecificPackageInfoFn $packageInfo $PackageSourceOverride
}
# Default: use the dev version from package info as the version for
# downstream processes
if ($packageInfo.DevVersion) {
# If the package is of a dev version there may be language-specific needs to
# specify the appropriate version. For example, in the case of JS, the dev
# version is always 'dev' when interacting with NPM.
if ($GetDocsMsDevLanguageSpecificPackageInfoFn -and (Test-Path "Function:$GetDocsMsDevLanguageSpecificPackageInfoFn")) {
$packageInfo = &$GetDocsMsDevLanguageSpecificPackageInfoFn $packageInfo
}
else {
# Default: use the dev version from package info as the version for
# downstream processes
$packageInfo.Version = $packageInfo.DevVersion
}
$packageInfo.Version = $packageInfo.DevVersion
}
return $packageInfo
}
@ -202,7 +197,7 @@ foreach ($packageInfoLocation in $PackageInfoJsonLocations) {
Write-Host "Validating the packages..."
$packageInfo = GetPackageInfoJson $packageInfoLocation
# This calls a function named "Validate-${Language}-DocMsPackages"
# This calls a function named "Validate-${Language}-DocMsPackages"
# declared in common.ps1, implemented in Language-Settings.ps1
$isValid = &$ValidateDocsMsPackagesFn `
-PackageInfos $packageInfo `
@ -214,7 +209,7 @@ foreach ($packageInfoLocation in $PackageInfoJsonLocations) {
Write-Host "Package validation failed for package: $packageInfoLocation"
$allSucceeded = $false
# Skip the later call to UpdateDocsMsMetadataForPackage because this
# Skip the later call to UpdateDocsMsMetadataForPackage because this
# package has not passed validation
continue
}
@ -229,6 +224,6 @@ foreach ($packageInfoLocation in $PackageInfoJsonLocations) {
# any packages failed validation
if ($allSucceeded) {
Write-Host "##vso[task.setvariable variable=DocsMsPackagesAllValid;]$true"
} else {
} else {
Write-Host "##vso[task.setvariable variable=DocsMsPackagesAllValid;]$false"
}