tools: remove-all-arm64

Add script to remove ARM64 project configurations for builds on VS2015
This commit is contained in:
Bill Zissimopoulos 2021-12-16 11:30:09 +00:00
parent 41cc70e573
commit 6ab1ed3b7f
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,16 @@
@echo off
setlocal
setlocal EnableDelayedExpansion
cd %~dp0..\..
for /r %%f in (*.vcxproj) do (
echo %%f
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0remove-vcxproj-config.ps1' -Path '%%f' -ProjectConfiguration '|ARM64'
)
for /r %%f in (*.sln) do (
echo %%f
findstr /V /C:"|ARM64" "%%f" > "%%f.new"
move /Y "%%f.new" "%%f" >nul
)

View File

@ -0,0 +1,20 @@
param (
[Parameter(Mandatory)][string]$Path,
[Parameter(Mandatory)][string[]]$ProjectConfiguration
)
$file = Get-Item $Path
$xmlob = New-Object xml
$xmlob.PreserveWhitespace = $true
$xmlob.Load($file.FullName)
$xmlns = @{"msbuild" = "http://schemas.microsoft.com/developer/msbuild/2003"}
$configs = Select-Xml -Xml $xmlob -Namespace $xmlns `
-XPath "//msbuild:ProjectConfiguration[contains(@Include,'$ProjectConfiguration')]"
foreach ($config in $configs) {
$child = $config.Node
[void]$child.ParentNode.RemoveChild($child)
}
$xmlob.Save($file.FullName)