Merge pull request #232 from microsoft/dilan/powershell-osx-specific-buildscripts

PowerShell: OS-specific buildscripts
This commit is contained in:
dilanbhalla
2025-05-15 12:07:22 -07:00
committed by GitHub
4 changed files with 39 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ jobs:
- name: Install PowerShell
run: |
$path = Split-Path (Get-Command codeql).Source
./powershell/build.ps1 $path
./powershell/build-win64.ps1 $path
- name: Run QL tests
run: |
codeql test run --threads=0 powershell/ql/test

View File

@@ -0,0 +1,18 @@
param (
[Parameter(Mandatory=$true)][string]$cliFolder
)
$toolsLinux64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "linux64"
dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsLinux64Folder -r linux-x64
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed"
exit 1
}
$powershellFolder = Join-Path -Path $cliFolder -ChildPath "powershell"
Copy-Item -Path "$PSScriptRoot/codeql-extractor.yml" -Destination $powershellFolder -Force
Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recurse -Force
$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib"
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force
Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force

View File

@@ -0,0 +1,18 @@
param (
[Parameter(Mandatory=$true)][string]$cliFolder
)
$toolsOsx64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "osx64"
dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsOsx64Folder -r osx-x64
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed"
exit 1
}
$powershellFolder = Join-Path -Path $cliFolder -ChildPath "powershell"
Copy-Item -Path "$PSScriptRoot/codeql-extractor.yml" -Destination $powershellFolder -Force
Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recurse -Force
$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib"
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force
Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force

View File

@@ -3,7 +3,7 @@ param (
)
$toolsWin64Folder = Join-Path (Join-Path (Join-Path $cliFolder "powershell") "tools") "win64"
dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsWin64Folder
dotnet publish (Join-Path "$PSScriptRoot/extractor" "powershell.sln" | Resolve-Path) -o $toolsWin64Folder -r win-x64
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed"
exit 1
@@ -15,4 +15,4 @@ Copy-Item -Path "$PSScriptRoot/downgrades" -Destination $powershellFolder -Recur
$qlLibFolder = Join-Path -Path "$PSScriptRoot/ql" -ChildPath "lib"
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme") -Destination $powershellFolder -Force
Copy-Item -Path (Join-Path $qlLibFolder "semmlecode.powershell.dbscheme.stats") -Destination $powershellFolder -Force
Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force
Copy-Item -Path "$PSScriptRoot/tools" -Destination $powershellFolder -Recurse -Force