Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 6544 (Azure#26554)
Browse files Browse the repository at this point in the history
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#6544 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Daniel Jurek <[email protected]>
  • Loading branch information
azure-sdk and danieljurek authored Jul 20, 2023
1 parent 029380b commit 7528a7a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions eng/common/scripts/Save-Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ an artifact name property is available in the package properties.
Can optionally add a dev version property which can be used logic for daily
builds.
In cases of collisions where track 2 packages (IsNewSdk = true) have the same
filename as track 1 packages (e.g. same artifact name or package name), the
track 2 package properties will be written.
.PARAMETER serviceDirectory
Service directory in which to search for packages
Expand Down Expand Up @@ -87,6 +91,7 @@ function GetRelativePath($path) {
return $relativePath
}

$exportedPaths = @{}
$allPackageProperties = Get-AllPkgProperties $serviceDirectory
if ($allPackageProperties)
{
Expand Down Expand Up @@ -114,6 +119,15 @@ if ($allPackageProperties)
Write-Host "Creating directory $($outDir) for json property file"
New-Item -ItemType Directory -Path $outDir
}

# If package properties for a track 2 (IsNewSdk = true) package has
# already been written, skip writing to that same path.
if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) {
Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export."
continue
}
$exportedPaths[$outputPath] = $pkg

SetOutput $outputPath $pkg
}

Expand Down

0 comments on commit 7528a7a

Please sign in to comment.