Skip to content

Commit

Permalink
Refactor Project files that were missed previously
Browse files Browse the repository at this point in the history
- Simplify project files
- Remove unnecessary lines
- Update commented out versions

Notifications project:
- Revision-less TFM check.
- Use `TargetPlatformRevision`.
- Fixup Windows TFM target version.
  • Loading branch information
Nirmal4G committed Apr 15, 2022
1 parent 630494c commit 49ba968
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard1.4;uap10.0.19041;net461;netcoreapp3.1;net5.0;net5.0-windows10.0.17763.0;native</TargetFrameworks>
<DefineConstants>$(DefineConstants);NETFX_CORE</DefineConstants>
<TargetFrameworks>netstandard1.4;uap10.0.19041;net461;netcoreapp3.1;net5.0;net5.0-windows10.0.17763;native</TargetFrameworks>
<NuspecFile>Microsoft.Toolkit.Uwp.Notifications.nuspec</NuspecFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.19041'">
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native'">
<TargetPlatformVersion>10.0.$(TargetPlatformRevision).0</TargetPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="!$(TargetFramework.StartsWith('uap10.0'))">
<DefineConstants>$(DefineConstants);NETFX_CORE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0-windows10.0.17763.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.Contains('windows10.0'))">
<!-- Define the WINDOWS_UWP conditional symbol, since the 'Windows.Data.Xml' and the 'Windows.UI.Notification' namespaces are available -->
<DefineConstants>$(DefineConstants);WINDOWS_UWP;WIN32</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'native'">
<OutputType>winmdobj</OutputType>
<!-- Build -->
<DebugType>Full</DebugType>
<OutputType>WinMDObj</OutputType>
<AssetTargetFallback>uap10.0</AssetTargetFallback>
<!-- Targets -->
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<!-- Workaround for issue NuGet/Home#8388; change behavior during NuGet restore time vs. final build to avoid NuGet conflict in VS 2019 -->
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' == 'true'">native</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
<PackageTargetFallback>uap10.0</PackageTargetFallback>
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
<CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>
<TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<!-- Misc -->
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<DefineConstants>$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
<ExtrasImplicitPlatformPackageIsPrivate>true</ExtrasImplicitPlatformPackageIsPrivate>

<!-- Need to override the built-in implicit defines for UAP or it'll be NETCORE5_0. This makes it UAP10_0_10240_0 to match the rest -->
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>
<DisableImplicitFrameworkDefines Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">true</DisableImplicitFrameworkDefines>
<!-- Workaround for issue NuGet/Home#8388; Restore conflict in VS IDE 2019 during DesignTime vs BuildTime. -->
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' == 'true'">Native,Version=v0.0</NuGetTargetMoniker>
</PropertyGroup>

<ItemGroup>
<None Include="Microsoft.Toolkit.Uwp.Notifications.targets" Pack="true" PackagePath="build\native" />
</ItemGroup>

<!-- In order to support .NET Native, we need to include an appropriate '.rd.xml' for UWP (remove from everything else) -->
<ItemGroup Condition="'$(TargetFramework)' != 'uap10.0.19041' and '$(TargetFramework)' != 'native'">
<ItemGroup Condition="!($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native')">
<EmbeddedResource Remove="Properties\Microsoft.Toolkit.Uwp.Notifications.rd.xml" />
</ItemGroup>

Expand All @@ -53,7 +52,7 @@
</ItemGroup>

<!-- The .NET Core desktop apps also need the Registry NuGet package and 'System.Reflection.Emit' for generating COM class dynamically -->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0-windows10.0.17763.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.Contains('windows10.0'))">
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.dll" />
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.pdb" />
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.xml" />
<file src="$buildOutput$\net5.0-windows10.0.17763.0\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.dll" />
<file src="$buildOutput$\net5.0-windows10.0.17763.0\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.pdb" />
<file src="$buildOutput$\net5.0-windows10.0.17763.0\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.xml" />
<file src="$buildOutput$\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.dll" />
<file src="$buildOutput$\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.pdb" />
<file src="$buildOutput$\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\net5.0-windows10.0.17763\Microsoft.Toolkit.Uwp.Notifications.xml" />
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.dll" />
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.pdb" />
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</PackageReference>
<!-- TODO Reintroduce graph controls
<PackageReference Include="Microsoft.Toolkit.Graph.Controls">
<Version>6.1.0-build.6</Version>
<Version>7.0.0-preview2</Version>
</PackageReference>
-->
<PackageReference Include="Microsoft.UI.Xaml">
Expand Down Expand Up @@ -1500,7 +1500,6 @@
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
</SDKReference>
</ItemGroup>
<ItemGroup />
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Toolkit.Uwp.UI/Microsoft.Toolkit.Uwp.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
</ItemGroup>

</Project>

0 comments on commit 49ba968

Please sign in to comment.