From 96d9cfa2fcbad919f7295909aad51729a48a164d Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 10 Mar 2017 20:20:51 +0100 Subject: [PATCH 1/4] Use the default compile items in core libs. Now we're using the new project system, we don't have to have a `` element for each file. --- Avalonia.sln | 3 + .../Avalonia.Animation.csproj | 18 +- src/Avalonia.Base/Avalonia.Base.csproj | 83 --------- .../Avalonia.Controls.csproj | 171 ------------------ .../Avalonia.DesignerSupport.csproj | 9 - .../Avalonia.Diagnostics.csproj | 32 +--- .../Avalonia.DotNetCoreRuntime.csproj | 17 +- .../Properties/AssemblyInfo.cs | 6 + .../Avalonia.HtmlRenderer.csproj | 1 - src/Avalonia.Input/Avalonia.Input.csproj | 51 ------ .../Avalonia.Interactivity.csproj | 9 - src/Avalonia.Layout/Avalonia.Layout.csproj | 9 - .../Avalonia.Logging.Serilog.csproj | 7 - src/Avalonia.Styling/Avalonia.Styling.csproj | 41 ----- .../Avalonia.Themes.Default.csproj | 117 +----------- src/Avalonia.Visuals/Avalonia.Visuals.csproj | 114 ------------ .../Avalonia.Markup/Avalonia.Markup.csproj | 45 ----- 17 files changed, 21 insertions(+), 712 deletions(-) create mode 100644 src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs diff --git a/Avalonia.sln b/Avalonia.sln index d563d4548b..1233e603d7 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -176,6 +176,9 @@ Global src\Shared\RenderHelpers\RenderHelpers.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4 src\Skia\Avalonia.Skia\Avalonia.Skia.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4 src\Windows\Avalonia.Win32\Avalonia.Win32.Shared.projitems*{9defc6b7-845b-4d8f-afc0-d32bf0032b8c}*SharedItemsImports = 13 + tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{d35a9f3d-8bb0-496e-bf72-444038a7debb}*SharedItemsImports = 4 + tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{dabfd304-d6a4-4752-8123-c2ccf7ac7831}*SharedItemsImports = 4 + tests\Avalonia.RenderTests\Avalonia.RenderTests.projitems*{e106cf37-4066-4615-b684-172a6d30b058}*SharedItemsImports = 4 src\Shared\PlatformSupport\PlatformSupport.projitems*{e4d9629c-f168-4224-3f51-a5e482ffbc42}*SharedItemsImports = 13 src\Shared\RenderHelpers\RenderHelpers.projitems*{fb05ac90-89ba-4f2f-a924-f37875fb547c}*SharedItemsImports = 4 EndGlobalSection diff --git a/src/Avalonia.Animation/Avalonia.Animation.csproj b/src/Avalonia.Animation/Avalonia.Animation.csproj index c27b001688..27f948b447 100644 --- a/src/Avalonia.Animation/Avalonia.Animation.csproj +++ b/src/Avalonia.Animation/Avalonia.Animation.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -26,28 +25,13 @@ CS1591 true - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - + diff --git a/src/Avalonia.Base/Avalonia.Base.csproj b/src/Avalonia.Base/Avalonia.Base.csproj index 535090fd9c..1bcfd813c8 100644 --- a/src/Avalonia.Base/Avalonia.Base.csproj +++ b/src/Avalonia.Base/Avalonia.Base.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -30,88 +29,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.Controls/Avalonia.Controls.csproj b/src/Avalonia.Controls/Avalonia.Controls.csproj index 588034bbce..72a78b0738 100644 --- a/src/Avalonia.Controls/Avalonia.Controls.csproj +++ b/src/Avalonia.Controls/Avalonia.Controls.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -30,176 +29,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj b/src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj index 45d4946951..3bb74451e7 100644 --- a/src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj +++ b/src/Avalonia.DesignerSupport/Avalonia.DesignerSupport.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -26,7 +25,6 @@ CS1591 - @@ -43,14 +41,7 @@ Properties\SharedAssemblyInfo.cs - - - - - - - diff --git a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj index 329055c56b..04499c7df3 100644 --- a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj +++ b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -27,7 +26,6 @@ true - @@ -45,34 +43,10 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - TreePageView.xaml + + %(Filename) - - DevTools.xaml - - - - - - - - - Designer - - + Designer diff --git a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj index b1a52e86ea..257e27b043 100644 --- a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj +++ b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj @@ -1,9 +1,8 @@  - - netcoreapp1.0 - False - false - + + netcoreapp1.0 + false + true full @@ -25,11 +24,8 @@ - SharedAssemblyInfo.cs + Properties\SharedAssemblyInfo.cs - - - @@ -39,9 +35,6 @@ - - - diff --git a/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs b/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..51ec3975c9 --- /dev/null +++ b/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) The Avalonia Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +using System.Reflection; + +[assembly: AssemblyTitle("Avalonia.DotNetCoreRuntime")] diff --git a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj index 0d5d328e70..7cb66d588a 100644 --- a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj +++ b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj @@ -23,7 +23,6 @@ 4 - diff --git a/src/Avalonia.Input/Avalonia.Input.csproj b/src/Avalonia.Input/Avalonia.Input.csproj index b3f58baa3b..c3b30bb435 100644 --- a/src/Avalonia.Input/Avalonia.Input.csproj +++ b/src/Avalonia.Input/Avalonia.Input.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -27,7 +26,6 @@ true - @@ -38,55 +36,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj index 1aa63cf3da..154c8d35d0 100644 --- a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj +++ b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -27,7 +26,6 @@ true - @@ -37,13 +35,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - diff --git a/src/Avalonia.Layout/Avalonia.Layout.csproj b/src/Avalonia.Layout/Avalonia.Layout.csproj index 739560b2ad..d034004428 100644 --- a/src/Avalonia.Layout/Avalonia.Layout.csproj +++ b/src/Avalonia.Layout/Avalonia.Layout.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -27,7 +26,6 @@ true - @@ -36,13 +34,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - diff --git a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj index 3aa02ee130..7905e5270d 100644 --- a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj +++ b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -24,12 +23,6 @@ bin\Release\Avalonia.Logging.Serilog.XML true - - - - - - diff --git a/src/Avalonia.Styling/Avalonia.Styling.csproj b/src/Avalonia.Styling/Avalonia.Styling.csproj index 33f6039574..bc51b4c843 100644 --- a/src/Avalonia.Styling/Avalonia.Styling.csproj +++ b/src/Avalonia.Styling/Avalonia.Styling.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -30,52 +29,12 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj index 9af563ac6c..ddf5857ce1 100644 --- a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj +++ b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -25,7 +24,6 @@ true - @@ -40,119 +38,10 @@ Properties\SharedAssemblyInfo.cs - - DefaultTheme.xaml + + %(Filename) - - - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - - - Designer - - - - - - + Designer diff --git a/src/Avalonia.Visuals/Avalonia.Visuals.csproj b/src/Avalonia.Visuals/Avalonia.Visuals.csproj index 1dcb7a180d..5f879682c2 100644 --- a/src/Avalonia.Visuals/Avalonia.Visuals.csproj +++ b/src/Avalonia.Visuals/Avalonia.Visuals.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -27,7 +26,6 @@ true - @@ -35,118 +33,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj b/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj index 1054e0ffb9..38070a3655 100644 --- a/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj +++ b/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj @@ -1,7 +1,6 @@  netstandard1.1 - False false @@ -30,46 +29,6 @@ Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -80,10 +39,6 @@ - - - - From 65dd1a423b7183e74665dec68cfc96e6be8d34e2 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 12 Mar 2017 00:30:00 +0100 Subject: [PATCH 2/4] Use the default compile items in unit tests. For the tests that have been ported to .net core at least. --- .../Avalonia.Base.UnitTests.csproj | 29 +------- .../Avalonia.Controls.UnitTests.csproj | 71 ++----------------- .../WindowTests.cs | 24 ++----- .../Avalonia.Layout.UnitTests.csproj | 54 ++++++-------- tests/coretests.props | 4 +- 5 files changed, 38 insertions(+), 144 deletions(-) diff --git a/tests/Avalonia.Base.UnitTests/Avalonia.Base.UnitTests.csproj b/tests/Avalonia.Base.UnitTests/Avalonia.Base.UnitTests.csproj index fed77a8c33..6f2007e8b1 100644 --- a/tests/Avalonia.Base.UnitTests/Avalonia.Base.UnitTests.csproj +++ b/tests/Avalonia.Base.UnitTests/Avalonia.Base.UnitTests.csproj @@ -1,36 +1,13 @@  net461;netcoreapp1.1 - {2905FF23-53FB-45E6-AA49-6AF47A172056} - - - - - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/tests/Avalonia.Controls.UnitTests/Avalonia.Controls.UnitTests.csproj b/tests/Avalonia.Controls.UnitTests/Avalonia.Controls.UnitTests.csproj index de315afe3b..c0e807f966 100644 --- a/tests/Avalonia.Controls.UnitTests/Avalonia.Controls.UnitTests.csproj +++ b/tests/Avalonia.Controls.UnitTests/Avalonia.Controls.UnitTests.csproj @@ -1,70 +1,8 @@  - - net461;netcoreapp1.1 - {5CCB5571-7C30-4E7D-967D-0E2158EBD91F} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net461;netcoreapp1.1 + + @@ -84,6 +22,7 @@ + diff --git a/tests/Avalonia.Controls.UnitTests/WindowTests.cs b/tests/Avalonia.Controls.UnitTests/WindowTests.cs index c4c637ec5b..ad88cf518c 100644 --- a/tests/Avalonia.Controls.UnitTests/WindowTests.cs +++ b/tests/Avalonia.Controls.UnitTests/WindowTests.cs @@ -4,33 +4,21 @@ // // ----------------------------------------------------------------------- +using Avalonia.Platform; +using Moq; +using Xunit; + namespace Avalonia.Controls.UnitTests { - using System.Reactive; - using System.Reactive.Subjects; - using Moq; - using Avalonia.Controls.Presenters; - using Avalonia.Controls.Templates; - using Avalonia.Input; - using Avalonia.Input.Raw; - using Avalonia.Layout; - using Avalonia.Platform; - using Avalonia.Rendering; - using Avalonia.Styling; - using Ploeh.AutoFixture; - using Ploeh.AutoFixture.AutoMoq; - using Splat; - using Xunit; - public class WindowTests { [Fact] public void Setting_Title_Should_Set_Impl_Title() { - using (Locator.CurrentMutable.WithResolver()) + using (AvaloniaLocator.EnterScope()) { var windowImpl = new Mock(); - Locator.CurrentMutable.RegisterConstant(windowImpl.Object, typeof(IWindowImpl)); + AvaloniaLocator.CurrentMutable.Bind().ToConstant(windowImpl.Object); var target = new Window(); diff --git a/tests/Avalonia.Layout.UnitTests/Avalonia.Layout.UnitTests.csproj b/tests/Avalonia.Layout.UnitTests/Avalonia.Layout.UnitTests.csproj index 4d038d1cb2..40118188dc 100644 --- a/tests/Avalonia.Layout.UnitTests/Avalonia.Layout.UnitTests.csproj +++ b/tests/Avalonia.Layout.UnitTests/Avalonia.Layout.UnitTests.csproj @@ -1,33 +1,25 @@  - - net461;netcoreapp1.1 - {DB070A10-BF39-4752-8456-86E9D5928478} - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net461;netcoreapp1.1 + {DB070A10-BF39-4752-8456-86E9D5928478} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/coretests.props b/tests/coretests.props index 57b235dd60..ab9d865b48 100644 --- a/tests/coretests.props +++ b/tests/coretests.props @@ -1,7 +1,5 @@ - - + - False false true From a2fe941e2ee5aa5b00268eb3eaa4c69327c6525b Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 12 Mar 2017 00:39:17 +0100 Subject: [PATCH 3/4] Added more comments on workaround. --- src/Shared/nuget.workaround.targets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Shared/nuget.workaround.targets b/src/Shared/nuget.workaround.targets index bf6b71ddba..dee700ce08 100644 --- a/src/Shared/nuget.workaround.targets +++ b/src/Shared/nuget.workaround.targets @@ -1,5 +1,9 @@ - + From d7703d619ca96f29b1f6284b205b00c79fe20c89 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sun, 12 Mar 2017 00:53:24 +0100 Subject: [PATCH 4/4] Fixed failing test. And removed `TestServices.WindowImpl` as it was being ignored. --- tests/Avalonia.Controls.UnitTests/WindowTests.cs | 9 +++++---- tests/Avalonia.UnitTests/TestServices.cs | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/Avalonia.Controls.UnitTests/WindowTests.cs b/tests/Avalonia.Controls.UnitTests/WindowTests.cs index ad88cf518c..7b5e3197df 100644 --- a/tests/Avalonia.Controls.UnitTests/WindowTests.cs +++ b/tests/Avalonia.Controls.UnitTests/WindowTests.cs @@ -5,6 +5,7 @@ // ----------------------------------------------------------------------- using Avalonia.Platform; +using Avalonia.UnitTests; using Moq; using Xunit; @@ -15,11 +16,11 @@ namespace Avalonia.Controls.UnitTests [Fact] public void Setting_Title_Should_Set_Impl_Title() { - using (AvaloniaLocator.EnterScope()) - { - var windowImpl = new Mock(); - AvaloniaLocator.CurrentMutable.Bind().ToConstant(windowImpl.Object); + var windowImpl = new Mock(); + var windowingPlatform = new MockWindowingPlatform(() => windowImpl.Object); + using (UnitTestApplication.Start(new TestServices(windowingPlatform: windowingPlatform))) + { var target = new Window(); target.Title = "Hello World"; diff --git a/tests/Avalonia.UnitTests/TestServices.cs b/tests/Avalonia.UnitTests/TestServices.cs index 8dc838163f..a5d9fb6d2f 100644 --- a/tests/Avalonia.UnitTests/TestServices.cs +++ b/tests/Avalonia.UnitTests/TestServices.cs @@ -67,7 +67,6 @@ namespace Avalonia.UnitTests IStyler styler = null, Func theme = null, IPlatformThreadingInterface threadingInterface = null, - IWindowImpl windowImpl = null, IWindowingPlatform windowingPlatform = null) { AssetLoader = assetLoader; @@ -83,7 +82,6 @@ namespace Avalonia.UnitTests Styler = styler; Theme = theme; ThreadingInterface = threadingInterface; - WindowImpl = windowImpl; WindowingPlatform = windowingPlatform; } @@ -100,7 +98,6 @@ namespace Avalonia.UnitTests public IStyler Styler { get; } public Func Theme { get; } public IPlatformThreadingInterface ThreadingInterface { get; } - public IWindowImpl WindowImpl { get; } public IWindowingPlatform WindowingPlatform { get; } public TestServices With( @@ -134,7 +131,6 @@ namespace Avalonia.UnitTests styler: styler ?? Styler, theme: theme ?? Theme, threadingInterface: threadingInterface ?? ThreadingInterface, - windowImpl: windowImpl ?? WindowImpl, windowingPlatform: windowingPlatform ?? WindowingPlatform); }