Skip to content

Commit

Permalink
update onebranch scripts. (microsoft#3824)
Browse files Browse the repository at this point in the history
  • Loading branch information
shankarseal authored Sep 9, 2024
1 parent 2d20b26 commit 6e8f47a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
23 changes: 11 additions & 12 deletions scripts/onebranch/post-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ $OneBranchConfig = $env:ONEBRANCH_CONFIG
# Copy the signed binaries to the output directory
if ($OneBranchConfig -eq "NativeOnlyDebug" -and $OneBranchArch -eq "x64")
{
xcopy /y build\bin\amd64chk .\x64\Debug
Get-ChildItem -Path .\build\bin\amd64chk -Recurse | Remove-Item -Force -Recurse
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 "x64")
{
xcopy /y build\bin\amd64fre .\x64\NativeOnlyRelease
Get-ChildItem -Path .\build\bin\amd64fre -Recurse | Remove-Item -Force -Recurse
xcopy /y build\bin\x64_NativeOnlyRelease .\x64\NativeOnlyRelease
Get-ChildItem -Path .\build\bin\x64_NativeOnlyRelease -Recurse | Remove-Item -Force -Recurse
}
else
{
Expand All @@ -37,18 +37,17 @@ msbuild /p:SolutionDir=$SolutionDir\ /p:Configuration=$OneBranchConfig /p:Platfo
msbuild /p:SolutionDir=$SolutionDir\ /p:Configuration=$OneBranchConfig /p:Platform=$OneBranchArch /p:BuildProjectReferences=false .\installer\ebpf-for-windows.wixproj

# Copy the nupkg and msi to the output directory
if ($OneBranchConfig -eq "Release" -and $OneBranchArch -eq "x64")
if ($OneBranchConfig -eq "NativeOnlyDebug" -and $OneBranchArch -eq "x64")
{
xcopy /y .\x64\Release\*.nupkg .\build\bin\amd64fre
xcopy /y .\x64\Release\*.msi .\build\bin\amd64fre
xcopy /y .\x64\NativeOnlyDebug\*.nupkg .\build\bin\x64_NativeOnlyDebug
xcopy /y .\x64\NativeOnlyDebug\*.msi .\build\bin\x64_NativeOnlyDebug
}
elseif ($OneBranchConfig -eq "NativeOnlyRelease" -and $OneBranchArch -eq "x64")
{
xcopy /y .\x64\NativeOnlyRelease\*.nupkg .\build\bin\amd64fre
xcopy /y .\x64\NativeOnlyRelease\*.msi .\build\bin\amd64fre
xcopy /y .\x64\NativeOnlyRelease\*.nupkg .\build\bin\x64_NativeOnlyRelease
xcopy /y .\x64\NativeOnlyRelease\*.msi .\build\bin\x64_NativeOnlyRelease
}
else
{
xcopy /y .\x64\Debug\*.nupkg .\build\bin\amd64chk
xcopy /y .\x64\Debug\*.msi .\build\bin\amd64chk
}
throw ("Configuration $OneBranchConfig|$OneBranchArch is not supported.")
}
8 changes: 4 additions & 4 deletions tools/onebranch/onebranch.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64' And '$(BuildOneBranch)'=='True'">
<PostBuildEvent>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\amd64chk</Command>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\x64_NativeOnlyDebug</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyRelease|x64' And '$(BuildOneBranch)'=='True'">
<PostBuildEvent>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\amd64fre</Command>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\x64_NativeOnlyRelease</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' And '$(BuildOneBranch)'=='True'">
<PostBuildEvent>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\amd64chk</Command>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\x64_Debug</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' And '$(BuildOneBranch)'=='True'">
<PostBuildEvent>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\amd64fre</Command>
<Command>xcopy /yie $(OutDir) $(SolutionDir)build\bin\x64_Release</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down

0 comments on commit 6e8f47a

Please sign in to comment.