update script

This commit is contained in:
Nomango 2019-10-08 14:38:17 +08:00
parent 955bf22740
commit f33a7e8282
1 changed files with 3 additions and 4 deletions

View File

@ -3,15 +3,14 @@ function Set-FileConfiguration {
[string]$filePath [string]$filePath
) )
$replace1 = "<DebugInformationFormat>EditAndContinue</DebugInformationFormat>" $replace = "<DebugInformationFormat>(EditAndContinue|ProgramDatabase)</DebugInformationFormat>"
$replace2 = "<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>"
$replaceTo = "<DebugInformationFormat>None</DebugInformationFormat>" $replaceTo = "<DebugInformationFormat>None</DebugInformationFormat>"
# Create a copy of .vcxproj file # Create a copy of .vcxproj file
Copy-Item -Path $filePath -Destination ($filePath + '.template') Copy-Item -Path $filePath -Destination ($filePath + '.template')
# Overlay some configurations # Overlay some configurations
Get-Content ($filePath + '.template') -Encoding UTF8 | ForEach-Object { $_ -replace $replace1, $replaceTo; $_ -replace $replace2, $replaceTo; } | Out-File $filePath -Encoding UTF8 Get-Content ($filePath + '.template') -Encoding UTF8 | ForEach-Object { $_ -replace $replace, $replaceTo } | Out-File $filePath -Encoding UTF8
# Delete the copy file # Delete the copy file
Remove-Item -Path ($filePath + '.template') Remove-Item -Path ($filePath + '.template')
@ -22,6 +21,6 @@ Get-ChildItem -Path 'projects\' -Directory | ForEach-Object {
# Search all vcxproj files # Search all vcxproj files
Get-ChildItem -Path $dirPath *.vcxproj -File | ForEach-Object { Get-ChildItem -Path $dirPath *.vcxproj -File | ForEach-Object {
Set-FileConfiguration $dirPath + $_ Set-FileConfiguration ($dirPath + '\' + $_)
} }
} }