Skip to content

Commit

Permalink
Ensure DIrectory.build.props affects defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Dec 12, 2018
1 parent 631ed4e commit 4cea3a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
by an included Directory.Build.targets. -->
<PropertyGroup Condition="'$(_SdkShortFrameworkIdentifier)' == 'uap'">

<!-- Need to override the built-in implicit defines for UAP (UAP10_0_10240) or it'll be NETCORE5_0 -->
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true' AND '$(_SdkLanguageSourceName)' != 'VisualBasic'">UAP$(_SdkShortFrameworkVersion.Replace('.', '_'));UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true' AND '$(_SdkLanguageSourceName)' == 'VisualBasic'">UAP$(_SdkShortFrameworkVersion.Replace('.', '_'))=-1,UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>

<!-- Decide whether to use the new version metadata, or the old one -->
<_ExtrasUseVersionedWindowsWinmdFile Condition="$([System.Version]::Parse('$(TargetPlatformVersion)')) >= $([System.Version]::Parse('10.0.16299.0'))">true</_ExtrasUseVersionedWindowsWinmdFile>

<WindowsWinmdFile Condition="'$(_ExtrasUseVersionedWindowsWinmdFile)' == 'true' AND Exists('$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\$(TargetPlatformVersion)\Windows.winmd')">$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\$(TargetPlatformVersion)\Windows.winmd</WindowsWinmdFile>
<WindowsWinmdFile Condition="'$(_ExtrasUseVersionedWindowsWinmdFile)' != 'true' AND Exists('$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\Windows.winmd')">$(MSBuildProgramFiles32)\Windows Kits\10\UnionMetadata\Windows.winmd</WindowsWinmdFile>
</PropertyGroup>

<ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' ">
<_SdkImplicitReference Include="Windows" Private="false" HintPath="$(WindowsWinmdFile)" Condition="'$(WindowsWinmdFile)' != ''" />
</ItemGroup>

</Project>
8 changes: 0 additions & 8 deletions Source/MSBuild.Sdk.Extras/Build/Platforms/Windows.targets
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,15 @@
<PropertyGroup Condition="'$(_SdkShortFrameworkIdentifier)' == 'uap'">
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>


<!-- Only set for the 10.0 version -->
<NugetTargetMoniker Condition="'$(_SdkShortFrameworkVersion)' == '10.0'">UAP,Version=v10.0</NugetTargetMoniker>


<!-- Calculate defaults based on 10.0 or specific version based on TFM to handle uap10.0, uap10.0.10240, etc -->
<TargetPlatformVersion Condition="'$(TargetPlatformVersion)' == '' AND '$(_SdkShortFrameworkVersion)' == '10.0'">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformVersion Condition="'$(TargetPlatformVersion)' == ''">$([System.Version]::Parse('$(_SdkShortFrameworkVersion)')).0</TargetPlatformVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)' == '' AND '$(_SdkShortFrameworkVersion)' == '10.0'">10.0.15063.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)' == ''">$([System.Version]::Parse('$(_SdkShortFrameworkVersion)')).0</TargetPlatformMinVersion>


<!-- Need to override the built-in implicit defines for UAP (UAP10_0_10240) or it'll be NETCORE5_0 -->
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true' AND '$(_SdkLanguageSourceName)' != 'VisualBasic'">UAP$(_SdkShortFrameworkVersion.Replace('.', '_'));UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true' AND '$(_SdkLanguageSourceName)' == 'VisualBasic'">UAP$(_SdkShortFrameworkVersion.Replace('.', '_'))=-1,UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>

<CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>

<ImplicitlyExpandTargetPlatform>false</ImplicitlyExpandTargetPlatform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@
<PackageReference Update="Tizen.NET" PrivateAssets="All" Condition="'$(ExtrasImplicitPlatformPackageIsPrivate)' == 'true'"/>
</ItemGroup>

<ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' AND '$(WindowsWinmdFile)' != '' ">
<_SdkImplicitReference Include="Windows" Private="false" HintPath="$(WindowsWinmdFile)" />
</ItemGroup>


</Project>

0 comments on commit 4cea3a6

Please sign in to comment.