Skip to content

Commit

Permalink
Update onebranch scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Sep 20, 2024
1 parent 83659ec commit 4fc0195
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 21 additions & 1 deletion scripts/onebranch/post-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,23 @@ elseif ($OneBranchConfig -eq "NativeOnlyRelease" -and $OneBranchArch -eq "x64")
xcopy /y build\bin\x64_NativeOnlyRelease .\x64\NativeOnlyRelease
Get-ChildItem -Path .\build\bin\x64_NativeOnlyRelease -Recurse | Remove-Item -Force -Recurse
}
elseif ($OneBranchConfig -eq "NativeOnlyDebug" -and $OneBranchArch -eq "arm64")
{
xcopy /y build\bin\x64_NativeOnlyDebug .\x64\NativeOnlyDebug
Get-ChildItem -Path .\build\bin\x64_NativeOnlyDebug -Recurse | Remove-Item -Force -Recurse
}
elseif ($OneBranchConfig -eq "NativeOnlyRelease" -and $OneBranchArch -eq "arm64")
{
xcopy /y build\bin\arm64_NativeOnlyRelease .\arm64\NativeOnlyRelease
Get-ChildItem -Path .\build\bin\arm64_NativeOnlyRelease -Recurse | Remove-Item -Force -Recurse
}
else
{
throw ("Configuration $OneBranchConfig|$OneBranchArch is not supported.")
}

Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" -DevCmdArguments "-arch=x64 -host_arch=x64"
Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" -DevCmdArguments "-arch=$OneBranchArch -host_arch=x64"
Set-Location $scriptPath\..\..
$SolutionDir = Get-Location
msbuild /p:SolutionDir=$SolutionDir\ /p:Configuration=$OneBranchConfig /p:Platform=$OneBranchArch /p:BuildProjectReferences=false .\tools\nuget\nuget.vcxproj
Expand All @@ -47,6 +57,16 @@ elseif ($OneBranchConfig -eq "NativeOnlyRelease" -and $OneBranchArch -eq "x64")
xcopy /y .\x64\NativeOnlyRelease\*.nupkg .\build\bin\x64_NativeOnlyRelease
xcopy /y .\x64\NativeOnlyRelease\*.msi .\build\bin\x64_NativeOnlyRelease
}
elseif ($OneBranchConfig -eq "NativeOnlyDebug" -and $OneBranchArch -eq "arm64")
{
xcopy /y .\arm64\NativeOnlyDebug\*.nupkg .\build\bin\arm64_NativeOnlyDebug
xcopy /y .\arm64\NativeOnlyDebug\*.msi .\build\bin\arm64_NativeOnlyDebug
}
elseif ($OneBranchConfig -eq "NativeOnlyRelease" -and $OneBranchArch -eq "arm64")
{
xcopy /y .\arm64\NativeOnlyRelease\*.nupkg .\build\bin\arm64_NativeOnlyRelease
xcopy /y .\arm64\NativeOnlyRelease\*.msi .\build\bin\xarm4_NativeOnlyRelease
}
else
{
throw ("Configuration $OneBranchConfig|$OneBranchArch is not supported.")
Expand Down
4 changes: 3 additions & 1 deletion scripts/onebranch/pre-build.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Copyright (c) eBPF for Windows contributors
# SPDX-License-Identifier: MIT

$OneBranchArch = $env:ONEBRANCH_ARCH

# Get the path where this script is located
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Change the parent directory for the script directory
Set-Location $scriptPath\..\..

.\scripts\initialize_ebpf_repo.ps1
.\scripts\initialize_ebpf_repo.ps1 -Architecture $OneBranchArch

Get-ChildItem -Path ./external -Filter *.dll -Recurse | Remove-Item

0 comments on commit 4fc0195

Please sign in to comment.