Skip to content

Commit f5b2388

Browse files
committed
Add comment to generated files indicating original MultiTarget value
1 parent d01e87f commit f5b2388

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

MultiTarget/GenerateMultiTargetAwareProjectReferenceProps.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ function LoadMultiTargetsFrom([string] $path) {
6565

6666
# Load multitarget preferences for project
6767
$multiTargets = LoadMultiTargetsFrom("$([System.IO.Path]::GetDirectoryName($projectPath))\MultiTarget.props");
68-
$multiTargets = $multiTargets.Split(';');
6968

69+
$templateContents = $templateContents -replace [regex]::escape("[IntendedTargets]"), $multiTargets;
70+
71+
$multiTargets = $multiTargets.Split(';');
7072
Write-Host "Generating project references for $([System.IO.Path]::GetFileNameWithoutExtension($csprojFileName)): $($multiTargets -Join ', ')"
7173

7274
$templateContents = $templateContents -replace [regex]::escape("[CanTargetWasm]"), "'$($multiTargets.Contains("wasm").ToString().ToLower())'";

MultiTarget/MultiTargetAwareProjectReference.props.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<!-- Before importing, check that the imported project works on the current framework -->
77
<!-- Condition must be on a <When> statement for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
88
<Choose>
9+
<!-- [IntendedTargets] -->
910
<When Condition="($(IsWasm) == 'true' AND [CanTargetWasm] == 'true') OR
1011
($(IsUwp) == 'true' AND [CanTargetUwp] == 'true') OR
1112
($(IsWinAppSdk) == 'true' AND [CanTargetWasdk] == 'true') OR

0 commit comments

Comments
 (0)