Skip to content

Commit

Permalink
Sync shared code from arcade (#157)
Browse files Browse the repository at this point in the history
Co-authored-by: dougbu <dougbu@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and dougbu authored Aug 7, 2023
1 parent 27e7513 commit 4ee4979
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Binary file modified eng/common/loc/P22DotNetHtmlLocalization.lss
Binary file not shown.
20 changes: 11 additions & 9 deletions eng/common/sdl/extract-artifact-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,33 @@ try {
param(
[string] $PackagePath # Full path to a NuGet package
)

if (!(Test-Path $PackagePath)) {
Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath"
ExitWithExitCode 1
}

$RelevantExtensions = @('.dll', '.exe', '.pdb')
Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...'

$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId

Add-Type -AssemblyName System.IO.Compression.FileSystem

[System.IO.Directory]::CreateDirectory($ExtractPath);

try {
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)

$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name

[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
$TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName)
[System.IO.Directory]::CreateDirectory($TargetPath);

$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile)
}
}
catch {
Expand Down
9 changes: 9 additions & 0 deletions eng/common/templates/steps/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ steps:
artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt)
continueOnError: true
condition: succeededOrFailed()

# Manually inject component detection so that we can ignore the source build upstream cache, which contains
# a nupkg cache of input packages (a local feed).
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection (Exclude upstream cache)
inputs:
ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/source-build/self/src/artifacts/obj/source-built-upstream-cache'

0 comments on commit 4ee4979

Please sign in to comment.