Skip to content

Commit 4929dc5

Browse files
committed
Refactor Project and Build related files
- Refactor Project files - Refactor Markdown files - Remove unnecessary files - Use latest NuGet and config - Fixup UAP/Windows TFM versions
1 parent 925b24c commit 4929dc5

File tree

13 files changed

+66
-76
lines changed

13 files changed

+66
-76
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
[Rr]eleases/
1919
x64/
2020
x86/
21-
build/
2221
bld/
2322
[Bb]in/
2423
[Oo]bj/

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

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

9-
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.19041'">
10-
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
11-
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
8+
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native'">
9+
<TargetPlatformVersion>10.0.$(TargetPlatformRevision).0</TargetPlatformVersion>
10+
</PropertyGroup>
11+
12+
<PropertyGroup Condition="!$(TargetFramework.StartsWith('uap10.0'))">
13+
<DefineConstants>$(DefineConstants);NETFX_CORE</DefineConstants>
1214
</PropertyGroup>
1315

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

1921
<PropertyGroup Condition="'$(TargetFramework)' == 'native'">
20-
<OutputType>winmdobj</OutputType>
22+
<!-- Build -->
2123
<DebugType>Full</DebugType>
24+
<OutputType>WinMDObj</OutputType>
25+
<AssetTargetFallback>uap10.0</AssetTargetFallback>
26+
<!-- Targets -->
2227
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
23-
<!-- Workaround for issue NuGet/Home#8388; change behavior during NuGet restore time vs. final build to avoid NuGet conflict in VS 2019 -->
24-
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' == 'true'">native</NuGetTargetMoniker>
25-
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
26-
<PackageTargetFallback>uap10.0</PackageTargetFallback>
27-
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
2828
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
29-
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
30-
<CopyLocalLockFileAssemblies Condition="'$(CopyLocalLockFileAssemblies)' == ''">false</CopyLocalLockFileAssemblies>
3129
<TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
3230
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
31+
<!-- Misc -->
32+
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
33+
<DefineConstants>$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
3334
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
34-
<ExtrasImplicitPlatformPackageIsPrivate>true</ExtrasImplicitPlatformPackageIsPrivate>
35-
36-
<!-- 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 -->
37-
<ImplicitFrameworkDefine Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">UAP$(TargetPlatformMinVersion.Replace('.', '_'))</ImplicitFrameworkDefine>
38-
<DisableImplicitFrameworkDefines Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">true</DisableImplicitFrameworkDefines>
35+
<!-- Workaround for issue NuGet/Home#8388; Restore conflict in VS IDE 2019 during DesignTime vs BuildTime. -->
36+
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
37+
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' == 'true'">Native,Version=v0.0</NuGetTargetMoniker>
3938
</PropertyGroup>
4039

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

45-
<!-- In order to support .NET Native, we need to include an appropriate .rd.xml for UWP (remove from everything else) -->
46-
47-
<!-- Desktop Win32 apps -->
44+
<!-- For Desktop Win32 apps' WinRT APIs support -->
4845
<ItemGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netcoreapp3.1'">
49-
<!-- Reference Windows SDK NuGet of correct target platform version -->
5046
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
5147
</ItemGroup>
5248

53-
<!-- The .NET Core desktop apps also need the Registry NuGet package and System.Reflection.Emit for generating COM class dynamically -->
54-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0-windows10.0.17763.0'">
49+
<!-- The .NET Core desktop apps also need the Registry NuGet package and 'System.Reflection.Emit' for generating COM class dynamically -->
50+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.Contains('windows10.0'))">
5551
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
5652
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
5753
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
@@ -61,12 +57,15 @@
6157
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="$(ExtrasUwpMetaPackageVersion)" PrivateAssets="All" IsImplicitlyDefined="true" />
6258
</ItemGroup>
6359

64-
<!-- Native (C++) doesn't need 'System.ValueTuple' (plus it's incompatible with this package) -->
60+
<!-- Native (C++) does not need 'System.ValueTuple' (plus it is incompatible with this package) -->
6561
<ItemGroup Condition="'$(TargetFramework)' != 'native'">
6662
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
6763
</ItemGroup>
6864

