Skip to content

Commit 2282ca6

Browse files
Add psrp package (#8)
* Add logic for adding PSRP binaries
1 parent 4f5c61d commit 2282ca6

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

build.psm1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ function Start-BuildPowerShellNativePackage
469469
[ValidateScript({Test-Path $_ -PathType Leaf})]
470470
[string] $macOSZipPath,
471471

472+
[Parameter(Mandatory = $true)]
473+
[ValidateScript({Test-Path $_ -PathType Leaf})]
474+
[string] $psrpZipPath,
475+
472476
[Parameter(Mandatory = $true)]
473477
[string] $NuGetOutputPath,
474478

@@ -491,6 +495,7 @@ function Start-BuildPowerShellNativePackage
491495
$BinFolderLinux = Join-Path $tempExtractionPath "Linux"
492496
$BinFolderLinuxARM = Join-Path $tempExtractionPath "LinuxARM"
493497
$BinFolderMacOS = Join-Path $tempExtractionPath "MacOS"
498+
$BinFolderPSRP = Join-Path $tempExtractionPath "PSRP"
494499

495500
Expand-Archive -Path $WindowsX64ZipPath -DestinationPath $BinFolderX64 -Force
496501
Expand-Archive -Path $WindowsX86ZipPath -DestinationPath $BinFolderX86 -Force
@@ -499,10 +504,11 @@ function Start-BuildPowerShellNativePackage
499504
Expand-Archive -Path $LinuxZipPath -DestinationPath $BinFolderLinux -Force
500505
Expand-Archive -Path $LinuxARMZipPath -DestinationPath $BinFolderLinuxARM -Force
501506
Expand-Archive -Path $macOSZipPath -DestinationPath $BinFolderMacOS -Force
507+
Expand-Archive -Path $psrpZipPath -DestinationPath $BinFolderPSRP -Force
502508

503509
PlaceWindowsNativeBinaries -PackageRoot $PackageRoot -BinFolderX64 $BinFolderX64 -BinFolderX86 $BinFolderX86 -BinFolderARM $BinFolderARM -BinFolderARM64 $BinFolderARM64
504510

505-
PlaceUnixBinaries -PackageRoot $PackageRoot -BinFolderLinux $BinFolderLinux -BinFolderLinuxARM $BinFolderLinuxARM -BinFolderOSX $BinFolderMacOS
511+
PlaceUnixBinaries -PackageRoot $PackageRoot -BinFolderLinux $BinFolderLinux -BinFolderLinuxARM $BinFolderLinuxARM -BinFolderOSX $BinFolderMacOS -BinFolderPSRP $BinFolderPSRP
506512

507513
$Nuspec = @'
508514
<?xml version="1.0" encoding="utf-8"?>
@@ -569,7 +575,11 @@ function PlaceUnixBinaries
569575

570576
[Parameter(Mandatory = $true)]
571577
[ValidateScript({Test-Path $_ -PathType Container})]
572-
$BinFolderOSX
578+
$BinFolderOSX,
579+
580+
[Parameter(Mandatory = $true)]
581+
[ValidateScript({Test-Path $_ -PathType Container})]
582+
$BinFolderPSRP
573583
)
574584

575585
$RuntimePathLinux = New-Item -ItemType Directory -Path (Join-Path $PackageRoot -ChildPath 'runtimes/linux-x64/native') -Force
@@ -579,6 +589,12 @@ function PlaceUnixBinaries
579589
Copy-Item "$BinFolderLinux\*" -Destination $RuntimePathLinux -Verbose
580590
Copy-Item "$BinFolderLinuxARM\*" -Destination $RuntimePathLinuxARM -Verbose
581591
Copy-Item "$BinFolderOSX\*" -Destination $RuntimePathOSX -Verbose
592+
593+
## LinuxARM is not supported by PSRP
594+
Get-ChildItem -Recurse $BinFolderPSRP/*.dylib | ForEach-Object { Copy-Item $_.FullName -Destination $RuntimePathOSX -Verbose }
595+
Get-ChildItem -Recurse $BinFolderPSRP/*.so | ForEach-Object { Copy-Item $_.FullName -Destination $RuntimePathLinux -Verbose }
596+
597+
Copy-Item $BinFolderPSRP/version.txt -Destination "$PackageRoot/PSRP_version.txt" -Verbose
582598
}
583599

584600
<#

0 commit comments

Comments
 (0)