Use minimal Windows dependencies for non All/Wasm slns

This commit is contained in:
Arlo Godfrey 2022-04-05 13:59:12 -05:00
Родитель f7310f7812
Коммит 6f9c97e892
1 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -3,12 +3,17 @@ $slnName = $args[0];
$fileContents = Get-Content -Path .\..\Labs.TargetFrameworks.default.props
$newFileContents = $fileContents;
if ($slnName -eq "Toolkit.Labs.Windows") {
$newFileContents = $fileContents -replace '<(LinuxLibTargetFramework|AndroidLibTargetFramework|MacOSLibTargetFramework|iOSLibTargetFramework)>.+?>', '';
}
# If solution is set to All, don't do any replacements and copy all TFMs.
if (-not($slnName -eq "Toolkit.Labs.All")) {
if ($slnName -eq "Toolkit.Labs.Wasm") {
$newFileContents = $fileContents -replace '<(UwpTargetFramework|WinAppSdkTargetFramework|WpfLibTargetFramework|LinuxLibTargetFramework|AndroidLibTargetFramework|MacOSLibTargetFramework|iOSLibTargetFramework)>.+?>', '';
# If WASM, remove all non-wasm TFMs
if ($slnName -eq "Toolkit.Labs.Wasm") {
$newFileContents = $fileContents -replace '<(UwpTargetFramework|WinAppSdkTargetFramework|WpfLibTargetFramework|LinuxLibTargetFramework|AndroidLibTargetFramework|MacOSLibTargetFramework|iOSLibTargetFramework)>.+?>', '';
}
# If any other solution, assume minimal Windows dependencies.
else {
$newFileContents = $fileContents -replace '<(LinuxLibTargetFramework|AndroidLibTargetFramework|MacOSLibTargetFramework|iOSLibTargetFramework)>.+?>', '';
}
}
if ($newFileContents -eq $fileContents) {