69-
<!-- Set the nuspec properties. Dependent on version which isn't updated till after 'GetBuildVersion'. Condition ensures we only set once since this runs multiple times for each target. -->
65+
<!--
66+
Set the nuspec properties. Dependent on version which is not updated till after 'GetBuildVersion'.
67+
Condition ensures we only set once since this runs multiple times for each target.
68+
-->
7069
<Target Name="SetNuspecProperties" AfterTargets="GetBuildVersion">
7170
<PropertyGroup Condition="'$(NuspecProperties)' == ''">
7271
<NuspecProperties>buildOutput=bin\$(Configuration);version=$(Version)</NuspecProperties>

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@
6161
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.dll" />
6262
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.pdb" />
6363
<file src="$buildOutput$\net5.0\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\net5.0\Microsoft.Toolkit.Uwp.Notifications.xml" />
64-
<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" />
65-
<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" />
66-
<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" />
64+
<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" />
65+
<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" />
66+
<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" />
6767
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.dll" />
6868
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.pdb" />
6969
<file src="$buildOutput$\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\netcoreapp3.1\Microsoft.Toolkit.Uwp.Notifications.xml" />
7070
<file src="$buildOutput$\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.dll" />
7171
<file src="$buildOutput$\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.pdb" />
7272
<file src="$buildOutput$\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\netstandard1.4\Microsoft.Toolkit.Uwp.Notifications.xml" />
73-
<file src="$buildOutput$\uap10.0.19041\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.dll" />
74-
<file src="$buildOutput$\uap10.0.19041\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pdb" />
75-
<file src="$buildOutput$\uap10.0.19041\Microsoft.Toolkit.Uwp.Notifications.pri" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pri" />
76-
<file src="$buildOutput$\uap10.0.19041\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.xml" />
73+
<file src="$buildOutput$\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.dll" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.dll" />
74+
<file src="$buildOutput$\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pdb" />
75+
<file src="$buildOutput$\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pri" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.pri" />
76+
<file src="$buildOutput$\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.xml" target="lib\uap10.0.16299\Microsoft.Toolkit.Uwp.Notifications.xml" />
7777
<file src="$buildOutput$\native\Microsoft.Toolkit.Uwp.Notifications.pdb" target="lib\native\Microsoft.Toolkit.Uwp.Notifications.pdb" />
7878
<file src="$buildOutput$\native\Microsoft.Toolkit.Uwp.Notifications.pri" target="lib\native\Microsoft.Toolkit.Uwp.Notifications.pri" />
7979
<file src="$buildOutput$\native\Microsoft.Toolkit.Uwp.Notifications.winmd" target="lib\native\Microsoft.Toolkit.Uwp.Notifications.winmd" />
Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
Welcome to the Notifications section of the toolkit! This contains the Notifications library, including the object model for tile, toast, and badge XML (previously called NotificationsExtensions).
1+
# UWP Notifications
2+
3+
Welcome to the Notifications section of the toolkit! This contains the Notifications library, including the object model for tile, toast, and badge XML (previously called `NotificationsExtensions`).
24

35
## Where should I add new code?
4-
Any code for generating notifications should be written in the Microsoft.Toolkit.Uwp.Notifications project.
6+
7+
Any code for generating notifications should be written in the `Microsoft.Toolkit.Uwp.Notifications` project.
58

69
If there's UWP-specific code, use the appropriate `#ifdef`, `WINDOWS_UWP` or `WINRT`.
710

811
## What are all the projects for?
9-
All the code is contained on the Microsoft.Toolkit.Uwp.Notifications project.
10-
11-
It outputs `netstandard1.4`, `uap10.0`, `native` for WinRT, and netcoreapp for .Net Core projects. The UWP library is only for C#, while the WinRT library is a Windows Runtime Component for C++.
1212

13+
All the code is contained on the `Microsoft.Toolkit.Uwp.Notifications` project.
1314

14-
| C# | C++ |
15-
| ---------------- | ------------------- |
16-
| NET Standard 1.4 | UWP WinRT Component |
17-
| UWP C# DLL | |
18-
| .Net Core DLL | |
19-
15+
It outputs `netstandard1.4`, `uap10.0`, `native` for WinRT, and `netcoreapp3.1` for .NET Core projects. The UWP library is only for C#, while the WinRT library is a Windows Runtime Component for C++.
2016

17+
| C# | C++ |
18+
| --------------------- | ------------------- |
19+
| .NET Standard Library | UWP WinRT Component |
20+
| .NET Core Library | |
21+
| UWP C# Library | |
2122

2223
## Scenarios we want to support
2324

