From 3568772698ed02648ccc249a3a2457a269fcab72 Mon Sep 17 00:00:00 2001 From: Peter Vietense Date: Sat, 10 Apr 2021 13:04:15 +0200 Subject: [PATCH 1/5] Bump Nerdbank.GitVersioning from 3.3.37 to 3.4.194 --- .../MvvmScarletToolkit.Abstractions.csproj | 2 +- .../MvvmScarletToolkit.Commands.csproj | 2 +- .../MvvmScarletToolkit.Observables.csproj | 2 +- .../Implementations/ScarletCommandBuilder.cs | 1 - src/MvvmScarletToolkit.Wpf/MvvmScarletToolkit.Wpf.csproj | 2 +- .../MvvmScarletToolkit.Xamarin.Forms.csproj | 2 +- src/MvvmScarletToolkit/MvvmScarletToolkit.csproj | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/MvvmScarletToolkit.Abstractions/MvvmScarletToolkit.Abstractions.csproj b/src/MvvmScarletToolkit.Abstractions/MvvmScarletToolkit.Abstractions.csproj index d081a1a8..1613a7ef 100644 --- a/src/MvvmScarletToolkit.Abstractions/MvvmScarletToolkit.Abstractions.csproj +++ b/src/MvvmScarletToolkit.Abstractions/MvvmScarletToolkit.Abstractions.csproj @@ -14,7 +14,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MvvmScarletToolkit.Commands/MvvmScarletToolkit.Commands.csproj b/src/MvvmScarletToolkit.Commands/MvvmScarletToolkit.Commands.csproj index f5e2002d..0ef17d23 100644 --- a/src/MvvmScarletToolkit.Commands/MvvmScarletToolkit.Commands.csproj +++ b/src/MvvmScarletToolkit.Commands/MvvmScarletToolkit.Commands.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MvvmScarletToolkit.Observables/MvvmScarletToolkit.Observables.csproj b/src/MvvmScarletToolkit.Observables/MvvmScarletToolkit.Observables.csproj index 26007bd8..b88db769 100644 --- a/src/MvvmScarletToolkit.Observables/MvvmScarletToolkit.Observables.csproj +++ b/src/MvvmScarletToolkit.Observables/MvvmScarletToolkit.Observables.csproj @@ -18,7 +18,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MvvmScarletToolkit.Wpf/Implementations/ScarletCommandBuilder.cs b/src/MvvmScarletToolkit.Wpf/Implementations/ScarletCommandBuilder.cs index 7f9a75b6..6cb5a51d 100644 --- a/src/MvvmScarletToolkit.Wpf/Implementations/ScarletCommandBuilder.cs +++ b/src/MvvmScarletToolkit.Wpf/Implementations/ScarletCommandBuilder.cs @@ -12,7 +12,6 @@ namespace MvvmScarletToolkit /// /// Facade Service for creating CommandBuilderContext instances /// - /// The argument type, that the to be created command is supposed to accept public class ScarletCommandBuilder : IScarletCommandBuilder { private static readonly Lazy _default = new Lazy(() => new ScarletCommandBuilder(ScarletDispatcher.Default, ScarletCommandManager.Default, WeakReferenceMessenger.Default, ScarletExitService.Default, ScarletWeakEventManager.Default, (lambda) => new BusyStack(lambda, ScarletDispatcher.Default))); diff --git a/src/MvvmScarletToolkit.Wpf/MvvmScarletToolkit.Wpf.csproj b/src/MvvmScarletToolkit.Wpf/MvvmScarletToolkit.Wpf.csproj index 5a8ab53c..977e0684 100644 --- a/src/MvvmScarletToolkit.Wpf/MvvmScarletToolkit.Wpf.csproj +++ b/src/MvvmScarletToolkit.Wpf/MvvmScarletToolkit.Wpf.csproj @@ -18,7 +18,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MvvmScarletToolkit.Xamarin.Forms/MvvmScarletToolkit.Xamarin.Forms.csproj b/src/MvvmScarletToolkit.Xamarin.Forms/MvvmScarletToolkit.Xamarin.Forms.csproj index f94fbf06..6c461c58 100644 --- a/src/MvvmScarletToolkit.Xamarin.Forms/MvvmScarletToolkit.Xamarin.Forms.csproj +++ b/src/MvvmScarletToolkit.Xamarin.Forms/MvvmScarletToolkit.Xamarin.Forms.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MvvmScarletToolkit/MvvmScarletToolkit.csproj b/src/MvvmScarletToolkit/MvvmScarletToolkit.csproj index dfe02109..06099746 100644 --- a/src/MvvmScarletToolkit/MvvmScarletToolkit.csproj +++ b/src/MvvmScarletToolkit/MvvmScarletToolkit.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 4e2ca8aa83218a0363ea28a3b05a164208805b14 Mon Sep 17 00:00:00 2001 From: Peter Vietense Date: Sat, 10 Apr 2021 13:15:58 +0200 Subject: [PATCH 2/5] moved MvvmScarletToolkit.Tests to MvvmScarletToolkit.Wpf.Tests --- MvvmScarletToolkit.sln | 52 +++++++++---------- .../Properties/AssemblyInfo.cs | 3 +- .../CommandBuilderContextTests.cs | 0 .../CommandBuilderExtensionTests.cs | 0 .../ConcurrentCommandTests.cs | 0 .../MvvmScarletToolkit.Wpf.Tests.csproj} | 5 +- .../ScarletCommandBuilderTests.cs | 0 .../TestData/DerivedObjectViewModelBase.cs | 0 .../TestData/DerivedViewModelBase.cs | 0 .../Util/TestDispatcher.cs | 0 .../Util/Utils.cs | 0 .../ViewModelBaseTests.cs | 0 12 files changed, 30 insertions(+), 30 deletions(-) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/CommandBuilderContextTests.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/CommandBuilderExtensionTests.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/ConcurrentCommandTests.cs (100%) rename src/{MvvmScarletToolkit.Tests/MvvmScarletToolkit.Tests.csproj => MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj} (82%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/ScarletCommandBuilderTests.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/TestData/DerivedObjectViewModelBase.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/TestData/DerivedViewModelBase.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/Util/TestDispatcher.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/Util/Utils.cs (100%) rename src/{MvvmScarletToolkit.Tests => MvvmScarletToolkit.Wpf.Tests}/ViewModelBaseTests.cs (100%) diff --git a/MvvmScarletToolkit.sln b/MvvmScarletToolkit.sln index 5913b009..30cf7a29 100644 --- a/MvvmScarletToolkit.sln +++ b/MvvmScarletToolkit.sln @@ -30,8 +30,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Abstract EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Wpf", "src\MvvmScarletToolkit.Wpf\MvvmScarletToolkit.Wpf.csproj", "{1B547A43-3DB6-48FD-AF9A-EC649B5C584F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Tests", "src\MvvmScarletToolkit.Tests\MvvmScarletToolkit.Tests.csproj", "{E3C07ACA-FD4A-427D-B73A-F67C65A892B5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Xamarin.Forms", "src\MvvmScarletToolkit.Xamarin.Forms\MvvmScarletToolkit.Xamarin.Forms.csproj", "{CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E302CFE9-12CC-4732-9CAF-3F2377667DBC}" @@ -44,6 +42,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmScarletToolkit.Xamarin. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmScarletToolkit.Xamarin.Forms.Samples.UWP", "src\MvvmScarletToolkit.Xamarin.Forms.Samples.UWP\MvvmScarletToolkit.Xamarin.Forms.Samples.UWP.csproj", "{2F1A97EB-D918-49BB-8A6C-81A1EFA16611}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvvmScarletToolkit.Wpf.Tests", "src\MvvmScarletToolkit.Wpf.Tests\MvvmScarletToolkit.Wpf.Tests.csproj", "{A9CE017F-B4C9-40DC-A092-DC5067956994}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -228,30 +228,6 @@ Global {1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x64.Build.0 = Release|Any CPU {1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x86.ActiveCfg = Release|Any CPU {1B547A43-3DB6-48FD-AF9A-EC649B5C584F}.Release|x86.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|ARM.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|ARM.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhone.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x64.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x86.ActiveCfg = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Debug|x86.Build.0 = Debug|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|Any CPU.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|ARM.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|ARM.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhone.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhone.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x64.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x64.Build.0 = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x86.ActiveCfg = Release|Any CPU - {E3C07ACA-FD4A-427D-B73A-F67C65A892B5}.Release|x86.Build.0 = Release|Any CPU {CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB537DC0-C7B6-4F6B-A66B-F9303EF4A1F0}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -376,6 +352,30 @@ Global {2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.ActiveCfg = Release|x86 {2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.Build.0 = Release|x86 {2F1A97EB-D918-49BB-8A6C-81A1EFA16611}.Release|x86.Deploy.0 = Release|x86 + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|ARM.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|ARM.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhone.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x64.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x64.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x86.ActiveCfg = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Debug|x86.Build.0 = Debug|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|Any CPU.Build.0 = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|ARM.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|ARM.Build.0 = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhone.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhone.Build.0 = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x64.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x64.Build.0 = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x86.ActiveCfg = Release|Any CPU + {A9CE017F-B4C9-40DC-A092-DC5067956994}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/MvvmScarletToolkit.Commands/Properties/AssemblyInfo.cs b/src/MvvmScarletToolkit.Commands/Properties/AssemblyInfo.cs index 90f1415e..808c4843 100644 --- a/src/MvvmScarletToolkit.Commands/Properties/AssemblyInfo.cs +++ b/src/MvvmScarletToolkit.Commands/Properties/AssemblyInfo.cs @@ -17,5 +17,4 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a85ecf94-f42d-43b2-9c65-c27e2963cf08")] -[assembly: InternalsVisibleTo("MvvmScarletToolkit.Implementations")] -[assembly: InternalsVisibleTo("MvvmScarletToolkit.Tests")] +[assembly: InternalsVisibleTo("MvvmScarletToolkit.Wpf.Tests")] diff --git a/src/MvvmScarletToolkit.Tests/CommandBuilderContextTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/CommandBuilderContextTests.cs rename to src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs diff --git a/src/MvvmScarletToolkit.Tests/CommandBuilderExtensionTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderExtensionTests.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/CommandBuilderExtensionTests.cs rename to src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderExtensionTests.cs diff --git a/src/MvvmScarletToolkit.Tests/ConcurrentCommandTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/ConcurrentCommandTests.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/ConcurrentCommandTests.cs rename to src/MvvmScarletToolkit.Wpf.Tests/ConcurrentCommandTests.cs diff --git a/src/MvvmScarletToolkit.Tests/MvvmScarletToolkit.Tests.csproj b/src/MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj similarity index 82% rename from src/MvvmScarletToolkit.Tests/MvvmScarletToolkit.Tests.csproj rename to src/MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj index 587791bf..50239c1f 100644 --- a/src/MvvmScarletToolkit.Tests/MvvmScarletToolkit.Tests.csproj +++ b/src/MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj @@ -1,7 +1,7 @@ - + - net461;netcoreapp3.1 + net461;netcoreapp3.1;net5-Windows false 8.0 @@ -21,6 +21,7 @@ + diff --git a/src/MvvmScarletToolkit.Tests/ScarletCommandBuilderTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/ScarletCommandBuilderTests.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/ScarletCommandBuilderTests.cs rename to src/MvvmScarletToolkit.Wpf.Tests/ScarletCommandBuilderTests.cs diff --git a/src/MvvmScarletToolkit.Tests/TestData/DerivedObjectViewModelBase.cs b/src/MvvmScarletToolkit.Wpf.Tests/TestData/DerivedObjectViewModelBase.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/TestData/DerivedObjectViewModelBase.cs rename to src/MvvmScarletToolkit.Wpf.Tests/TestData/DerivedObjectViewModelBase.cs diff --git a/src/MvvmScarletToolkit.Tests/TestData/DerivedViewModelBase.cs b/src/MvvmScarletToolkit.Wpf.Tests/TestData/DerivedViewModelBase.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/TestData/DerivedViewModelBase.cs rename to src/MvvmScarletToolkit.Wpf.Tests/TestData/DerivedViewModelBase.cs diff --git a/src/MvvmScarletToolkit.Tests/Util/TestDispatcher.cs b/src/MvvmScarletToolkit.Wpf.Tests/Util/TestDispatcher.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/Util/TestDispatcher.cs rename to src/MvvmScarletToolkit.Wpf.Tests/Util/TestDispatcher.cs diff --git a/src/MvvmScarletToolkit.Tests/Util/Utils.cs b/src/MvvmScarletToolkit.Wpf.Tests/Util/Utils.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/Util/Utils.cs rename to src/MvvmScarletToolkit.Wpf.Tests/Util/Utils.cs diff --git a/src/MvvmScarletToolkit.Tests/ViewModelBaseTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/ViewModelBaseTests.cs similarity index 100% rename from src/MvvmScarletToolkit.Tests/ViewModelBaseTests.cs rename to src/MvvmScarletToolkit.Wpf.Tests/ViewModelBaseTests.cs From 53c9739dc5de3e9b25fd4c11485b3dffc4e0b2b8 Mon Sep 17 00:00:00 2001 From: Peter Vietense Date: Sat, 10 Apr 2021 13:27:57 +0200 Subject: [PATCH 3/5] added handling for net5 warnings --- .../CommandBuilderContextTests.cs | 2 +- .../Attached Properties/Filter.cs | 2 +- .../Behaviors/AutoRepositionPopupBehavior.cs | 4 ++ .../Behaviors/AutoScrollBehavior.cs | 4 ++ .../LaunchNavigateUriAsNewProcessBehavior.cs | 6 ++- .../Behaviors/MultiSelectionBehavior.cs | 3 ++ .../Behaviors/PasswordBindingBehavior.cs | 4 ++ .../ScrollSelectionIntoViewBehavior.cs | 4 ++ .../Behaviors/ScrollToEndCommandBehavior.cs | 10 +++-- .../Behaviors/SelectedTreeViewItemBehavior.cs | 4 ++ .../Behaviors/WatermarkBehavior.cs | 4 ++ .../FileSystemViewModelFactory.cs | 43 +++++++++---------- .../RegistryFileExtensionMimeTypeResolver.cs | 6 ++- .../Properties/AssemblyInfo.cs | 8 ++-- 14 files changed, 71 insertions(+), 33 deletions(-) diff --git a/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs b/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs index 29b00b34..0739a278 100644 --- a/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs +++ b/src/MvvmScarletToolkit.Wpf.Tests/CommandBuilderContextTests.cs @@ -11,7 +11,7 @@ public sealed class CommandBuilderContextTests [Test] public void Ctor_DoesntThrow() { - new CommandBuilderContext(Utils.GetTestCommandManager(), Utils.TestBusyStackFactory, Utils.TestExecute, Utils.TestCanExecute); + var _ = new CommandBuilderContext(Utils.GetTestCommandManager(), Utils.TestBusyStackFactory, Utils.TestExecute, Utils.TestCanExecute); } [Test] diff --git a/src/MvvmScarletToolkit.Wpf/Attached Properties/Filter.cs b/src/MvvmScarletToolkit.Wpf/Attached Properties/Filter.cs index ff8f2315..3b958806 100644 --- a/src/MvvmScarletToolkit.Wpf/Attached Properties/Filter.cs +++ b/src/MvvmScarletToolkit.Wpf/Attached Properties/Filter.cs @@ -115,7 +115,7 @@ private static void OnByChanged(DependencyObject d, DependencyPropertyChangedEve propertyDescriptor?.RemoveValueChanged(collectionViewSource, OnViewChanged); propertyDescriptor?.AddValueChanged(collectionViewSource, OnViewChanged); - void OnViewChanged(object sender, EventArgs args) + void OnViewChanged(object? sender, EventArgs args) { if (collectionViewSource.View is null) { diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/AutoRepositionPopupBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/AutoRepositionPopupBehavior.cs index f8c4bc67..c6371363 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/AutoRepositionPopupBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/AutoRepositionPopupBehavior.cs @@ -25,6 +25,10 @@ namespace MvvmScarletToolkit // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class AutoRepositionPopupBehavior : Behavior { private const int WM_MOVING = 0x0216; diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/AutoScrollBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/AutoScrollBehavior.cs index 6e085f99..6db8b915 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/AutoScrollBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/AutoScrollBehavior.cs @@ -26,6 +26,10 @@ namespace MvvmScarletToolkit.Wpf // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class AutoScrollBehavior : Behavior { private ScrollViewer? _scrollViewer; diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/LaunchNavigateUriAsNewProcessBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/LaunchNavigateUriAsNewProcessBehavior.cs index 37f99c57..1d2e5a6d 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/LaunchNavigateUriAsNewProcessBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/LaunchNavigateUriAsNewProcessBehavior.cs @@ -20,10 +20,14 @@ namespace MvvmScarletToolkit.Wpf /// /// /// - // usage: + // usage: // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class LaunchNavigateUriAsNewProcessBehavior : Behavior { private RelayCommand? _command; diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/MultiSelectionBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/MultiSelectionBehavior.cs index 57c19377..faf337eb 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/MultiSelectionBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/MultiSelectionBehavior.cs @@ -25,6 +25,9 @@ namespace MvvmScarletToolkit // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif public sealed class MultiSelectionBehavior : Behavior { diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/PasswordBindingBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/PasswordBindingBehavior.cs index da83bcc6..3fd2898c 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/PasswordBindingBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/PasswordBindingBehavior.cs @@ -22,6 +22,10 @@ namespace MvvmScarletToolkit // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class PasswordBindingBehavior : Behavior { public string? ClearTextPassword diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollSelectionIntoViewBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollSelectionIntoViewBehavior.cs index c41f39a2..a7253c78 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollSelectionIntoViewBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollSelectionIntoViewBehavior.cs @@ -22,6 +22,10 @@ namespace MvvmScarletToolkit.Wpf // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class ScrollSelectionIntoViewBehavior : Behavior { protected override void OnAttached() diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollToEndCommandBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollToEndCommandBehavior.cs index f4698815..548fdf58 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollToEndCommandBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/ScrollToEndCommandBehavior.cs @@ -28,6 +28,10 @@ namespace MvvmScarletToolkit.Wpf // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class ScrollToEndCommandBehavior : Behavior { public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register( @@ -62,7 +66,7 @@ public TimeSpan Interval public ScrollToEndCommandBehavior() { - _scheduler = new SynchronizationContextScheduler(SynchronizationContext.Current); + _scheduler = new SynchronizationContextScheduler(SynchronizationContext.Current!); } protected override void OnAttached() @@ -106,7 +110,7 @@ private void OnLoaded(object sender, RoutedEventArgs e) propertyDescriptor?.RemoveValueChanged(scrollViewer, OnVerticalOffsetChanged); propertyDescriptor?.AddValueChanged(scrollViewer, OnVerticalOffsetChanged); - void OnVerticalOffsetChanged(object sender, EventArgs args) + void OnVerticalOffsetChanged(object? sender, EventArgs args) { var atBottom = scrollViewer.VerticalOffset >= scrollViewer.ScrollableHeight; @@ -123,7 +127,7 @@ void OnVerticalOffsetChanged(object sender, EventArgs args) propertyDescriptor?.RemoveValueChanged(scrollViewer, OnHorizontalOffsetChanged); propertyDescriptor?.AddValueChanged(scrollViewer, OnHorizontalOffsetChanged); - void OnHorizontalOffsetChanged(object sender, EventArgs args) + void OnHorizontalOffsetChanged(object? sender, EventArgs args) { var atBottom = scrollViewer.HorizontalOffset >= scrollViewer.ScrollableWidth; diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/SelectedTreeViewItemBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/SelectedTreeViewItemBehavior.cs index b84b22e4..323a40a6 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/SelectedTreeViewItemBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/SelectedTreeViewItemBehavior.cs @@ -23,6 +23,10 @@ namespace MvvmScarletToolkit // // // +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class SelectedTreeViewItemBehavior : Behavior { public object SelectedItem diff --git a/src/MvvmScarletToolkit.Wpf/Behaviors/WatermarkBehavior.cs b/src/MvvmScarletToolkit.Wpf/Behaviors/WatermarkBehavior.cs index 98d6c512..1e36856b 100644 --- a/src/MvvmScarletToolkit.Wpf/Behaviors/WatermarkBehavior.cs +++ b/src/MvvmScarletToolkit.Wpf/Behaviors/WatermarkBehavior.cs @@ -4,6 +4,10 @@ namespace MvvmScarletToolkit { +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + [StyleTypedProperty(Property = nameof(WatermarkStyle), StyleTargetType = typeof(TextBox))] public sealed class WatermarkBehavior : Behavior { diff --git a/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/FileSystemViewModelFactory.cs b/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/FileSystemViewModelFactory.cs index a6308ff8..68d72ded 100644 --- a/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/FileSystemViewModelFactory.cs +++ b/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/FileSystemViewModelFactory.cs @@ -11,6 +11,10 @@ namespace MvvmScarletToolkit.Wpf.Features.FileSystemBrowser { +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class FileSystemViewModelFactory : IFileSystemViewModelFactory { private readonly IScarletCommandBuilder _commandBuilder; @@ -28,18 +32,15 @@ public Task IsEmpty(IFileSystemParent parent) { IFileSystemDrive drive => Task.Run(() => IsDriveEmpty(drive)), IFileSystemDirectory directory => Task.Run(() => IsDirectoryEmpty(directory)), +#pragma warning disable RCS1079 // Throwing of new NotImplementedException. _ => throw new NotImplementedException(), +#pragma warning restore RCS1079 // Throwing of new NotImplementedException. }; } private static bool IsDriveEmpty(IFileSystemDrive drive) { - if (drive.DriveType == DriveType.NoRootDirectory || drive.DriveType == DriveType.Unknown) - { - return true; - } - - return false; + return drive.DriveType == DriveType.NoRootDirectory || drive.DriveType == DriveType.Unknown; } private bool IsDirectoryEmpty(IFileSystemDirectory directory) @@ -74,11 +75,9 @@ private bool IsDirectoryEmpty(string directoryPath) return result; } - public async Task CanAccess(IFileSystemChild child) + public Task CanAccess(IFileSystemChild child) { - var can = await Task.Run(() => CanAccess(child.FullName)); - - return can; + return Task.Run(() => CanAccess(child.FullName)); } private bool CanAccess(string path) @@ -88,7 +87,13 @@ private bool CanAccess(string path) return false; } +#if NET5_0_OR_GREATER +#pragma warning disable SYSLIB0003 // Type or member is obsolete +#endif var permission = new FileIOPermission(FileIOPermissionAccess.Read, AccessControlActions.View, path); +#if NET5_0_OR_GREATER +#pragma warning restore SYSLIB0003 // Type or member is obsolete +#endif try { @@ -105,11 +110,9 @@ private bool CanAccess(string path) } } - public async Task> GetDrives(IReadOnlyCollection types, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) + public Task> GetDrives(IReadOnlyCollection types, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) { - var drives = await Task.Run(() => GetDrivesInternal(types, fileAttributes, folderAttributes).ToList()); - - return drives; + return Task.Run>(() => GetDrivesInternal(types, fileAttributes, folderAttributes).ToList()); } private IEnumerable GetDrivesInternal(IReadOnlyCollection types, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) @@ -132,11 +135,9 @@ private IEnumerable GetDrivesInternal(IReadOnlyCollection new ScarletDrive(p, _commandBuilder, this, fileAttributes, folderAttributes)); } - public async Task> GetDirectories(IFileSystemParent parent, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) + public Task> GetDirectories(IFileSystemParent parent, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) { - var directories = await Task.Run(() => GetDirectoriesInternal(parent, fileAttributes, folderAttributes).ToList()); - - return directories; + return Task.Run>(() => GetDirectoriesInternal(parent, fileAttributes, folderAttributes).ToList()); } private IEnumerable GetDirectoriesInternal(IFileSystemParent parent, IReadOnlyCollection fileAttributes, IReadOnlyCollection folderAttributes) @@ -166,11 +167,9 @@ private IEnumerable GetDirectoriesInternal(IFileSystemPare return Enumerable.Empty(); } - public async Task> GetFiles(IFileSystemParent parent, IReadOnlyCollection fileAttributes) + public Task> GetFiles(IFileSystemParent parent, IReadOnlyCollection fileAttributes) { - var files = await Task.Run(() => GetFilesInternal(parent, fileAttributes).ToList()); - - return files; + return Task.Run>(() => GetFilesInternal(parent, fileAttributes).ToList()); } private IEnumerable GetFilesInternal(IFileSystemParent parent, IReadOnlyCollection fileAttributes) diff --git a/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/MimeTypeResolvers/RegistryFileExtensionMimeTypeResolver.cs b/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/MimeTypeResolvers/RegistryFileExtensionMimeTypeResolver.cs index e297a819..9aa1c349 100644 --- a/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/MimeTypeResolvers/RegistryFileExtensionMimeTypeResolver.cs +++ b/src/MvvmScarletToolkit.Wpf/Features/FileSystemBrowser/MimeTypeResolvers/RegistryFileExtensionMimeTypeResolver.cs @@ -3,6 +3,10 @@ namespace MvvmScarletToolkit.Wpf.FileSystemBrowser { +#if NET5_0_OR_GREATER + [System.Runtime.Versioning.SupportedOSPlatform("windows7.0")] +#endif + public sealed class RegistryFileExtensionMimeTypeResolver : IMimeTypeResolver { public string? Get(IFileSystemFile fileInfo) @@ -26,7 +30,7 @@ public sealed class RegistryFileExtensionMimeTypeResolver : IMimeTypeResolver return null; } - return key.GetValue("Content Type").ToString(); + return key.GetValue("Content Type")?.ToString(); } } } diff --git a/src/MvvmScarletToolkit.Wpf/Properties/AssemblyInfo.cs b/src/MvvmScarletToolkit.Wpf/Properties/AssemblyInfo.cs index 772f8b46..f21ce717 100644 --- a/src/MvvmScarletToolkit.Wpf/Properties/AssemblyInfo.cs +++ b/src/MvvmScarletToolkit.Wpf/Properties/AssemblyInfo.cs @@ -19,9 +19,9 @@ [assembly: Guid("9bd9b759-8c12-4e08-971b-9ba34d8247ff")] // Set the recommended prefix for xaml namespaces -[assembly: XmlnsPrefix(@"http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "mvvm")] +[assembly: XmlnsPrefix("http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "mvvm")] // map clr namespaces to a single xaml namespace -[assembly: XmlnsDefinition(@"http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit")] -[assembly: XmlnsDefinition(@"http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit.Wpf")] -[assembly: XmlnsDefinition(@"http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit.Wpf.FileSystemBrowser")] +[assembly: XmlnsDefinition("http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit")] +[assembly: XmlnsDefinition("http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit.Wpf")] +[assembly: XmlnsDefinition("http://SoftThorn.MvvmScarletToolkit.com/winfx/xaml/shared", "MvvmScarletToolkit.Wpf.FileSystemBrowser")] From 2f559b3f8e15a437cc89f9f0cd1ce7d0cf2854ea Mon Sep 17 00:00:00 2001 From: Peter Vietense Date: Sat, 10 Apr 2021 13:34:04 +0200 Subject: [PATCH 4/5] updated cake dependencies --- cake/Build.csproj | 8 ++++---- cake/Program.cs | 10 +++++----- cake/Tasks/Test.cs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cake/Build.csproj b/cake/Build.csproj index f7f22c7e..2b1071cf 100644 --- a/cake/Build.csproj +++ b/cake/Build.csproj @@ -10,16 +10,16 @@ - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/cake/Program.cs b/cake/Program.cs index 894f3a73..f4fadd0f 100644 --- a/cake/Program.cs +++ b/cake/Program.cs @@ -8,11 +8,11 @@ public static int Main(string[] args) return new CakeHost() .UseContext() .UseWorkingDirectory("..") - .InstallTool(new Uri("nuget:?package=Codecov&version=1.12.3")) - .InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.11.1")) - .InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.4")) - .InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.0")) - .InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=16.8.3")) + .InstallTool(new Uri("nuget:?package=Codecov&version=1.13.0")) + .InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.12.0")) + .InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.7")) + .InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.8")) + .InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=16.9.4")) .InstallTool(new Uri("nuget:?package=nuget.commandline&version=5.8.1")) .Run(args); } diff --git a/cake/Tasks/Test.cs b/cake/Tasks/Test.cs index 3b41d766..c3ae3f4d 100644 --- a/cake/Tasks/Test.cs +++ b/cake/Tasks/Test.cs @@ -8,7 +8,7 @@ public sealed class Test : FrostingTask { public override void Run(Context context) { - var projectFile = @"./src/MvvmScarletToolkit.Tests/MvvmScarletToolkit.Tests.csproj"; + var projectFile = @"./src/MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj"; var testSettings = new DotNetCoreTestSettings { Framework = "netcoreapp3.1", From 4702f49a207c2f16dd87b221a65e40a24ec87413 Mon Sep 17 00:00:00 2001 From: Peter Vietense Date: Sat, 10 Apr 2021 13:59:58 +0200 Subject: [PATCH 5/5] fixing cake test runs --- build.config | 2 +- cake/BuildContext.cs | 44 ++++++++++++++ cake/BuildLifetime.cs | 43 ++++++++++++++ cake/Context.cs | 66 --------------------- cake/Program.cs | 7 ++- cake/Tasks/BuildAndPack.cs | 14 ++--- cake/Tasks/CleanSolution.cs | 5 +- cake/Tasks/CleanSolutionAgain.cs | 5 +- cake/Tasks/CoberturaReport.cs | 7 +-- cake/Tasks/ConvertCoverage.cs | 14 ++--- cake/Tasks/Default.cs | 2 +- cake/Tasks/HtmlReport.cs | 7 +-- cake/Tasks/PushGithub.cs | 11 ++-- cake/Tasks/PushLocally.cs | 16 ++--- cake/Tasks/PushNuget.cs | 8 +-- cake/Tasks/Test.cs | 9 ++- cake/Tasks/TestAndUploadReport.cs | 4 +- cake/Tasks/UpdateAssemblyInfo.cs | 21 ++++--- cake/Tasks/UploadCodecovReport.cs | 6 +- cake/Utils.cs | 99 +++++++++++++++---------------- nuget.config | 8 +++ 21 files changed, 211 insertions(+), 187 deletions(-) create mode 100644 cake/BuildContext.cs create mode 100644 cake/BuildLifetime.cs delete mode 100644 cake/Context.cs create mode 100644 nuget.config diff --git a/build.config b/build.config index 3caa4d82..bd813b72 100644 --- a/build.config +++ b/build.config @@ -1,2 +1,2 @@ #!/usr/bin/env bash -DOTNET_VERSION=3.1.402 +DOTNET_VERSION=5.0.202 diff --git a/cake/BuildContext.cs b/cake/BuildContext.cs new file mode 100644 index 00000000..7a33cf65 --- /dev/null +++ b/cake/BuildContext.cs @@ -0,0 +1,44 @@ +using Cake.Common; +using Cake.Core; +using Cake.Core.IO; +using Cake.Frosting; +using Nerdbank.GitVersioning; + +public class BuildContext : FrostingContext +{ + public const string Platform = "AnyCPU"; + public const string BuildConfiguration = "Release"; + + public const string SolutionPath = "./MvvmScarletToolkit.sln"; + public const string AssemblyInfoPath = "./src/SharedAssemblyInfo.cs"; + public const string PackagePath = "./packages"; + public const string ResultsPath = "./results"; + public const string CoberturaResultsPath = "./results/reports/cobertura"; + public const string LocalNugetDirectoryPath = @"D:\Drop\NuGet"; + + public DirectoryPath ReportsFolder { get; } + public FilePath CoberturaResultFile { get; } + + public VersionOracle GitVersion { get; internal set; } + public string Branch { get; internal set; } + + public bool IsPublicRelease { get; internal set; } + + public string[] NugetPackageProjects { get; } + + public BuildContext(ICakeContext context) + : base(context) + { + ReportsFolder = new DirectoryPath(ResultsPath).Combine("reports").MakeAbsolute(context.Environment.WorkingDirectory); + CoberturaResultFile = new DirectoryPath(CoberturaResultsPath).CombineWithFilePath("Cobertura.xml").MakeAbsolute(context.Environment.WorkingDirectory); + + NugetPackageProjects = new[] + { + @".\src\MvvmScarletToolkit\MvvmScarletToolkit.csproj", + @".\src\MvvmScarletToolkit.Wpf\MvvmScarletToolkit.Wpf.csproj", + @".\src\MvvmScarletToolkit.Xamarin.Forms\MvvmScarletToolkit.Xamarin.Forms.csproj", + }; + + IsPublicRelease = context.EnvironmentVariable("PublicRelease", false); + } +} diff --git a/cake/BuildLifetime.cs b/cake/BuildLifetime.cs new file mode 100644 index 00000000..6b5aec2d --- /dev/null +++ b/cake/BuildLifetime.cs @@ -0,0 +1,43 @@ +using Cake.Common; +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Common.Tools.GitVersion; +using Cake.Core; +using Cake.Frosting; +using Cake.GitVersioning; + +public sealed class BuildLifetime : FrostingLifetime +{ + public override void Setup(BuildContext context) + { + context.GitVersion = context.GitVersioningGetVersion(); + context.Branch = context.GitVersion().BranchName; + + context.Information("Branch: {0}", context.Branch); + + if (context.IsPublicRelease && context.Branch == "master") + { + context.Information("Building a {0} release.", "public"); + } + else + { + context.Information("Building a {0}release.", "pre-"); + } + + context.Information("Provider: {0}", context.BuildSystem().Provider); + context.Information("Platform: {0} ({1})", context.Environment.Platform.Family, context.Environment.Platform.Is64Bit ? "x64" : "x86"); + + context.Information("NUGETORG_APIKEY was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("NUGETORG_APIKEY")) ? "not" : ""); + context.Information("GITHUB_APIKEY was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("GITHUB_APIKEY")) ? "not" : ""); + context.Information("CODECOV_TOKEN was {0} set.", string.IsNullOrEmpty(context.EnvironmentVariable("CODECOV_TOKEN")) ? "not" : ""); + + context.Information("reportsFolder: {0}", context.ReportsFolder.FullPath); + context.Information("coberturaResultFile: {0}", context.CoberturaResultFile.FullPath); + + context.Information("dotnet tool: {0}", context.Tools.Resolve("dotnet.exe")); + } + + public override void Teardown(BuildContext context, ITeardownContext info) + { + } +} diff --git a/cake/Context.cs b/cake/Context.cs deleted file mode 100644 index bfc0958a..00000000 --- a/cake/Context.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Cake.Common; -using Cake.Common.Build; -using Cake.Common.Diagnostics; -using Cake.Common.Tools.GitVersion; -using Cake.Core; -using Cake.Core.IO; -using Cake.Frosting; - -public class Context : FrostingContext -{ - public const string Platform = "AnyCPU"; - public const string BuildConfiguration = "Release"; - - public const string SolutionPath = "./MvvmScarletToolkit.sln"; - public const string AssemblyInfoPath = "./src/SharedAssemblyInfo.cs"; - public const string PackagePath = "./packages"; - public const string ResultsPath = "./results"; - public const string CoberturaResultsPath = "./results/reports/cobertura"; - public const string LocalNugetDirectoryPath = @"D:\Drop\NuGet"; - - public DirectoryPath ReportsFolder { get; } - public FilePath CoberturaResultFile { get; } - public FilePath VsTestResultsFile { get; } - - public bool IsPublicRelease { get; } - - public string[] NugetPackageProjects { get; } - - public Context(ICakeContext context) - : base(context) - { - ReportsFolder = new DirectoryPath(ResultsPath).Combine("reports").MakeAbsolute(context.Environment.WorkingDirectory); - CoberturaResultFile = new DirectoryPath(CoberturaResultsPath).CombineWithFilePath("Cobertura.xml").MakeAbsolute(context.Environment.WorkingDirectory); - VsTestResultsFile = new FilePath("vsTestResults.trx"); - - NugetPackageProjects = new[] - { - @".\src\MvvmScarletToolkit\MvvmScarletToolkit.csproj", - @".\src\MvvmScarletToolkit.Wpf\MvvmScarletToolkit.Wpf.csproj", - @".\src\MvvmScarletToolkit.Xamarin.Forms\MvvmScarletToolkit.Xamarin.Forms.csproj", - }; - - IsPublicRelease = context.EnvironmentVariable("PublicRelease", false); - - if (IsPublicRelease && this.GitVersion().BranchName == "master") - { - IsPublicRelease = true; - this.Information("Building a public release."); - } - else - { - this.Information("Building a pre-release."); - } - - this.Information($"Provider: {context.BuildSystem().Provider}"); - this.Information($"Platform: {context.Environment.Platform.Family} ({(context.Environment.Platform.Is64Bit ? "x64" : "x86")})"); - - this.Information($"NUGETORG_APIKEY was{(string.IsNullOrEmpty(context.EnvironmentVariable("NUGETORG_APIKEY")) ? " not" : "")} set."); - this.Information($"GITHUB_APIKEY was{(string.IsNullOrEmpty(context.EnvironmentVariable("GITHUB_APIKEY")) ? " not" : "")} set."); - this.Information($"CODECOV_TOKEN was{(string.IsNullOrEmpty(context.EnvironmentVariable("CODECOV_TOKEN")) ? " not" : "")} set."); - - this.Information($"reportsFolder: {ReportsFolder}"); - this.Information($"coberturaResultFile: {CoberturaResultFile}"); - this.Information($"VsTestResultsFile: {VsTestResultsFile}"); - } -} diff --git a/cake/Program.cs b/cake/Program.cs index f4fadd0f..47de5e6f 100644 --- a/cake/Program.cs +++ b/cake/Program.cs @@ -1,19 +1,20 @@ using Cake.Frosting; using System; -public class Program +public static class Program { public static int Main(string[] args) { return new CakeHost() - .UseContext() - .UseWorkingDirectory("..") .InstallTool(new Uri("nuget:?package=Codecov&version=1.13.0")) .InstallTool(new Uri("nuget:?package=NUnit.ConsoleRunner&version=3.12.0")) .InstallTool(new Uri("nuget:?package=ReportGenerator&version=4.8.7")) .InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.6.8")) .InstallTool(new Uri("nuget:?package=Microsoft.CodeCoverage&version=16.9.4")) .InstallTool(new Uri("nuget:?package=nuget.commandline&version=5.8.1")) + .UseContext() + .UseLifetime() + .UseWorkingDirectory("..") .Run(args); } } diff --git a/cake/Tasks/BuildAndPack.cs b/cake/Tasks/BuildAndPack.cs index 16acae7f..561613de 100644 --- a/cake/Tasks/BuildAndPack.cs +++ b/cake/Tasks/BuildAndPack.cs @@ -1,26 +1,24 @@ -using Build; using Cake.Common; using Cake.Core; using Cake.Core.IO; using Cake.Frosting; -using Cake.GitVersioning; using System.Linq; -public sealed class BuildAndPack : FrostingTask +public sealed class BuildAndPack : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { foreach (var project in context.NugetPackageProjects) { - var semver = context.GitVersioningGetVersion().SemVer2; + var semver = context.GitVersion.SemVer2; var settings = new ProcessSettings() .UseWorkingDirectory(".") .WithArguments(builder => builder .Append("pack") .AppendQuoted("./MvvmScarletToolkit.slnf") - .Append($"-c {Context.BuildConfiguration}") - .Append($"--output \"{Context.PackagePath}\"") - .Append($"-p:PackageVersion={context.GitVersioningGetVersion().SemVer2}") + .Append($"-c {BuildContext.BuildConfiguration}") + .Append($"--output \"{BuildContext.PackagePath}\"") + .Append($"-p:PackageVersion={context.GitVersion.SemVer2}") .Append($"-p:PublicRelease={context.IsPublicRelease}") // Nerdbank.GitVersioning - omit git commit ID // Creating symbol packages diff --git a/cake/Tasks/CleanSolution.cs b/cake/Tasks/CleanSolution.cs index 60de6499..95e7a339 100644 --- a/cake/Tasks/CleanSolution.cs +++ b/cake/Tasks/CleanSolution.cs @@ -1,9 +1,8 @@ -using Build; using Cake.Frosting; -public sealed class CleanSolution : FrostingTask +public sealed class CleanSolution : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { context.Clean(true, true, true, true); } diff --git a/cake/Tasks/CleanSolutionAgain.cs b/cake/Tasks/CleanSolutionAgain.cs index 98c9fae3..2e8b06c9 100644 --- a/cake/Tasks/CleanSolutionAgain.cs +++ b/cake/Tasks/CleanSolutionAgain.cs @@ -1,9 +1,8 @@ using Cake.Frosting; -using Build; -public sealed class CleanSolutionAgain : FrostingTask +public sealed class CleanSolutionAgain : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { context.Clean(true, true, true, false); } diff --git a/cake/Tasks/CoberturaReport.cs b/cake/Tasks/CoberturaReport.cs index bbc74e4e..7cf777bf 100644 --- a/cake/Tasks/CoberturaReport.cs +++ b/cake/Tasks/CoberturaReport.cs @@ -1,4 +1,3 @@ -using Build; using Cake.Common.IO; using Cake.Common.Tools.ReportGenerator; using Cake.Core; @@ -6,14 +5,14 @@ using Cake.Frosting; [Dependency(typeof(ConvertCoverage))] -public sealed class CoberturaReport : FrostingTask +public sealed class CoberturaReport : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { context.MergeReports("./Results/coverage/**/*.xml", ReportGeneratorReportType.Cobertura, "cobertura"); } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && context.GetFiles("./Results/coverage/**/*.xml").Count > 0; diff --git a/cake/Tasks/ConvertCoverage.cs b/cake/Tasks/ConvertCoverage.cs index 3b18e880..2024c9b8 100644 --- a/cake/Tasks/ConvertCoverage.cs +++ b/cake/Tasks/ConvertCoverage.cs @@ -1,4 +1,4 @@ -using Cake.Common; +using Cake.Common; using Cake.Common.IO; using Cake.Core; using Cake.Core.IO; @@ -6,28 +6,28 @@ using System.Linq; [Dependency(typeof(Test))] -public sealed class ConvertCoverage : FrostingTask +public sealed class ConvertCoverage : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { - foreach (var file in context.GetFiles($"{Context.ResultsPath}/coverage/**/*.coverage")) + foreach (var file in context.GetFiles($"{BuildContext.ResultsPath}/coverage/**/*.coverage")) { var codeCoverageExe = context.Tools.Resolve("CodeCoverage.exe"); var result = System.IO.Path.ChangeExtension(file.FullPath, ".xml"); var settings = new ProcessSettings() - .UseWorkingDirectory(Context.ResultsPath) + .UseWorkingDirectory(BuildContext.ResultsPath) .WithArguments(builder => builder .Append("analyze") .AppendSwitchQuoted(@"-output", ":", result) .Append(file.FullPath) ); - context.StartProcess(codeCoverageExe.FullPath, settings); + context.StartProcess(codeCoverageExe, settings); } } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && context.Tools.Resolve("CodeCoverage.exe") != null; diff --git a/cake/Tasks/Default.cs b/cake/Tasks/Default.cs index 0bb5879c..b6cf12e7 100644 --- a/cake/Tasks/Default.cs +++ b/cake/Tasks/Default.cs @@ -8,6 +8,6 @@ [Dependency(typeof(PushNuget))] [Dependency(typeof(PushGithub))] [Dependency(typeof(PushLocally))] -public sealed class Default : FrostingTask +public sealed class Default : FrostingTask { } diff --git a/cake/Tasks/HtmlReport.cs b/cake/Tasks/HtmlReport.cs index 74970542..b1f641d2 100644 --- a/cake/Tasks/HtmlReport.cs +++ b/cake/Tasks/HtmlReport.cs @@ -1,4 +1,3 @@ -using Build; using Cake.Common.IO; using Cake.Common.Tools.ReportGenerator; using Cake.Core; @@ -6,14 +5,14 @@ using Cake.Frosting; [Dependency(typeof(ConvertCoverage))] -public sealed class HtmlReport : FrostingTask +public sealed class HtmlReport : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { context.MergeReports("./Results/coverage/**/*.xml", ReportGeneratorReportType.Html, "html"); } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && context.GetFiles("./Results/coverage/**/*.xml").Count > 0; diff --git a/cake/Tasks/PushGithub.cs b/cake/Tasks/PushGithub.cs index bc6fd485..ae6dbccb 100644 --- a/cake/Tasks/PushGithub.cs +++ b/cake/Tasks/PushGithub.cs @@ -1,14 +1,15 @@ using Cake.Common; +using Cake.Common.Build; using Cake.Common.IO; using Cake.Core; using Cake.Core.IO; using Cake.Frosting; -public sealed class PushGithub : FrostingTask +public sealed class PushGithub : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { - foreach (var package in context.GetFiles(Context.PackagePath + "/*.nupkg")) + foreach (var package in context.GetFiles(BuildContext.PackagePath + "/*.nupkg")) { var settings = new ProcessSettings() .UseWorkingDirectory(".") @@ -25,10 +26,10 @@ public override void Run(Context context) } } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) - //&& (context.BuildSystem().IsRunningOnAzurePipelines || context.BuildSystem().IsRunningOnAzurePipelinesHosted) + && (context.BuildSystem().IsRunningOnAzurePipelines || context.BuildSystem().IsRunningOnAzurePipelinesHosted) && !string.IsNullOrEmpty(context.EnvironmentVariable("GITHUB_APIKEY")) && !context.IsPublicRelease; } diff --git a/cake/Tasks/PushLocally.cs b/cake/Tasks/PushLocally.cs index 8f6c8a30..e2177640 100644 --- a/cake/Tasks/PushLocally.cs +++ b/cake/Tasks/PushLocally.cs @@ -5,29 +5,29 @@ using Cake.Core.IO; using Cake.Frosting; -public sealed class PushLocally : FrostingTask +public sealed class PushLocally : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { - if (!context.NuGetHasSource(Context.LocalNugetDirectoryPath)) + if (!context.NuGetHasSource(BuildContext.LocalNugetDirectoryPath)) { - context.NuGetAddSource("Local", Context.LocalNugetDirectoryPath); + context.NuGetAddSource("Local", BuildContext.LocalNugetDirectoryPath); } - foreach (var package in context.GetFiles(Context.PackagePath + "/*.nupkg")) + foreach (var package in context.GetFiles(BuildContext.PackagePath + "/*.nupkg")) { context.NuGetPush(package, new Cake.Common.Tools.NuGet.Push.NuGetPushSettings() { - Source = Context.LocalNugetDirectoryPath, + Source = BuildContext.LocalNugetDirectoryPath, SkipDuplicate = true, }); } } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && context.BuildSystem().IsLocalBuild - && context.DirectoryExists(Context.LocalNugetDirectoryPath); + && context.DirectoryExists(BuildContext.LocalNugetDirectoryPath); } } diff --git a/cake/Tasks/PushNuget.cs b/cake/Tasks/PushNuget.cs index 1ea62f48..96576c30 100644 --- a/cake/Tasks/PushNuget.cs +++ b/cake/Tasks/PushNuget.cs @@ -6,11 +6,11 @@ using Cake.Core.IO; using Cake.Frosting; -public sealed class PushNuget : FrostingTask +public sealed class PushNuget : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { - foreach (var package in context.GetFiles(Context.PackagePath + "/*.nupkg")) + foreach (var package in context.GetFiles(BuildContext.PackagePath + "/*.nupkg")) { context.NuGetPush(package, new Cake.Common.Tools.NuGet.Push.NuGetPushSettings() { @@ -21,7 +21,7 @@ public override void Run(Context context) } } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && (context.BuildSystem().IsRunningOnAzurePipelines || context.BuildSystem().IsRunningOnAzurePipelinesHosted) diff --git a/cake/Tasks/Test.cs b/cake/Tasks/Test.cs index c3ae3f4d..77dea020 100644 --- a/cake/Tasks/Test.cs +++ b/cake/Tasks/Test.cs @@ -4,24 +4,23 @@ using Cake.Frosting; using System.Linq; -public sealed class Test : FrostingTask +public sealed class Test : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { var projectFile = @"./src/MvvmScarletToolkit.Wpf.Tests/MvvmScarletToolkit.Wpf.Tests.csproj"; var testSettings = new DotNetCoreTestSettings { - Framework = "netcoreapp3.1", + ToolPath = context.Tools.Resolve("dotnet.exe"), Configuration = "Release", NoBuild = false, NoRestore = false, ArgumentCustomization = builder => builder - .Append("--nologo") .Append("--results-directory:./Results/coverage") .Append("-p:DebugType=full") .Append("-p:DebugSymbols=true") .AppendSwitchQuoted("--collect", ":", "\"\"Code Coverage\"\"") - .Append($"--logger:trx;LogFileName=..\\{context.VsTestResultsFile.FullPath};"), + .Append($"--logger:trx;"), }; context.DotNetCoreTest(projectFile, testSettings); diff --git a/cake/Tasks/TestAndUploadReport.cs b/cake/Tasks/TestAndUploadReport.cs index b5c96f4e..0530c1b7 100644 --- a/cake/Tasks/TestAndUploadReport.cs +++ b/cake/Tasks/TestAndUploadReport.cs @@ -1,7 +1,7 @@ -using Cake.Frosting; +using Cake.Frosting; [Dependency(typeof(HtmlReport))] [Dependency(typeof(UploadCodecovReport))] -public sealed class TestAndUploadReport : FrostingTask +public sealed class TestAndUploadReport : FrostingTask { } diff --git a/cake/Tasks/UpdateAssemblyInfo.cs b/cake/Tasks/UpdateAssemblyInfo.cs index 777ca886..d8fde073 100644 --- a/cake/Tasks/UpdateAssemblyInfo.cs +++ b/cake/Tasks/UpdateAssemblyInfo.cs @@ -1,15 +1,13 @@ using Cake.Common.Solution.Project.Properties; -using Cake.Common.Tools.GitVersion; using Cake.Core.IO; using Cake.Frosting; using System; -public sealed class UpdateAssemblyInfo : FrostingTask +public sealed class UpdateAssemblyInfo : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { - var gitVersion = context.GitVersion(); - var assemblyInfoParseResult = context.ParseAssemblyInfo(Context.AssemblyInfoPath); + var assemblyInfoParseResult = context.ParseAssemblyInfo(BuildContext.AssemblyInfoPath); var settings = new AssemblyInfoSettings() { @@ -25,7 +23,7 @@ public override void Run(Context context) new AssemblyInfoMetadataAttribute() { Key = "Platform", - Value = Context.Platform, + Value = BuildContext.Platform, }, new AssemblyInfoMetadataAttribute() { @@ -40,16 +38,21 @@ public override void Run(Context context) new AssemblyInfoMetadataAttribute() { Key = "Branch", - Value = gitVersion.BranchName, + Value = context.Branch, }, new AssemblyInfoMetadataAttribute() { Key = "Commit", - Value = gitVersion.Sha, + Value = context.GitVersion.GitCommitId, + }, + new AssemblyInfoMetadataAttribute() + { + Key = "Version", + Value = context.GitVersion.SemVer2, }, } }; - context.CreateAssemblyInfo(new FilePath(Context.AssemblyInfoPath), settings); + context.CreateAssemblyInfo(new FilePath(BuildContext.AssemblyInfoPath), settings); } } diff --git a/cake/Tasks/UploadCodecovReport.cs b/cake/Tasks/UploadCodecovReport.cs index 1a41c651..71ef55d2 100644 --- a/cake/Tasks/UploadCodecovReport.cs +++ b/cake/Tasks/UploadCodecovReport.cs @@ -4,14 +4,14 @@ using Cake.Frosting; [Dependency(typeof(CoberturaReport))] -public sealed class UploadCodecovReport : FrostingTask +public sealed class UploadCodecovReport : FrostingTask { - public override void Run(Context context) + public override void Run(BuildContext context) { context.Codecov(new[] { context.CoberturaResultFile.FullPath }, context.EnvironmentVariable("CODECOV_TOKEN")); } - public override bool ShouldRun(Context context) + public override bool ShouldRun(BuildContext context) { return base.ShouldRun(context) && context.FileExists(context.CoberturaResultFile) diff --git a/cake/Utils.cs b/cake/Utils.cs index a604c9b8..5ff5b5bf 100644 --- a/cake/Utils.cs +++ b/cake/Utils.cs @@ -5,87 +5,84 @@ using Cake.Incubator.Project; using System.Linq; -namespace Build +internal static class Utils { - internal static class Utils + public static void MergeReports(this BuildContext context, string pattern, ReportGeneratorReportType type, string subFolder) { - public static void MergeReports(this Context context, string pattern, ReportGeneratorReportType type, string subFolder) + var ReportGeneratorSettings = new ReportGeneratorSettings() { - var ReportGeneratorSettings = new ReportGeneratorSettings() + AssemblyFilters = new[] { - AssemblyFilters = new[] - { "-MvvmScarletToolkit.Tests*", "-nunit3*", }, - ClassFilters = new[] - { + ClassFilters = new[] + { "-System*", "-Microsoft*", }, - ReportTypes = new[] - { + ReportTypes = new[] + { type }, - }; + }; - context.ReportGenerator(new GlobPattern(pattern), context.ReportsFolder.Combine(subFolder), ReportGeneratorSettings); - } + context.ReportGenerator(new GlobPattern(pattern), context.ReportsFolder.Combine(subFolder), ReportGeneratorSettings); + } - public static void Clean(this Context context, bool cleanBin, bool cleanObj, bool cleanOutput, bool cleanMisc) - { - var solution = context.ParseSolution(Context.SolutionPath); + public static void Clean(this BuildContext context, bool cleanBin, bool cleanObj, bool cleanOutput, bool cleanMisc) + { + var solution = context.ParseSolution(BuildContext.SolutionPath); - foreach (var project in solution.Projects) + foreach (var project in solution.Projects) + { + // check solution items and exclude solution folders, since they are virtual + if (project.Type == "{2150E333-8FDC-42A3-9474-1A3956D46DE8}") { - // check solution items and exclude solution folders, since they are virtual - if (project.Type == "{2150E333-8FDC-42A3-9474-1A3956D46DE8}") - { - continue; - } + continue; + } - var projectFile = project.Path; // FilePath - if (cleanBin) + var projectFile = project.Path; // FilePath + if (cleanBin) + { + var binFolder = projectFile.GetDirectory().Combine("bin"); + if (context.DirectoryExists(binFolder)) { - var binFolder = projectFile.GetDirectory().Combine("bin"); - if (context.DirectoryExists(binFolder)) - { - context.CleanDirectory(binFolder); - } + context.CleanDirectory(binFolder); } + } - if (cleanObj) + if (cleanObj) + { + var objFolder = projectFile.GetDirectory().Combine("obj"); + if (context.DirectoryExists(objFolder)) { - var objFolder = projectFile.GetDirectory().Combine("obj"); - if (context.DirectoryExists(objFolder)) - { - context.CleanDirectory(objFolder); - } + context.CleanDirectory(objFolder); } + } - if (cleanOutput) + if (cleanOutput) + { + var customProject = context.ParseProject(project.Path, configuration: BuildContext.BuildConfiguration, platform: BuildContext.Platform); + foreach (var path in customProject.OutputPaths.Where(p => p != null)) { - var customProject = context.ParseProject(project.Path, configuration: Context.BuildConfiguration, platform: Context.Platform); - foreach (var path in customProject.OutputPaths.Where(p => p != null)) - { - context.CleanDirectory(path.FullPath); - } + context.CleanDirectory(path.FullPath); } } + } - if (cleanMisc) + if (cleanMisc) + { + var folders = new[] { - var folders = new[] - { - Context.PackagePath, - Context.ResultsPath, + BuildContext.PackagePath, + BuildContext.ResultsPath, }; - foreach (var folder in folders) - { - context.EnsureDirectoryExists(folder); - context.CleanDirectory(folder, (file) => !file.Path.Segments.Last().Contains(".gitignore")); - } + foreach (var folder in folders) + { + context.EnsureDirectoryExists(folder); + context.CleanDirectory(folder, (file) => !file.Path.Segments.Last().Contains(".gitignore")); } } } diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..2805dff3 --- /dev/null +++ b/nuget.config @@ -0,0 +1,8 @@ + + + + + + + +