From e3ae65e0f328284971ffea51894d9eaf2160f723 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Sat, 31 Jul 2021 08:46:36 +0530 Subject: [PATCH] Refactor Project and Build related files - Refactor Project files - Refactor Markdown files - Remove unnecessary files - Use latest NuGet and config - Update 'Monaco.Editor' package - Update test package references --- .gitignore | 1 - Directory.Build.props | 2 +- .../Microsoft.Toolkit.Diagnostics.csproj | 1 + .../Microsoft.Toolkit.HighPerformance.csproj | 2 +- ...osoft.Toolkit.Mvvm.SourceGenerators.csproj | 17 ++---- .../Microsoft.Toolkit.Mvvm.csproj | 12 ++-- ...Microsoft.Toolkit.Uwp.Notifications.csproj | 57 ++++++++++--------- ...Microsoft.Toolkit.Uwp.Notifications.nuspec | 14 ++--- Microsoft.Toolkit.Uwp.Notifications/ReadMe.md | 40 ++++++------- .../Microsoft.Toolkit.Uwp.SampleApp.csproj | 7 +-- SmokeTests/nuget.config | 2 +- .../UITests.Tests.MSTest.csproj | 4 +- .../UITests.Tests.TAEF.csproj | 2 +- .../UnitTests.HighPerformance.NetCore.csproj | 4 +- .../UnitTests.HighPerformance.UWP.csproj | 4 +- .../UnitTests.NetCore.csproj | 7 +-- .../UnitTests.NetStandard.csproj | 1 - .../UnitTests.Notifications.NetCore.csproj | 4 +- .../UnitTests.Notifications.UWP.csproj | 4 +- .../UnitTests.SourceGenerators.csproj | 8 +-- UnitTests/UnitTests.UWP/UnitTests.UWP.csproj | 2 +- .../UnitTests.XamlIslands.UWPApp.csproj | 6 +- .../Directory.Build.props | 6 -- .../Directory.Build.targets | 3 - .../UnitTests.XamlIslands.csproj | 4 +- azure-pipelines.yml | 4 +- build/build.cake | 2 +- nuget.config | 4 +- 28 files changed, 105 insertions(+), 119 deletions(-) delete mode 100644 UnitTests/UnitTests.XamlIslands/Directory.Build.props delete mode 100644 UnitTests/UnitTests.XamlIslands/Directory.Build.targets diff --git a/.gitignore b/.gitignore index e1269ff7fd7..c7eb234e317 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ [Rr]eleases/ x64/ x86/ -build/ bld/ [Bb]in/ [Oo]bj/ diff --git a/Directory.Build.props b/Directory.Build.props index 63fd9d141d7..59abcf1e1a4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -55,7 +55,7 @@ - + diff --git a/Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj b/Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj index 9c1f7d0a868..279e336f1fd 100644 --- a/Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj +++ b/Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj @@ -44,6 +44,7 @@ + NETSTANDARD2_1_OR_GREATER diff --git a/Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj b/Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj index 1e8597bc417..2b8179dae0a 100644 --- a/Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj +++ b/Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj @@ -23,7 +23,7 @@ - Box<T>: a type mapping boxed value types and exposing some utility and high performance methods. - Ref<T>: a stack-only struct that can store a reference to a value of a specified type. - NullableRef<T>: a stack-only struct similar to Ref<T>, which also supports nullable references. - + Parallel;Performance;Unsafe;Span;Memory;String;StringPool;Array;Stream;Buffer;Extensions;Helpers diff --git a/Microsoft.Toolkit.Mvvm.SourceGenerators/Microsoft.Toolkit.Mvvm.SourceGenerators.csproj b/Microsoft.Toolkit.Mvvm.SourceGenerators/Microsoft.Toolkit.Mvvm.SourceGenerators.csproj index fa2804b3282..b00c5c8b2f3 100644 --- a/Microsoft.Toolkit.Mvvm.SourceGenerators/Microsoft.Toolkit.Mvvm.SourceGenerators.csproj +++ b/Microsoft.Toolkit.Mvvm.SourceGenerators/Microsoft.Toolkit.Mvvm.SourceGenerators.csproj @@ -1,18 +1,13 @@  - netstandard2.0 - 9.0 - enable + Enable false + netstandard2.0 - - - - - + @@ -34,12 +29,12 @@ - + + - - + diff --git a/Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj b/Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj index efa6bad4691..c81f678f289 100644 --- a/Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj +++ b/Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj @@ -35,16 +35,18 @@ - + - + diff --git a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj index c53fc9b2dc1..6204eb151a7 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj +++ b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj @@ -1,60 +1,58 @@ - netstandard1.4;uap10.0.19041;net461;netcoreapp3.1;net5.0;net5.0-windows10.0.17763.0;native - $(DefineConstants);NETFX_CORE + netstandard1.4;uap10.0.16299;net461;netcoreapp3.1;net5.0;net5.0-windows10.0.17763;native Microsoft.Toolkit.Uwp.Notifications.nuspec - - 10.0.19041.0 - 10.0.16299.0 + + 10.0.$(TargetPlatformRevision).0 + + + + $(DefineConstants);NETFX_CORE - - + + $(DefineConstants);WINDOWS_UWP;WIN32 - winmdobj + Full + WinMDObj + uap10.0 + UAP - - native - UAP,Version=v10.0 - uap10.0 - 10.0.19041.0 10.0.10240.0 - $(DefineConstants);WINDOWS_UWP;WINRT - false .NETCore v5.0 + + false + $(DefineConstants);WINDOWS_UWP;WINRT $(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets - true - - - UAP$(TargetPlatformMinVersion.Replace('.', '_')) - true + + UAP,Version=v10.0 + Native,Version=v0.0 - - + + - + - - - + + @@ -64,12 +62,15 @@ - + - + buildOutput=bin\$(Configuration);version=$(Version) diff --git a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec index 22a597a87df..8b96f8a3bd6 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec +++ b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec @@ -61,19 +61,19 @@ - - - + + + - - - - + + + + diff --git a/Microsoft.Toolkit.Uwp.Notifications/ReadMe.md b/Microsoft.Toolkit.Uwp.Notifications/ReadMe.md index bfc7d22d1ca..7c85a2ac62f 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/ReadMe.md +++ b/Microsoft.Toolkit.Uwp.Notifications/ReadMe.md @@ -1,36 +1,38 @@ -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). +# UWP Notifications + +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`). ## Where should I add new code? -Any code for generating notifications should be written in the Microsoft.Toolkit.Uwp.Notifications project. + +Any code for generating notifications should be written in the `Microsoft.Toolkit.Uwp.Notifications` project. If there's UWP-specific code, use the appropriate `#ifdef`, `WINDOWS_UWP` or `WINRT`. ## What are all the projects for? -All the code is contained on the Microsoft.Toolkit.Uwp.Notifications project. - -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++. +All the code is contained on the `Microsoft.Toolkit.Uwp.Notifications` project. -| C# | C++ | -| ---------------- | ------------------- | -| NET Standard 1.4 | UWP WinRT Component | -| UWP C# DLL | | -| .Net Core DLL | | - +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++. +| C# | C++ | +| --------------------- | ------------------- | +| .NET Standard Library | UWP WinRT Component | +| .NET Core Library | | +| UWP C# Library | | ## Scenarios we want to support -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. +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. ## How are the test projects organized? -If you look in the UnitTests folder of the repo, you'll notice that there's three projects... - - UnitTests.Notifications.Shared - - UnitTests.Notifications.NetCore - - UnitTests.Notifications.UWP - - UnitTests.Notifications.WinRT +If you look in the `UnitTests` folder of the repo, you'll notice that there are three projects... + +- `UnitTests.Notifications.Shared` +- `UnitTests.Notifications.NetCore` +- `UnitTests.Notifications.UWP` +- `UnitTests.Notifications.WinRT` -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. +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. -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. +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. diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj index d48bda9a5a3..74c0e84be10 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj +++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj @@ -107,14 +107,14 @@ 2.6.2 - 0.7.0-alpha + 0.8.1-alpha 2.0.1 @@ -127,7 +127,6 @@ - @@ -1490,6 +1489,7 @@ + Microsoft Engagement Framework @@ -1497,7 +1497,6 @@ Visual C++ 2015 Runtime for Universal Windows Platform Apps - 14.0 diff --git a/SmokeTests/nuget.config b/SmokeTests/nuget.config index 14c62b9b4bb..1a943588fb8 100644 --- a/SmokeTests/nuget.config +++ b/SmokeTests/nuget.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj b/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj index b060dd32c9f..44516a9a4e3 100644 --- a/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj +++ b/UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj b/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj index 70718b662e4..91be0760706 100644 --- a/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj +++ b/UITests/UITests.Tests.TAEF/UITests.Tests.TAEF.csproj @@ -58,7 +58,7 @@ - + diff --git a/UnitTests/UnitTests.HighPerformance.NetCore/UnitTests.HighPerformance.NetCore.csproj b/UnitTests/UnitTests.HighPerformance.NetCore/UnitTests.HighPerformance.NetCore.csproj index 81af94a489d..328e823c0c0 100644 --- a/UnitTests/UnitTests.HighPerformance.NetCore/UnitTests.HighPerformance.NetCore.csproj +++ b/UnitTests/UnitTests.HighPerformance.NetCore/UnitTests.HighPerformance.NetCore.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/UnitTests/UnitTests.HighPerformance.UWP/UnitTests.HighPerformance.UWP.csproj b/UnitTests/UnitTests.HighPerformance.UWP/UnitTests.HighPerformance.UWP.csproj index 51c0f95d1a1..b461f7b54d6 100644 --- a/UnitTests/UnitTests.HighPerformance.UWP/UnitTests.HighPerformance.UWP.csproj +++ b/UnitTests/UnitTests.HighPerformance.UWP/UnitTests.HighPerformance.UWP.csproj @@ -143,10 +143,10 @@ 6.2.12 - 2.1.2 + 2.2.5 - 2.1.2 + 2.2.5 diff --git a/UnitTests/UnitTests.NetCore/UnitTests.NetCore.csproj b/UnitTests/UnitTests.NetCore/UnitTests.NetCore.csproj index 9921a87b1a9..ccb1d35ab5b 100644 --- a/UnitTests/UnitTests.NetCore/UnitTests.NetCore.csproj +++ b/UnitTests/UnitTests.NetCore/UnitTests.NetCore.csproj @@ -2,7 +2,6 @@ netcoreapp2.1;netcoreapp3.1;net5.0 - 9.0 @@ -14,9 +13,9 @@ - - - + + + diff --git a/UnitTests/UnitTests.NetStandard/UnitTests.NetStandard.csproj b/UnitTests/UnitTests.NetStandard/UnitTests.NetStandard.csproj index 2f33f86d89c..ebb93071003 100644 --- a/UnitTests/UnitTests.NetStandard/UnitTests.NetStandard.csproj +++ b/UnitTests/UnitTests.NetStandard/UnitTests.NetStandard.csproj @@ -2,7 +2,6 @@ netstandard2.0 - 9.0 diff --git a/UnitTests/UnitTests.Notifications.NetCore/UnitTests.Notifications.NetCore.csproj b/UnitTests/UnitTests.Notifications.NetCore/UnitTests.Notifications.NetCore.csproj index 0af83573b18..e21209c36e8 100644 --- a/UnitTests/UnitTests.Notifications.NetCore/UnitTests.Notifications.NetCore.csproj +++ b/UnitTests/UnitTests.Notifications.NetCore/UnitTests.Notifications.NetCore.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj index 35fa9601fd3..11c5d05b835 100644 --- a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj +++ b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj @@ -117,10 +117,10 @@ 6.2.12 - 2.1.2 + 2.2.5 - 2.1.2 + 2.2.5 diff --git a/UnitTests/UnitTests.SourceGenerators/UnitTests.SourceGenerators.csproj b/UnitTests/UnitTests.SourceGenerators/UnitTests.SourceGenerators.csproj index 81fd8f291e2..bd24a66809f 100644 --- a/UnitTests/UnitTests.SourceGenerators/UnitTests.SourceGenerators.csproj +++ b/UnitTests/UnitTests.SourceGenerators/UnitTests.SourceGenerators.csproj @@ -2,15 +2,13 @@ net5.0 - false - 9.0 - + - - + + diff --git a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj index 20c6e4582ea..c55052f3309 100644 --- a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj +++ b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj @@ -123,7 +123,7 @@ 5.0.2 - 5.10.3 + 6.1.0 6.2.12 diff --git a/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj b/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj index c8bee2bdaed..8747c2ff0b6 100644 --- a/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj +++ b/UnitTests/UnitTests.XamlIslands.UWPApp/UnitTests.XamlIslands.UWPApp.csproj @@ -160,12 +160,12 @@ 6.2.12 - 6.1.2 + 6.1.3 diff --git a/UnitTests/UnitTests.XamlIslands/Directory.Build.props b/UnitTests/UnitTests.XamlIslands/Directory.Build.props deleted file mode 100644 index d0b03191f36..00000000000 --- a/UnitTests/UnitTests.XamlIslands/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UnitTests/UnitTests.XamlIslands/Directory.Build.targets b/UnitTests/UnitTests.XamlIslands/Directory.Build.targets deleted file mode 100644 index 4de98b5c73f..00000000000 --- a/UnitTests/UnitTests.XamlIslands/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/UnitTests/UnitTests.XamlIslands/UnitTests.XamlIslands.csproj b/UnitTests/UnitTests.XamlIslands/UnitTests.XamlIslands.csproj index 9e48643d0ce..5d5e12dbdac 100644 --- a/UnitTests/UnitTests.XamlIslands/UnitTests.XamlIslands.csproj +++ b/UnitTests/UnitTests.XamlIslands/UnitTests.XamlIslands.csproj @@ -8,7 +8,7 @@ - uap10.0.19041 + uap10.0.18362 app.manifest UnitTests.XamlIslands.Program @@ -18,7 +18,7 @@ - + \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 030173cb6ee..586feb3b6d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,9 +28,9 @@ jobs: displayName: Setup Environment Variables - task: NuGetToolInstaller@0 - displayName: Use NuGet 5.6.0 + displayName: Use NuGet 5.11 inputs: - versionSpec: 5.6.0 + versionSpec: 5.11.0 - task: DotNetCoreCLI@2 inputs: diff --git a/build/build.cake b/build/build.cake index f4f8558189a..8664380438d 100644 --- a/build/build.cake +++ b/build/build.cake @@ -233,7 +233,7 @@ public string getMSTestAdapterPath(){ if(nugetPaths.Count == 0){ throw new Exception( "Cannot locate the MSTest test adapter. " + - "You might need to add '#tool nuget:?package=MSTest.TestAdapter&version=2.1.0' " + + "You might need to add '#tool nuget:?package=MSTest.TestAdapter&version=' " + "to the top of your build.cake file."); } diff --git a/nuget.config b/nuget.config index 1b39cb3113e..62c7515ba9e 100644 --- a/nuget.config +++ b/nuget.config @@ -1,9 +1,9 @@ - - + +