24-
Imagine you add this library to a .NET Standard class library, and you also add it to your UWP app. In this case, your .NET Standard class library will receive the NETStandard dll. Your UWP project will receive the UWP dll.
25+
Imagine you add this library to a .NET Standard class library, and you also add it to your UWP app. In this case, your .NET Standard class library will receive the .NET Standard DLL. Your UWP project will receive the UWP DLL.
2526

2627
## How are the test projects organized?
2728

28-
If you look in the UnitTests folder of the repo, you'll notice that there's three projects...
29-
- UnitTests.Notifications.Shared
30-
- UnitTests.Notifications.NetCore
31-
- UnitTests.Notifications.UWP
32-
- UnitTests.Notifications.WinRT
29+
If you look in the `UnitTests` folder of the repo, you'll notice that there are three projects...
30+
31+
- `UnitTests.Notifications.Shared`
32+
- `UnitTests.Notifications.NetCore`
33+
- `UnitTests.Notifications.UWP`
34+
- `UnitTests.Notifications.WinRT`
3335

34-
That's because in our source code, we have some #IF defs for switching between the different types of reflection that C# uses, since it's different between a .NET Standard and WinRT code.
36+
That's because in our source code, we have some `#ifdef` for switching between the different types of reflection that C# uses, since it's different between a .NET Standard and WinRT code.
3537

36-
Therefore, there are two different code paths, one path for NETFX_CORE, and another for when that isn't present. The two test projects exercise both code paths.
38+
Therefore, there are two different code paths, one path for `NETFX_CORE`, and another for when that isn't present. The two test projects exercise both code paths.

Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
</PackageReference>
111111
<!-- TODO Reintroduce graph controls
112112
<PackageReference Include="Microsoft.Toolkit.Graph.Controls">
113-
<Version>6.1.0-build.6</Version>
113+
<Version>7.0.0-preview2</Version>
114114
</PackageReference>
115115
-->
116116
<PackageReference Include="Microsoft.UI.Xaml">
@@ -127,7 +127,6 @@
127127
</PackageReference>
128128
</ItemGroup>
129129
<ItemGroup>
130-
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
131130
<Content Include="Assets\BrushAssets\TileTexture.png" />
132131
<Content Include="Assets\BrushAssets\NoiseTexture.png" />
133132
<Content Include="Assets\checker.png" />
@@ -1493,14 +1492,14 @@
14931492
</ProjectReference>
14941493
</ItemGroup>
14951494
<ItemGroup>
1495+
<!-- A reference to the entire .NET Framework and Windows SDK are automatically included -->
14961496
<SDKReference Include="Microsoft.Services.Store.Engagement, Version=10.0">
14971497
<Name>Microsoft Engagement Framework</Name>
14981498
</SDKReference>
14991499
<SDKReference Include="Microsoft.VCLibs, Version=14.0">
15001500
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
15011501
</SDKReference>
15021502
</ItemGroup>
1503-
<ItemGroup />
15041503
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
15051504
<VisualStudioVersion>14.0</VisualStudioVersion>
15061505
</PropertyGroup>

Microsoft.Toolkit.Uwp.UI/Microsoft.Toolkit.Uwp.UI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
</PropertyGroup>
5151

5252
<ItemGroup>
53-
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
53+
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
5454
</ItemGroup>
5555

5656
<ItemGroup>
57-
<ProjectReference Include="..\Microsoft.Toolkit.Uwp\Microsoft.Toolkit.Uwp.csproj" />
57+
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
5858
</ItemGroup>
5959

6060
</Project>

SmokeTests/nuget.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<configuration>
22
<packageSources>
33
<clear />
4-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
54
<add key="Local" value="..\bin\nupkg" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
</packageSources>
77
</configuration>

UnitTests/UnitTests.XamlIslands/Directory.Build.props

Lines changed: 0 additions & 6 deletions
This file was deleted.

UnitTests/UnitTests.XamlIslands/Directory.Build.targets

Lines changed: 0 additions & 3 deletions
This file was deleted.

UnitTests/UnitTests.XamlIslands/UnitTests.XamlIslands.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<AssetTargetFallback>uap10.0.19041</AssetTargetFallback>
11+
<AssetTargetFallback>uap10.0.18362</AssetTargetFallback>
1212
<ApplicationManifest>app.manifest</ApplicationManifest>
1313
<StartupObject>UnitTests.XamlIslands.Program</StartupObject>
1414
</PropertyGroup>

0 commit comments

Comments
 (0)