diff --git a/.editorconfig b/.editorconfig index d5b2badfd5..42c6f62e9c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -159,12 +159,12 @@ dotnet_diagnostic.CA1815.severity = warning # CA1820: Test for empty strings using string length dotnet_diagnostic.CA1820.severity = warning # CA1821: Remove empty finalizers -dotnet_diagnostic.CA1821.severity = warning +dotnet_diagnostic.CA1821.severity = error # CA1822: Mark members as static dotnet_diagnostic.CA1822.severity = suggestion -# CA1823: Avoid unused private fields -dotnet_diagnostic.CA1823.severity = warning dotnet_code_quality.CA1822.api_surface = private, internal +# CA1823: Avoid unused private fields +dotnet_diagnostic.CA1823.severity = error # CA1825: Avoid zero-length array allocations dotnet_diagnostic.CA1825.severity = warning # CA1826: Use property instead of Linq Enumerable method @@ -212,6 +212,12 @@ indent_size = 2 avalonia_xaml_diagnostic.AVLN2203.severity = error # StyleInMergedDictionaries avalonia_xaml_diagnostic.AVLN2204.severity = error +# RequiredTemplatePartMissing +avalonia_xaml_diagnostic.AVLN2205.severity = error +# OptionalTemplatePartMissing +avalonia_xaml_diagnostic.AVLN2206.severity = info +# TemplatePartWrongType +avalonia_xaml_diagnostic.AVLN2207.severity = error # Obsolete avalonia_xaml_diagnostic.AVLN5001.severity = error diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 36cf0233ac..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve Avalonia -title: '' -labels: bug -assignees: '' ---- - -## Describe the bug -A clear and concise description of what the bug is. - -## To Reproduce -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -## Expected behavior -A clear and concise description of what you expected to happen. - -## Screenshots -If applicable, add screenshots to help explain your problem. - -## Environment - -- OS: [e.g. Windows, Mac, Linux (State distribution), Android, iOS, Browser] -- Avalonia-Version: [e.g. 11.x.y or 0.10.x] - -## Additional context -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..e70693d358 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,50 @@ +name: Bug Report +description: File a bug report +labels: ["bug"] +body: + - type: textarea + id: what-happened + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + id: steps + attributes: + label: To Reproduce + description: Steps to reproduce the behavior. + validations: + required: true + - type: textarea + id: what-expected + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + - type: input + id: avalonia-version + attributes: + label: Avalonia version + placeholder: e.g. 11.0.9, 11.1.0 + validations: + required: true + - type: dropdown + id: os + attributes: + label: OS + multiple: true + options: + - Windows + - macOS + - Linux + - WebAssembly + - Android + - iOS + - Tizen + - type: textarea + id: additional-info + attributes: + label: Additional context + description: | + Add any other context about the problem here. + If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 21c00665a0..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' ---- - -## Is your feature request related to a problem? Please describe. -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -## Describe the solution you'd like -A clear and concise description of what you want to happen. - -## Describe alternatives you've considered -A clear and concise description of any alternative solutions or features you've considered. - -## Additional context -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..36dae1277c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,28 @@ +name: Feature request +description: Suggest an idea for this project +labels: ["enhancement"] +body: + - type: textarea + id: problem + attributes: + label: Is your feature request related to a problem? Please describe. + description: A clear and concise description of what the problem is. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/CLA.yml b/.github/workflows/CLA.yml new file mode 100644 index 0000000000..b197fb53cc --- /dev/null +++ b/.github/workflows/CLA.yml @@ -0,0 +1,22 @@ +name: "Avalonia CLA Bot" +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened,closed,synchronize] + +jobs: + Runner: + runs-on: ubuntu-latest + steps: + - name: 'Clone bot repo' + if: github.event.issue.pull_request && ((github.event.comment.user.login != 'cla-avalonia') || github.event_name == 'pull_request_target') + run : | + rm -rf ./github-action/ + git clone https://${{ secrets.CLA_PAT }}:@github.com/AvaloniaUI/AvaloniaCLABot --branch=main --depth=1 --recursive CLABot + + - name: "Run CLA bot" + if: github.event.issue.pull_request && ((github.event.comment.user.login != 'cla-avalonia') || github.event_name == 'pull_request_target') + uses: ./CLABot + env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_PAT }} diff --git a/.gitmodules b/.gitmodules index 6e9f2f7c14..032bc879cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,3 @@ [submodule "nukebuild/il-repack"] path = nukebuild/il-repack url = https://github.com/Gillibald/il-repack -[submodule "external/Tmds.DBus.SourceGenerator"] - path = external/Tmds.DBus.SourceGenerator - url = https://github.com/jmacato/Tmds.DBus.SourceGenerator.git diff --git a/.ncrunch/AppWithoutLifetime.v3.ncrunchproject b/.ncrunch/AppWithoutLifetime.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/AppWithoutLifetime.v3.ncrunchproject +++ b/.ncrunch/AppWithoutLifetime.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Analyzers.v3.ncrunchproject b/.ncrunch/Avalonia.Analyzers.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/Avalonia.Analyzers.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Android.v3.ncrunchproject b/.ncrunch/Avalonia.Android.v3.ncrunchproject index 319cd523ce..1335822600 100644 --- a/.ncrunch/Avalonia.Android.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Android.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-android34.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Base.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Base.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Base.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject b/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Browser.Blazor.v3.ncrunchproject b/.ncrunch/Avalonia.Browser.Blazor.v3.ncrunchproject index 319cd523ce..7e6955b244 100644 --- a/.ncrunch/Avalonia.Browser.Blazor.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Browser.Blazor.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-browser + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Browser.v3.ncrunchproject b/.ncrunch/Avalonia.Browser.v3.ncrunchproject index 319cd523ce..7e6955b244 100644 --- a/.ncrunch/Avalonia.Browser.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Browser.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-browser + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Build.Tasks.UnitTest.v3.ncrunchproject b/.ncrunch/Avalonia.Build.Tasks.UnitTest.v3.ncrunchproject new file mode 100644 index 0000000000..f144353670 --- /dev/null +++ b/.ncrunch/Avalonia.Build.Tasks.UnitTest.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + TargetFramework = net472 + + True + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject b/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.DataGrid.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.DataGrid.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Controls.DataGrid.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Controls.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Designer.HostApp.v3.ncrunchproject b/.ncrunch/Avalonia.Designer.HostApp.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Avalonia.Designer.HostApp.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Designer.HostApp.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.DesignerSupport.TestApp.v3.ncrunchproject b/.ncrunch/Avalonia.DesignerSupport.TestApp.v3.ncrunchproject index 319cd523ce..1733492c89 100644 --- a/.ncrunch/Avalonia.DesignerSupport.TestApp.v3.ncrunchproject +++ b/.ncrunch/Avalonia.DesignerSupport.TestApp.v3.ncrunchproject @@ -1,5 +1,7 @@  - True + + TargetFramework = net8.0 + \ No newline at end of file diff --git a/.ncrunch/Avalonia.DesignerSupport.Tests.v3.ncrunchproject b/.ncrunch/Avalonia.DesignerSupport.Tests.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Avalonia.DesignerSupport.Tests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.DesignerSupport.Tests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject b/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Designer.HostApp.net461.v3.ncrunchproject b/.ncrunch/Avalonia.FreeDesktop.net6.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/Avalonia.Designer.HostApp.net461.v3.ncrunchproject rename to .ncrunch/Avalonia.FreeDesktop.net6.0.v3.ncrunchproject diff --git a/.ncrunch/Avalonia.Designer.HostApp.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.FreeDesktop.netstandard2.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/Avalonia.Designer.HostApp.netcoreapp2.0.v3.ncrunchproject rename to .ncrunch/Avalonia.FreeDesktop.netstandard2.0.v3.ncrunchproject diff --git a/.ncrunch/Avalonia.Generators.Tests.v3.ncrunchproject b/.ncrunch/Avalonia.Generators.Tests.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Avalonia.Generators.Tests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Generators.Tests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Generators.v3.ncrunchproject b/.ncrunch/Avalonia.Generators.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/Avalonia.Generators.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Headless.NUnit.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Headless.NUnit.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Headless.NUnit.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Headless.XUnit.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Headless.XUnit.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Headless.XUnit.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.IntegrationTests.Appium.v3.ncrunchproject b/.ncrunch/Avalonia.IntegrationTests.Appium.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Avalonia.IntegrationTests.Appium.v3.ncrunchproject +++ b/.ncrunch/Avalonia.IntegrationTests.Appium.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject b/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject new file mode 100644 index 0000000000..18f2aee75c --- /dev/null +++ b/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net462 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.Xaml.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.MicroCom.v3.ncrunchproject b/.ncrunch/Avalonia.MicroCom.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/Avalonia.MicroCom.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.RenderTests.WpfCompare.v3.ncrunchproject b/.ncrunch/Avalonia.RenderTests.WpfCompare.v3.ncrunchproject new file mode 100644 index 0000000000..96fdff3555 --- /dev/null +++ b/.ncrunch/Avalonia.RenderTests.WpfCompare.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0-windows + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject b/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..1733492c89 --- /dev/null +++ b/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0 + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Themes.Simple.net6.0.v3.ncrunchproject b/.ncrunch/Avalonia.Themes.Simple.net6.0.v3.ncrunchproject deleted file mode 100644 index 02eb0d211e..0000000000 --- a/.ncrunch/Avalonia.Themes.Simple.net6.0.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - False - - \ No newline at end of file diff --git a/.ncrunch/Avalonia.Themes.Simple.net8.0.v3.ncrunchproject b/.ncrunch/Avalonia.Themes.Simple.net8.0.v3.ncrunchproject new file mode 100644 index 0000000000..bc1af9a143 --- /dev/null +++ b/.ncrunch/Avalonia.Themes.Simple.net8.0.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + ..\Avalonia.Themes.Fluent\Strings\InvariantResources.xaml + + False + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Themes.Simple.netstandard2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Themes.Simple.netstandard2.0.v3.ncrunchproject index 02eb0d211e..bc1af9a143 100644 --- a/.ncrunch/Avalonia.Themes.Simple.netstandard2.0.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Themes.Simple.netstandard2.0.v3.ncrunchproject @@ -1,5 +1,8 @@  + + ..\Avalonia.Themes.Fluent\Strings\InvariantResources.xaml + False \ No newline at end of file diff --git a/.ncrunch/Avalonia.Tizen.v3.ncrunchproject b/.ncrunch/Avalonia.Tizen.v3.ncrunchproject index 319cd523ce..d2c880c578 100644 --- a/.ncrunch/Avalonia.Tizen.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Tizen.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-tizen + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject index cff5044edf..7a4ea98049 100644 --- a/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = netstandard2.0 + False \ No newline at end of file diff --git a/.ncrunch/Avalonia.Win32.Interoperability.v3.ncrunchproject b/.ncrunch/Avalonia.Win32.Interoperability.v3.ncrunchproject new file mode 100644 index 0000000000..96fdff3555 --- /dev/null +++ b/.ncrunch/Avalonia.Win32.Interoperability.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = net8.0-windows + + + \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.net6.0.v3.ncrunchproject b/.ncrunch/Avalonia.X11.net6.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/ControlCatalog.net6.0.v3.ncrunchproject rename to .ncrunch/Avalonia.X11.net6.0.v3.ncrunchproject diff --git a/.ncrunch/PInvoke.net6.0.v3.ncrunchproject b/.ncrunch/Avalonia.X11.netstandard2.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/PInvoke.net6.0.v3.ncrunchproject rename to .ncrunch/Avalonia.X11.netstandard2.0.v3.ncrunchproject diff --git a/.ncrunch/Avalonia.iOS.v3.ncrunchproject b/.ncrunch/Avalonia.iOS.v3.ncrunchproject index 319cd523ce..00c1cea8f4 100644 --- a/.ncrunch/Avalonia.iOS.v3.ncrunchproject +++ b/.ncrunch/Avalonia.iOS.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = netstandard2.0 + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.net8.0.v3.ncrunchproject b/.ncrunch/Avalonia.net8.0.v3.ncrunchproject new file mode 100644 index 0000000000..4fdcd169ae --- /dev/null +++ b/.ncrunch/Avalonia.net8.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + DerivedFilesIncludedInWorkspace + + + \ No newline at end of file diff --git a/.ncrunch/BindingDemo.v3.ncrunchproject b/.ncrunch/BindingDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/BindingDemo.v3.ncrunchproject +++ b/.ncrunch/BindingDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.Android.v3.ncrunchproject b/.ncrunch/ControlCatalog.Android.v3.ncrunchproject index 319cd523ce..1335822600 100644 --- a/.ncrunch/ControlCatalog.Android.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.Android.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-android34.0 + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.Browser.Blazor.v3.ncrunchproject b/.ncrunch/ControlCatalog.Browser.Blazor.v3.ncrunchproject index 319cd523ce..7e6955b244 100644 --- a/.ncrunch/ControlCatalog.Browser.Blazor.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.Browser.Blazor.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-browser + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.Browser.v3.ncrunchproject b/.ncrunch/ControlCatalog.Browser.v3.ncrunchproject index 319cd523ce..7e6955b244 100644 --- a/.ncrunch/ControlCatalog.Browser.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.Browser.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-browser + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.Desktop.v3.ncrunchproject b/.ncrunch/ControlCatalog.Desktop.v3.ncrunchproject index 319cd523ce..ea3a821a00 100644 --- a/.ncrunch/ControlCatalog.Desktop.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.Desktop.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net461 + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.NetCore.v3.ncrunchproject b/.ncrunch/ControlCatalog.NetCore.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/ControlCatalog.NetCore.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.NetCore.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.Tizen.v3.ncrunchproject b/.ncrunch/ControlCatalog.Tizen.v3.ncrunchproject index 319cd523ce..d2c880c578 100644 --- a/.ncrunch/ControlCatalog.Tizen.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.Tizen.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-tizen + True \ No newline at end of file diff --git a/.ncrunch/ControlCatalog.iOS.v3.ncrunchproject b/.ncrunch/ControlCatalog.iOS.v3.ncrunchproject index 319cd523ce..6ae5567f23 100644 --- a/.ncrunch/ControlCatalog.iOS.v3.ncrunchproject +++ b/.ncrunch/ControlCatalog.iOS.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-ios17.0 + True \ No newline at end of file diff --git a/.ncrunch/PInvoke.netstandard2.0.v3.ncrunchproject b/.ncrunch/ControlCatalog.net8.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/PInvoke.netstandard2.0.v3.ncrunchproject rename to .ncrunch/ControlCatalog.net8.0.v3.ncrunchproject diff --git a/.ncrunch/ControlSamples.v3.ncrunchproject b/.ncrunch/ControlSamples.v3.ncrunchproject index 319cd523ce..00c1cea8f4 100644 --- a/.ncrunch/ControlSamples.v3.ncrunchproject +++ b/.ncrunch/ControlSamples.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = netstandard2.0 + True \ No newline at end of file diff --git a/.ncrunch/DevAnalyzers.v3.ncrunchproject b/.ncrunch/DevAnalyzers.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/DevAnalyzers.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/DevGenerators.v3.ncrunchproject b/.ncrunch/DevGenerators.v3.ncrunchproject new file mode 100644 index 0000000000..a079eefacf --- /dev/null +++ b/.ncrunch/DevGenerators.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + TargetFramework = netstandard2.0 + + + \ No newline at end of file diff --git a/.ncrunch/Generators.Sandbox.v3.ncrunchproject b/.ncrunch/Generators.Sandbox.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Generators.Sandbox.v3.ncrunchproject +++ b/.ncrunch/Generators.Sandbox.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/GpuInterop.v3.ncrunchproject b/.ncrunch/GpuInterop.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/GpuInterop.v3.ncrunchproject +++ b/.ncrunch/GpuInterop.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/IntegrationTestApp.v3.ncrunchproject b/.ncrunch/IntegrationTestApp.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/IntegrationTestApp.v3.ncrunchproject +++ b/.ncrunch/IntegrationTestApp.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/MiniMvvm.v3.ncrunchproject b/.ncrunch/MiniMvvm.v3.ncrunchproject index 319cd523ce..00c1cea8f4 100644 --- a/.ncrunch/MiniMvvm.v3.ncrunchproject +++ b/.ncrunch/MiniMvvm.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = netstandard2.0 + True \ No newline at end of file diff --git a/.ncrunch/PInvoke.v3.ncrunchproject b/.ncrunch/PInvoke.v3.ncrunchproject new file mode 100644 index 0000000000..00c1cea8f4 --- /dev/null +++ b/.ncrunch/PInvoke.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + TargetFramework = netstandard2.0 + + True + + \ No newline at end of file diff --git a/.ncrunch/PlatformSanityChecks.v3.ncrunchproject b/.ncrunch/PlatformSanityChecks.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/PlatformSanityChecks.v3.ncrunchproject +++ b/.ncrunch/PlatformSanityChecks.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Previewer.v3.ncrunchproject b/.ncrunch/Previewer.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Previewer.v3.ncrunchproject +++ b/.ncrunch/Previewer.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/ReactiveUIDemo.v3.ncrunchproject b/.ncrunch/ReactiveUIDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/ReactiveUIDemo.v3.ncrunchproject +++ b/.ncrunch/ReactiveUIDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/RemoteDemo.v3.ncrunchproject b/.ncrunch/RemoteDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/RemoteDemo.v3.ncrunchproject +++ b/.ncrunch/RemoteDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/RenderDemo.v3.ncrunchproject b/.ncrunch/RenderDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/RenderDemo.v3.ncrunchproject +++ b/.ncrunch/RenderDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject index 319cd523ce..1335822600 100644 --- a/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject +++ b/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-android34.0 + True \ No newline at end of file diff --git a/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject +++ b/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject index 319cd523ce..6ae5567f23 100644 --- a/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject +++ b/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-ios17.0 + True \ No newline at end of file diff --git a/.ncrunch/SafeAreaDemo.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/SafeAreaDemo.v3.ncrunchproject +++ b/.ncrunch/SafeAreaDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/Sandbox.v3.ncrunchproject b/.ncrunch/Sandbox.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/Sandbox.v3.ncrunchproject +++ b/.ncrunch/Sandbox.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/SingleProjectSandbox.v3.ncrunchproject b/.ncrunch/SingleProjectSandbox.v3.ncrunchproject new file mode 100644 index 0000000000..3b82c33f1c --- /dev/null +++ b/.ncrunch/SingleProjectSandbox.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + TargetFramework = net8.0 + + True + + \ No newline at end of file diff --git a/.ncrunch/UnloadableAssemblyLoadContext.v3.ncrunchproject b/.ncrunch/UnloadableAssemblyLoadContext.v3.ncrunchproject new file mode 100644 index 0000000000..f074de260d --- /dev/null +++ b/.ncrunch/UnloadableAssemblyLoadContext.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + TargetFramework = net7.0 + + True + + \ No newline at end of file diff --git a/.ncrunch/UnloadableAssemblyLoadContextPlug.v3.ncrunchproject b/.ncrunch/UnloadableAssemblyLoadContextPlug.v3.ncrunchproject new file mode 100644 index 0000000000..f074de260d --- /dev/null +++ b/.ncrunch/UnloadableAssemblyLoadContextPlug.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + TargetFramework = net7.0 + + True + + \ No newline at end of file diff --git a/.ncrunch/VirtualizationDemo.v3.ncrunchproject b/.ncrunch/VirtualizationDemo.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/VirtualizationDemo.v3.ncrunchproject +++ b/.ncrunch/VirtualizationDemo.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.ncrunch/WindowsInteropTest.net461.v3.ncrunchproject b/.ncrunch/WindowsInteropTest.net461.v3.ncrunchproject deleted file mode 100644 index 319cd523ce..0000000000 --- a/.ncrunch/WindowsInteropTest.net461.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - True - - \ No newline at end of file diff --git a/.ncrunch/WindowsInteropTest.net6.0-windows.v3.ncrunchproject b/.ncrunch/WindowsInteropTest.net6.0-windows.v3.ncrunchproject deleted file mode 100644 index 319cd523ce..0000000000 --- a/.ncrunch/WindowsInteropTest.net6.0-windows.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - True - - \ No newline at end of file diff --git a/.ncrunch/WindowsInteropTest.v3.ncrunchproject b/.ncrunch/WindowsInteropTest.v3.ncrunchproject index 319cd523ce..484445df0e 100644 --- a/.ncrunch/WindowsInteropTest.v3.ncrunchproject +++ b/.ncrunch/WindowsInteropTest.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0-windows + True \ No newline at end of file diff --git a/.ncrunch/_build.v3.ncrunchproject b/.ncrunch/_build.v3.ncrunchproject index 319cd523ce..3b82c33f1c 100644 --- a/.ncrunch/_build.v3.ncrunchproject +++ b/.ncrunch/_build.v3.ncrunchproject @@ -1,5 +1,8 @@  + + TargetFramework = net8.0 + True \ No newline at end of file diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index a21636409b..f833ddd89a 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -73,6 +73,7 @@ "items": { "type": "string", "enum": [ + "BuildToNuGetCache", "CiAzureLinux", "CiAzureOSX", "CiAzureWindows", @@ -84,6 +85,7 @@ "CreateNugetPackages", "GenerateCppHeaders", "OutputApiDiff", + "OutputVersion", "Package", "RunCoreLibsTests", "RunHtmlPreviewerTests", @@ -108,6 +110,7 @@ "items": { "type": "string", "enum": [ + "BuildToNuGetCache", "CiAzureLinux", "CiAzureOSX", "CiAzureWindows", @@ -119,6 +122,7 @@ "CreateNugetPackages", "GenerateCppHeaders", "OutputApiDiff", + "OutputVersion", "Package", "RunCoreLibsTests", "RunHtmlPreviewerTests", @@ -143,6 +147,9 @@ "Quiet", "Verbose" ] + }, + "version-output-dir": { + "type": "string" } } } diff --git a/Avalonia.Desktop.slnf b/Avalonia.Desktop.slnf index c63d55f2b4..799e920441 100644 --- a/Avalonia.Desktop.slnf +++ b/Avalonia.Desktop.slnf @@ -2,7 +2,6 @@ "solution": { "path": "Avalonia.sln", "projects": [ - "external\\Tmds.DBus.SourceGenerator\\Tmds.DBus.SourceGenerator\\Tmds.DBus.SourceGenerator.csproj", "packages\\Avalonia\\Avalonia.csproj", "samples\\AppWithoutLifetime\\AppWithoutLifetime.csproj", "samples\\ControlCatalog.NetCore\\ControlCatalog.NetCore.csproj", @@ -14,11 +13,12 @@ "samples\\RenderDemo\\RenderDemo.csproj", "samples\\SampleControls\\ControlSamples.csproj", "samples\\Sandbox\\Sandbox.csproj", + "samples\\UnloadableAssemblyLoadContext\\UnloadableAssemblyLoadContextPlug\\UnloadableAssemblyLoadContextPlug.csproj", + "samples\\UnloadableAssemblyLoadContext\\UnloadableAssemblyLoadContext\\UnloadableAssemblyLoadContext.csproj", "src\\Avalonia.Base\\Avalonia.Base.csproj", "src\\Avalonia.Build.Tasks\\Avalonia.Build.Tasks.csproj", "src\\Avalonia.Controls.ColorPicker\\Avalonia.Controls.ColorPicker.csproj", "src\\Avalonia.Controls.DataGrid\\Avalonia.Controls.DataGrid.csproj", - "src\\Avalonia.Controls.ItemsRepeater\\Avalonia.Controls.ItemsRepeater.csproj", "src\\Avalonia.Controls\\Avalonia.Controls.csproj", "src\\Avalonia.DesignerSupport\\Avalonia.DesignerSupport.csproj", "src\\Avalonia.Desktop\\Avalonia.Desktop.csproj", @@ -30,6 +30,7 @@ "src\\Avalonia.MicroCom\\Avalonia.MicroCom.csproj", "src\\Avalonia.Native\\Avalonia.Native.csproj", "src\\Avalonia.OpenGL\\Avalonia.OpenGL.csproj", + "src\\Avalonia.Vulkan\\Avalonia.Vulkan.csproj", "src\\Avalonia.ReactiveUI\\Avalonia.ReactiveUI.csproj", "src\\Avalonia.Remote.Protocol\\Avalonia.Remote.Protocol.csproj", "src\\Avalonia.Themes.Fluent\\Avalonia.Themes.Fluent.csproj", @@ -51,21 +52,24 @@ "src\\Windows\\Avalonia.Win32\\Avalonia.Win32.csproj", "tests\\Avalonia.Base.UnitTests\\Avalonia.Base.UnitTests.csproj", "tests\\Avalonia.Benchmarks\\Avalonia.Benchmarks.csproj", + "tests\\Avalonia.Build.Tasks.UnitTest\\Avalonia.Build.Tasks.UnitTest.csproj", "tests\\Avalonia.Controls.DataGrid.UnitTests\\Avalonia.Controls.DataGrid.UnitTests.csproj", - "tests\\Avalonia.Controls.ItemsRepeater.UnitTests\\Avalonia.Controls.ItemsRepeater.UnitTests.csproj", "tests\\Avalonia.Controls.UnitTests\\Avalonia.Controls.UnitTests.csproj", "tests\\Avalonia.DesignerSupport.TestApp\\Avalonia.DesignerSupport.TestApp.csproj", "tests\\Avalonia.DesignerSupport.Tests\\Avalonia.DesignerSupport.Tests.csproj", "tests\\Avalonia.Direct2D1.RenderTests\\Avalonia.Direct2D1.RenderTests.csproj", "tests\\Avalonia.Direct2D1.UnitTests\\Avalonia.Direct2D1.UnitTests.csproj", + "tests\\Avalonia.Generators.Tests\\Avalonia.Generators.Tests.csproj", "tests\\Avalonia.IntegrationTests.Appium\\Avalonia.IntegrationTests.Appium.csproj", "tests\\Avalonia.LeakTests\\Avalonia.LeakTests.csproj", "tests\\Avalonia.Markup.UnitTests\\Avalonia.Markup.UnitTests.csproj", "tests\\Avalonia.Markup.Xaml.UnitTests\\Avalonia.Markup.Xaml.UnitTests.csproj", "tests\\Avalonia.ReactiveUI.UnitTests\\Avalonia.ReactiveUI.UnitTests.csproj", + "tests\\Avalonia.RenderTests.WpfCompare\\Avalonia.RenderTests.WpfCompare.csproj", "tests\\Avalonia.Skia.RenderTests\\Avalonia.Skia.RenderTests.csproj", "tests\\Avalonia.Skia.UnitTests\\Avalonia.Skia.UnitTests.csproj", - "tests\\Avalonia.UnitTests\\Avalonia.UnitTests.csproj" + "tests\\Avalonia.UnitTests\\Avalonia.UnitTests.csproj", + "tests\\TestFiles\\BuildTasks\\PInvoke\\PInvoke.csproj" ] } } \ No newline at end of file diff --git a/Avalonia.sln b/Avalonia.sln index 119b7ab197..2ebd2550ae 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 @@ -120,6 +119,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Props", "Props", "{F3AC8BC1 build\TrimmingEnable.props = build\TrimmingEnable.props build\UnitTests.NetFX.props = build\UnitTests.NetFX.props build\XUnit.props = build\XUnit.props + build\TargetFrameworks.props = build\TargetFrameworks.props + build\WarnAsErrors.props = build\WarnAsErrors.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{4D6FAF79-58B4-482F-9122-0668C346364C}" @@ -127,6 +128,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{4D6F build\BuildTargets.targets = build\BuildTargets.targets build\LegacyProject.targets = build\LegacyProject.targets build\UnitTests.NetCore.targets = build\UnitTests.NetCore.targets + build\DevSingleProject.targets = build\DevSingleProject.targets EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux", "Linux", "{86C53C40-57AA-45B8-AD42-FAE0EFDF0F2B}" @@ -211,13 +213,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.DesignerSupport.Te EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevGenerators", "src\tools\DevGenerators\DevGenerators.csproj", "{1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox", "samples\MobileSandbox\MobileSandbox.csproj", "{3B8519C1-2F51-4F12-A348-120AB91D4532}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Android", "samples\MobileSandbox.Android\MobileSandbox.Android.csproj", "{C90FE60B-B01E-4F35-91D6-379D6966030F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.iOS", "samples\MobileSandbox.iOS\MobileSandbox.iOS.csproj", "{FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Desktop", "samples\MobileSandbox.Desktop\MobileSandbox.Desktop.csproj", "{62D392C9-81CF-487F-92E8-598B2AF3FDCE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SingleProjectSandbox", "samples\SingleProjectSandbox\SingleProjectSandbox.csproj", "{3B8519C1-2F51-4F12-A348-120AB91D4532}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser", "src\Browser\Avalonia.Browser\Avalonia.Browser.csproj", "{4A39637C-9338-4925-A4DB-D072E292EC78}" EndProject @@ -251,10 +247,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Settings.StyleCop = Settings.StyleCop EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.ItemsRepeater", "src\Avalonia.Controls.ItemsRepeater\Avalonia.Controls.ItemsRepeater.csproj", "{EE0F0DD4-A70D-472B-BD5D-B7D32D0E9386}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.ItemsRepeater.UnitTests", "tests\Avalonia.Controls.ItemsRepeater.UnitTests\Avalonia.Controls.ItemsRepeater.UnitTests.csproj", "{F4E36AA8-814E-4704-BC07-291F70F45193}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Generators", "src\tools\Avalonia.Generators\Avalonia.Generators.csproj", "{DDA28789-C21A-4654-86CE-D01E81F095C5}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Fonts.Inter", "src\Avalonia.Fonts.Inter\Avalonia.Fonts.Inter.csproj", "{13F1135D-BA1A-435C-9C5B-A368D1D63DE4}" @@ -283,8 +275,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Headless.NUnit.Uni EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Headless.XUnit.UnitTests", "tests\Avalonia.Headless.XUnit.UnitTests\Avalonia.Headless.XUnit.UnitTests.csproj", "{F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Browser", "samples\MobileSandbox.Browser\MobileSandbox.Browser.csproj", "{43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tizen", "Tizen", "{D1300000-7217-4693-8B0F-57CBD5814302}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Tizen", "src\Tizen\Avalonia.Tizen\Avalonia.Tizen.csproj", "{DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}" @@ -301,7 +291,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildTasks", "BuildTasks", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PInvoke", "tests\TestFiles\BuildTasks\PInvoke\PInvoke.csproj", "{0A948D71-99C5-43E9-BACB-B0BA59EA25B4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tmds.DBus.SourceGenerator", "external\Tmds.DBus.SourceGenerator\Tmds.DBus.SourceGenerator\Tmds.DBus.SourceGenerator.csproj", "{068247A8-21E8-40D2-83CF-8758410FACAD}" + +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnloadableAssemblyLoadContext", "UnloadableAssemblyLoadContext", "{9CCA131B-DE95-4D44-8788-C3CAE28574CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnloadableAssemblyLoadContext", "samples\UnloadableAssemblyLoadContext\UnloadableAssemblyLoadContext\UnloadableAssemblyLoadContext.csproj", "{D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnloadableAssemblyLoadContextPlug", "samples\UnloadableAssemblyLoadContext\UnloadableAssemblyLoadContextPlug\UnloadableAssemblyLoadContextPlug.csproj", "{DA5F1FF9-4259-4C54-B443-85CFA226EE6A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Vulkan", "src\Avalonia.Vulkan\Avalonia.Vulkan.csproj", "{3E2DE2B6-13BC-4C27-BCB9-A423B86CAF77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.RenderTests.WpfCompare", "tests\Avalonia.RenderTests.WpfCompare\Avalonia.RenderTests.WpfCompare.csproj", "{9AE1B827-21AC-4063-AB22-C8804B7F931E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -581,19 +580,6 @@ Global {3B8519C1-2F51-4F12-A348-120AB91D4532}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.Build.0 = Release|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Release|Any CPU.Build.0 = Release|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Release|Any CPU.Build.0 = Release|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Release|Any CPU.Build.0 = Release|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -622,14 +608,6 @@ Global {C692FE73-43DB-49CE-87FC-F03ED61F25C9}.Debug|Any CPU.Build.0 = Release|Any CPU {C692FE73-43DB-49CE-87FC-F03ED61F25C9}.Release|Any CPU.ActiveCfg = Release|Any CPU {C692FE73-43DB-49CE-87FC-F03ED61F25C9}.Release|Any CPU.Build.0 = Release|Any CPU - {EE0F0DD4-A70D-472B-BD5D-B7D32D0E9386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE0F0DD4-A70D-472B-BD5D-B7D32D0E9386}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE0F0DD4-A70D-472B-BD5D-B7D32D0E9386}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE0F0DD4-A70D-472B-BD5D-B7D32D0E9386}.Release|Any CPU.Build.0 = Release|Any CPU - {F4E36AA8-814E-4704-BC07-291F70F45193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F4E36AA8-814E-4704-BC07-291F70F45193}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F4E36AA8-814E-4704-BC07-291F70F45193}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F4E36AA8-814E-4704-BC07-291F70F45193}.Release|Any CPU.Build.0 = Release|Any CPU {DDA28789-C21A-4654-86CE-D01E81F095C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DDA28789-C21A-4654-86CE-D01E81F095C5}.Debug|Any CPU.Build.0 = Debug|Any CPU {DDA28789-C21A-4654-86CE-D01E81F095C5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -686,10 +664,6 @@ Global {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Release|Any CPU.Build.0 = Release|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Release|Any CPU.Build.0 = Release|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -704,6 +678,10 @@ Global {60B4ED1F-ECFA-453B-8A70-1788261C8355}.Debug|Any CPU.Build.0 = Debug|Any CPU {60B4ED1F-ECFA-453B-8A70-1788261C8355}.Release|Any CPU.ActiveCfg = Release|Any CPU {60B4ED1F-ECFA-453B-8A70-1788261C8355}.Release|Any CPU.Build.0 = Release|Any CPU + {3E2DE2B6-13BC-4C27-BCB9-A423B86CAF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E2DE2B6-13BC-4C27-BCB9-A423B86CAF77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E2DE2B6-13BC-4C27-BCB9-A423B86CAF77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E2DE2B6-13BC-4C27-BCB9-A423B86CAF77}.Release|Any CPU.Build.0 = Release|Any CPU {B0FD6A48-FBAB-4676-B36A-DE76B0922B12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B0FD6A48-FBAB-4676-B36A-DE76B0922B12}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0FD6A48-FBAB-4676-B36A-DE76B0922B12}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -712,10 +690,18 @@ Global {0A948D71-99C5-43E9-BACB-B0BA59EA25B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A948D71-99C5-43E9-BACB-B0BA59EA25B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A948D71-99C5-43E9-BACB-B0BA59EA25B4}.Release|Any CPU.Build.0 = Release|Any CPU - {068247A8-21E8-40D2-83CF-8758410FACAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {068247A8-21E8-40D2-83CF-8758410FACAD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {068247A8-21E8-40D2-83CF-8758410FACAD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {068247A8-21E8-40D2-83CF-8758410FACAD}.Release|Any CPU.Build.0 = Release|Any CPU + {D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0}.Release|Any CPU.Build.0 = Release|Any CPU + {DA5F1FF9-4259-4C54-B443-85CFA226EE6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA5F1FF9-4259-4C54-B443-85CFA226EE6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA5F1FF9-4259-4C54-B443-85CFA226EE6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA5F1FF9-4259-4C54-B443-85CFA226EE6A}.Release|Any CPU.Build.0 = Release|Any CPU + {9AE1B827-21AC-4063-AB22-C8804B7F931E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9AE1B827-21AC-4063-AB22-C8804B7F931E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AE1B827-21AC-4063-AB22-C8804B7F931E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9AE1B827-21AC-4063-AB22-C8804B7F931E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -774,9 +760,6 @@ Global {EABE2161-989B-42BF-BD8D-1E34B20C21F1} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {3B8519C1-2F51-4F12-A348-120AB91D4532} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {C90FE60B-B01E-4F35-91D6-379D6966030F} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {62D392C9-81CF-487F-92E8-598B2AF3FDCE} = {9B9E3891-2366-4253-A952-D08BCEB71098} {4A39637C-9338-4925-A4DB-D072E292EC78} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {47F8530C-F19B-4B1A-B4D6-EB231522AE5D} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {15B93A4C-1B46-43F6-B534-7B25B6E99932} = {9B9E3891-2366-4253-A952-D08BCEB71098} @@ -784,7 +767,6 @@ Global {75C47156-C5D8-44BC-A5A7-E8657C2248D6} = {9B9E3891-2366-4253-A952-D08BCEB71098} {C810060E-3809-4B74-A125-F11533AF9C1B} = {9B9E3891-2366-4253-A952-D08BCEB71098} {C692FE73-43DB-49CE-87FC-F03ED61F25C9} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} - {F4E36AA8-814E-4704-BC07-291F70F45193} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {DDA28789-C21A-4654-86CE-D01E81F095C5} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {A82AD1BC-EBE6-4FC3-A13B-D52A50297533} = {9B9E3891-2366-4253-A952-D08BCEB71098} {F8928267-688E-4A51-989C-612A72446D33} = {9B9E3891-2366-4253-A952-D08BCEB71098} @@ -797,14 +779,16 @@ Global {4B8EBBEB-A1AD-49EC-8B69-B93ED15BFA64} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {2999D79E-3C20-4A90-B651-CA7E0AC92D35} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8} = {9B9E3891-2366-4253-A952-D08BCEB71098} {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8} = {D1300000-7217-4693-8B0F-57CBD5814302} {A0B29221-2B6F-4B29-A4D5-2227811B5915} = {9B9E3891-2366-4253-A952-D08BCEB71098} {B0FD6A48-FBAB-4676-B36A-DE76B0922B12} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {9D6AEF22-221F-4F4B-B335-A4BA510F002C} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {5BF0C3B8-E595-4940-AB30-2DA206C2F085} = {9D6AEF22-221F-4F4B-B335-A4BA510F002C} {0A948D71-99C5-43E9-BACB-B0BA59EA25B4} = {5BF0C3B8-E595-4940-AB30-2DA206C2F085} - {068247A8-21E8-40D2-83CF-8758410FACAD} = {86C53C40-57AA-45B8-AD42-FAE0EFDF0F2B} + {9CCA131B-DE95-4D44-8788-C3CAE28574CD} = {9B9E3891-2366-4253-A952-D08BCEB71098} + {D7FE3E0F-3FE0-4F87-A2F5-24F1454D84C0} = {9CCA131B-DE95-4D44-8788-C3CAE28574CD} + {DA5F1FF9-4259-4C54-B443-85CFA226EE6A} = {9CCA131B-DE95-4D44-8788-C3CAE28574CD} + {9AE1B827-21AC-4063-AB22-C8804B7F931E} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A} diff --git a/Avalonia.sln.DotSettings b/Avalonia.sln.DotSettings index b0692905e7..cc58566622 100644 --- a/Avalonia.sln.DotSettings +++ b/Avalonia.sln.DotSettings @@ -37,5 +37,7 @@ <Policy Inspect="False" Prefix="T" Suffix="" Style="AaBb" /> <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> True + True True - True + True + True diff --git a/Avalonia.v3.ncrunchsolution b/Avalonia.v3.ncrunchsolution index b97a8e54f5..95f316f8cf 100644 --- a/Avalonia.v3.ncrunchsolution +++ b/Avalonia.v3.ncrunchsolution @@ -10,8 +10,11 @@ True RunApiCompat = false + TargetFrameworks = net8.0;netstandard2.0 + False .ncrunch + True True \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index ec7a7ed18b..117c0964d2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,13 @@ + + $(MSBuildThisFileDirectory)build-intermediate/nuget $(MSBuildThisFileDirectory)\src\tools\Avalonia.Designer.HostApp\bin\$(Configuration)\netstandard2.0\Avalonia.Designer.HostApp.dll false - false False - 11 + 12 diff --git a/Documentation/build.md b/Documentation/build.md index 3fcaae8963..ea91f035f8 100644 --- a/Documentation/build.md +++ b/Documentation/build.md @@ -1,10 +1,6 @@ -# Windows - -Avalonia requires at least Visual Studio 2022 and dotnet 7-rc2 SDK 7.0.100-rc.2 to build on all platforms. - ## Clone the Avalonia repository -``` +```bash git clone https://github.com/AvaloniaUI/Avalonia.git cd Avalonia git submodule update --init @@ -12,23 +8,31 @@ git submodule update --init ## Install the required version of the .NET Core SDK -Go to https://dotnet.microsoft.com/download/visual-studio-sdks and install the latest version of the .NET Core SDK compatible with Avalonia UI. Make sure to download the SDK (not just the "runtime") package. The version compatible is indicated within the [global.json](https://github.com/AvaloniaUI/Avalonia/blob/master/global.json) file. Note that Avalonia UI does not always use the latest version and is hardcoded to use the last version known to be compatible (SDK releases may break the builds from time-to-time). +Go to https://dotnet.microsoft.com/en-us/download/visual-studio-sdks and install the latest version of the .NET SDK compatible with Avalonia UI. Make sure to download the SDK (not just the "runtime") package. The version compatible is indicated within the [global.json](https://github.com/AvaloniaUI/Avalonia/blob/master/global.json) file. Note that Avalonia UI does not always use the latest version and is hardcoded to use the last version known to be compatible (SDK releases may break the builds from time-to-time). ### Installing necessary .NET Workloads .NET SDK requires developers to install workloads for each platform they are targeting. Since Avalonia targets pretty much every supported .NET platform, you need to install these workloads as well. Running it from the command line: -``` -dotnet workload install android ios wasm-tools wasm-experimental +```bash +dotnet workload install android ios wasm-tools ``` macOS workloads are not required to build Avalonia. Note: on Unix OS you need to run this command from sudo. +Tizen workload can be installed with PowerShell: +```powershell +(New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1') | Invoke-Expression +``` +Or Bash: +```bash +curl -sSL https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.sh | sudo bash +``` ## Build and Run Avalonia -``` +```bash cd samples\ControlCatalog.NetCore dotnet restore dotnet run @@ -47,14 +51,6 @@ Build and run `ControlCatalog.NetCore` project to see the sample application. ### Visual Studio Troubleshooting - * **Error CS0006: Avalonia.DesktopRuntime.dll could not be found** - - It is common for the first build to fail with the errors below (also discussed in [#4257](https://github.com/AvaloniaUI/Avalonia/issues/4257)). - ``` - >CSC : error CS0006: Metadata file 'C:\...\Avalonia\src\Avalonia.DesktopRuntime\bin\Debug\netcoreapp2.0\Avalonia.DesktopRuntime.dll' could not be found - >CSC : error CS0006: Metadata file 'C:\...\Avalonia\packages\Avalonia\bin\Debug\netcoreapp2.0\Avalonia.dll' could not be found - ``` - To correct this, right click on the `Avalonia.DesktopRuntime` project then press `Build` to build the project manually. Afterwards the solution should build normally and the ControlCatalog can be run. * **Error MSB4062 GenerateAvaloniaResourcesTask** Same as previous one, you need to manually build `Avalonia.Build.Tasks` project at least once. @@ -79,11 +75,7 @@ Or if you need to create nuget packages as well (it will compile and run tests a It's *not* possible to build the *whole* project on Linux/macOS. You can only build the subset targeting .NET Standard and .NET Core (which is, however, sufficient to get UI working on Linux/macOS). If you want to something that involves changing platform-specific APIs you'll need a Windows machine. -MonoDevelop, Xamarin Studio and Visual Studio for Mac aren't capable of properly opening our solution. You can use Rider (at least 2017.2 EAP) or VSCode instead. They will fail to load most of platform specific projects, but you don't need them to run on .NET Core. - -## Install the latest version of the .NET Core SDK - -Go to https://www.microsoft.com/net/core and follow the instructions for your OS. Make sure to download the SDK (not just the "runtime") package. +MonoDevelop, Xamarin Studio and Visual Studio for Mac aren't capable of properly opening our solution. You can use Rider (at least 2017.2 EAP) or VS Code instead. They will fail to load most of platform specific projects, but you don't need them to run on .NET Core. ## Additional requirements for macOS @@ -105,10 +97,23 @@ On macOS it is necessary to build and manually install the respective native lib ./build.sh CompileNative ``` -## Build and Run Avalonia +# Building Avalonia into a local NuGet cache +It is possible to build Avalonia locally and generate NuGet packages that can be used locally to test local changes. +To do so you need to run: +```bash +nuke --target BuildToNuGetCache --configuration Release ``` -cd samples/ControlCatalog.NetCore -dotnet restore -dotnet run -``` + +This command will generate nuget packages and push them into a local NuGet automatically. +To use these packages use `9999.0.0-localbuild` package version. +Each time local changes are made to Avalonia, running this command again will replace old packages and reset cache for the same version. + +## Browser + +To build and run browser/wasm projects, it's necessary to install NodeJS. +You can find latest LTS on https://nodejs.org/. + +## Windows + +It is possible to run some .NET Framework samples and tests using .NET Framework SDK. You need to install at least 4.7 SDK. diff --git a/Settings.StyleCop b/Settings.StyleCop deleted file mode 100644 index 5bd6cda777..0000000000 --- a/Settings.StyleCop +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/api/Avalonia.Android.nupkg.xml b/api/Avalonia.Android.nupkg.xml new file mode 100644 index 0000000000..5e68aafc3f --- /dev/null +++ b/api/Avalonia.Android.nupkg.xml @@ -0,0 +1,94 @@ + + + + + CP0001 + T:Avalonia.Android.Internal.Resource.Animation + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Animator + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Attribute + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Boolean + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Color + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Dimension + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Drawable + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Id + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Integer + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Interpolator + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Layout + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.String + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Style + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0001 + T:Avalonia.Android.Internal.Resource.Styleable + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + + CP0007 + T:Avalonia.Android.Internal.Resource + baseline/net6.0-android31.0/Avalonia.Android.dll + target/net8.0-android34.0/Avalonia.Android.dll + + \ No newline at end of file diff --git a/api/Avalonia.Browser.nupkg.xml b/api/Avalonia.Browser.nupkg.xml new file mode 100644 index 0000000000..16bdbfe25d --- /dev/null +++ b/api/Avalonia.Browser.nupkg.xml @@ -0,0 +1,22 @@ + + + + + CP0002 + M:Avalonia.Browser.AvaloniaView.get_IsComposing + baseline/net7.0/Avalonia.Browser.dll + target/net8.0-browser1.0/Avalonia.Browser.dll + + + CP0002 + M:Avalonia.Browser.AvaloniaView.OnDragEvent(System.Runtime.InteropServices.JavaScript.JSObject) + baseline/net7.0/Avalonia.Browser.dll + target/net8.0-browser1.0/Avalonia.Browser.dll + + + CP0008 + T:Avalonia.Browser.AvaloniaView + baseline/net7.0/Avalonia.Browser.dll + target/net8.0-browser1.0/Avalonia.Browser.dll + + \ No newline at end of file diff --git a/api/Avalonia.Controls.ColorPicker.nupkg.xml b/api/Avalonia.Controls.ColorPicker.nupkg.xml index 90271d6e98..8fadd656ea 100644 --- a/api/Avalonia.Controls.ColorPicker.nupkg.xml +++ b/api/Avalonia.Controls.ColorPicker.nupkg.xml @@ -31,6 +31,12 @@ baseline/netstandard2.0/Avalonia.Controls.ColorPicker.dll target/netstandard2.0/Avalonia.Controls.ColorPicker.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Themes/Fluent/Fluent.xaml + baseline/netstandard2.0/Avalonia.Controls.ColorPicker.dll + target/netstandard2.0/Avalonia.Controls.ColorPicker.dll + CP0001 T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Themes/Simple/ColorPicker.xaml @@ -61,4 +67,10 @@ baseline/netstandard2.0/Avalonia.Controls.ColorPicker.dll target/netstandard2.0/Avalonia.Controls.ColorPicker.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Themes/Simple/Simple.xaml + baseline/netstandard2.0/Avalonia.Controls.ColorPicker.dll + target/netstandard2.0/Avalonia.Controls.ColorPicker.dll + \ No newline at end of file diff --git a/api/Avalonia.Controls.DataGrid.nupkg.xml b/api/Avalonia.Controls.DataGrid.nupkg.xml new file mode 100644 index 0000000000..1dc020aa79 --- /dev/null +++ b/api/Avalonia.Controls.DataGrid.nupkg.xml @@ -0,0 +1,16 @@ + + + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Themes/Fluent.xaml + baseline/netstandard2.0/Avalonia.Controls.DataGrid.dll + target/netstandard2.0/Avalonia.Controls.DataGrid.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Themes/Simple.xaml + baseline/netstandard2.0/Avalonia.Controls.DataGrid.dll + target/netstandard2.0/Avalonia.Controls.DataGrid.dll + + \ No newline at end of file diff --git a/api/Avalonia.Diagnostics.nupkg.xml b/api/Avalonia.Diagnostics.nupkg.xml index d364618e59..5bc2bfa99c 100644 --- a/api/Avalonia.Diagnostics.nupkg.xml +++ b/api/Avalonia.Diagnostics.nupkg.xml @@ -1,10 +1,64 @@  + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Controls/BrushEditor.axaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Controls/FilterTextBox.axaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Controls/ThicknessEditor.axaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + CP0001 T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/ConsoleView.xaml baseline/netstandard2.0/Avalonia.Diagnostics.dll target/netstandard2.0/Avalonia.Diagnostics.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/ControlDetailsView.xaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/EventsPageView.xaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/LayoutExplorerView.axaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/MainView.xaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/MainWindow.xaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/TreePageView.xaml + baseline/netstandard2.0/Avalonia.Diagnostics.dll + target/netstandard2.0/Avalonia.Diagnostics.dll + \ No newline at end of file diff --git a/api/Avalonia.Skia.nupkg.xml b/api/Avalonia.Skia.nupkg.xml new file mode 100644 index 0000000000..a88fc8ba0a --- /dev/null +++ b/api/Avalonia.Skia.nupkg.xml @@ -0,0 +1,10 @@ + + + + + CP0006 + M:Avalonia.Skia.ISkiaSharpApiLease.TryLeasePlatformGraphicsApi + baseline/netstandard2.0/Avalonia.Skia.dll + target/netstandard2.0/Avalonia.Skia.dll + + \ No newline at end of file diff --git a/api/Avalonia.Themes.Fluent.nupkg.xml b/api/Avalonia.Themes.Fluent.nupkg.xml index a5be5ceeb9..08fb493760 100644 --- a/api/Avalonia.Themes.Fluent.nupkg.xml +++ b/api/Avalonia.Themes.Fluent.nupkg.xml @@ -1,6 +1,12 @@  + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Accents/BaseColorsPalette.xaml + baseline/netstandard2.0/Avalonia.Themes.Fluent.dll + target/netstandard2.0/Avalonia.Themes.Fluent.dll + CP0001 T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Accents/BaseResources.xaml @@ -145,6 +151,12 @@ baseline/netstandard2.0/Avalonia.Themes.Fluent.dll target/netstandard2.0/Avalonia.Themes.Fluent.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Controls/FluentControls.xaml + baseline/netstandard2.0/Avalonia.Themes.Fluent.dll + target/netstandard2.0/Avalonia.Themes.Fluent.dll + CP0001 T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Controls/FlyoutPresenter.xaml @@ -421,4 +433,16 @@ baseline/netstandard2.0/Avalonia.Themes.Fluent.dll target/netstandard2.0/Avalonia.Themes.Fluent.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/DensityStyles/Compact.xaml + baseline/netstandard2.0/Avalonia.Themes.Fluent.dll + target/netstandard2.0/Avalonia.Themes.Fluent.dll + + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/FluentTheme.xaml + baseline/netstandard2.0/Avalonia.Themes.Fluent.dll + target/netstandard2.0/Avalonia.Themes.Fluent.dll + \ No newline at end of file diff --git a/api/Avalonia.Themes.Simple.nupkg.xml b/api/Avalonia.Themes.Simple.nupkg.xml index e6a62495d9..8f4ac0585a 100644 --- a/api/Avalonia.Themes.Simple.nupkg.xml +++ b/api/Avalonia.Themes.Simple.nupkg.xml @@ -289,6 +289,12 @@ baseline/netstandard2.0/Avalonia.Themes.Simple.dll target/netstandard2.0/Avalonia.Themes.Simple.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Controls/SimpleControls.xaml + baseline/netstandard2.0/Avalonia.Themes.Simple.dll + target/netstandard2.0/Avalonia.Themes.Simple.dll + CP0001 T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Controls/Slider.xaml @@ -409,4 +415,10 @@ baseline/netstandard2.0/Avalonia.Themes.Simple.dll target/netstandard2.0/Avalonia.Themes.Simple.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/SimpleTheme.xaml + baseline/netstandard2.0/Avalonia.Themes.Simple.dll + target/netstandard2.0/Avalonia.Themes.Simple.dll + \ No newline at end of file diff --git a/api/Avalonia.nupkg.xml b/api/Avalonia.nupkg.xml index b56906842b..a47a716d3d 100644 --- a/api/Avalonia.nupkg.xml +++ b/api/Avalonia.nupkg.xml @@ -1015,6 +1015,18 @@ baseline/netstandard2.0/Avalonia.Base.dll target/netstandard2.0/Avalonia.Base.dll + + CP0001 + T:Avalonia.Diagnostics.AppliedStyle + baseline/netstandard2.0/Avalonia.Base.dll + target/netstandard2.0/Avalonia.Base.dll + + + CP0001 + T:Avalonia.Diagnostics.StyleDiagnostics + baseline/netstandard2.0/Avalonia.Base.dll + target/netstandard2.0/Avalonia.Base.dll + CP0001 T:Avalonia.Input.FocusManager.<GetFocusScopeAncestors>d__18 @@ -1069,9 +1081,27 @@ baseline/netstandard2.0/Avalonia.Controls.dll target/netstandard2.0/Avalonia.Controls.dll + + CP0001 + T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/AboutAvaloniaDialog.xaml + baseline/netstandard2.0/Avalonia.Dialogs.dll + target/netstandard2.0/Avalonia.Dialogs.dll + + + CP0002 + M:Avalonia.Diagnostics.StyledElementExtensions.GetStyleDiagnostics(Avalonia.StyledElement) + baseline/netstandard2.0/Avalonia.Base.dll + target/netstandard2.0/Avalonia.Base.dll + CP0006 - P:Avalonia.Rendering.Composition.ICompositionGpuImportedObject.ImportCompleted + M:Avalonia.Platform.IAssetLoader.InvalidateAssemblyCache + baseline/netstandard2.0/Avalonia.Base.dll + target/netstandard2.0/Avalonia.Base.dll + + + CP0006 + M:Avalonia.Platform.IAssetLoader.InvalidateAssemblyCache(System.String) baseline/netstandard2.0/Avalonia.Base.dll target/netstandard2.0/Avalonia.Base.dll @@ -1087,4 +1117,28 @@ baseline/netstandard2.0/Avalonia.Base.dll target/netstandard2.0/Avalonia.Base.dll + + CP0006 + P:Avalonia.Rendering.Composition.ICompositionGpuImportedObject.ImportCompleted + baseline/netstandard2.0/Avalonia.Base.dll + target/netstandard2.0/Avalonia.Base.dll + + + CP0006 + M:Avalonia.Controls.Notifications.IManagedNotificationManager.Close(System.Object) + baseline/netstandard2.0/Avalonia.Controls.dll + target/netstandard2.0/Avalonia.Controls.dll + + + CP0006 + M:Avalonia.Controls.Notifications.INotificationManager.Close(Avalonia.Controls.Notifications.INotification) + baseline/netstandard2.0/Avalonia.Controls.dll + target/netstandard2.0/Avalonia.Controls.dll + + + CP0006 + M:Avalonia.Controls.Notifications.INotificationManager.CloseAll + baseline/netstandard2.0/Avalonia.Controls.dll + target/netstandard2.0/Avalonia.Controls.dll + \ No newline at end of file diff --git a/azure-pipelines-integrationtests.yml b/azure-pipelines-integrationtests.yml index 3613518dc1..ce9b38c44d 100644 --- a/azure-pipelines-integrationtests.yml +++ b/azure-pipelines-integrationtests.yml @@ -11,7 +11,7 @@ jobs: version: 6.0.x - task: UseDotNet@2 - displayName: 'Use .NET 7.0 SDK' + displayName: 'Use .NET 8.0 SDK' inputs: packageType: sdk useGlobalJson: true @@ -33,7 +33,7 @@ jobs: rm -rf $(osascript -e "POSIX path of (path to application id \"net.avaloniaui.avalonia.integrationtestapp\")") pkill IntegrationTestApp ./samples/IntegrationTestApp/bundle.sh - open -n ./samples/IntegrationTestApp/bin/Debug/net7.0/osx-$arch/publish/IntegrationTestApp.app + open -n ./samples/IntegrationTestApp/bin/Debug/net8.0/osx-$arch/publish/IntegrationTestApp.app pkill IntegrationTestApp displayName: 'Build IntegrationTestApp' @@ -65,7 +65,7 @@ jobs: version: 6.0.x - task: UseDotNet@2 - displayName: 'Use .NET 7.0 SDK' + displayName: 'Use .NET 8.0 SDK' inputs: packageType: sdk useGlobalJson: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3f918d8bc2..f6e116a8fa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,23 +2,19 @@ jobs: - job: GetPRNumber pool: - vmImage: 'windows-2022' + vmImage: 'ubuntu-20.04' variables: SolutionDir: '$(Build.SourcesDirectory)' steps: - - task: PowerShell@2 - displayName: Get PR Number + - task: UseDotNet@2 + displayName: 'Use .NET 8.0 SDK' inputs: - targetType: 'inline' - script: | - $prId = $env:System_PullRequest_PullRequestNumber - Write-Host "PR Number is:-" $env:System_PullRequest_PullRequestNumber - - if (!([string]::IsNullOrWhiteSpace($prId))) - { - Set-Content -Path $env:Build_ArtifactStagingDirectory\prId.txt -Value $prId - } - + packageType: sdk + useGlobalJson: true + - task: CmdLine@2 + displayName: 'Run Build' + inputs: + script: ./build.sh --target OutputVersion --version-output-dir $(Build.ArtifactStagingDirectory) - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' @@ -36,7 +32,7 @@ jobs: version: 6.0.x - task: UseDotNet@2 - displayName: 'Use .NET 7.0 SDK' + displayName: 'Use .NET 8.0 SDK' inputs: packageType: sdk useGlobalJson: true @@ -45,7 +41,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install wasm-tools wasm-experimental + dotnet workload install android macos wasm-tools - task: CmdLine@2 displayName: 'Install Tizen Workload' @@ -82,7 +78,7 @@ jobs: version: 6.0.x - task: UseDotNet@2 - displayName: 'Use .NET 7.0 SDK' + displayName: 'Use .NET 8.0 SDK' inputs: packageType: sdk useGlobalJson: true @@ -91,7 +87,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install wasm-tools wasm-experimental + dotnet workload install android ios macos wasm-tools - task: CmdLine@2 displayName: 'Install Tizen Workload' @@ -162,7 +158,7 @@ jobs: version: 6.0.x - task: UseDotNet@2 - displayName: 'Use .NET 7.0 SDK' + displayName: 'Use .NET 8.0 SDK' inputs: packageType: sdk useGlobalJson: true @@ -171,7 +167,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install android ios tvos wasm-tools wasm-experimental + dotnet workload install android ios tvos wasm-tools - task: PowerShell@2 displayName: 'Install Tizen Workload' diff --git a/build/Binding.props b/build/Binding.props index 7202294929..9e19e86d89 100644 --- a/build/Binding.props +++ b/build/Binding.props @@ -1,5 +1,5 @@ - + diff --git a/build/BuildTargets.targets b/build/BuildTargets.targets index 13b002d523..546f122c15 100644 --- a/build/BuildTargets.targets +++ b/build/BuildTargets.targets @@ -1,11 +1,17 @@ $(MSBuildThisFileDirectory)\..\src\Avalonia.Build.Tasks\bin\$(Configuration)\netstandard2.0\Avalonia.Build.Tasks.dll - true true true true + + + + + + diff --git a/build/CoreLibraries.props b/build/CoreLibraries.props index a9af587a45..43ab0fbab2 100644 --- a/build/CoreLibraries.props +++ b/build/CoreLibraries.props @@ -5,6 +5,7 @@ + diff --git a/build/DevSingleProject.targets b/build/DevSingleProject.targets new file mode 100644 index 0000000000..f6b9b54d02 --- /dev/null +++ b/build/DevSingleProject.targets @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/build/HarfBuzzSharp.props b/build/HarfBuzzSharp.props index 6673b2b187..cce53c1ed9 100644 --- a/build/HarfBuzzSharp.props +++ b/build/HarfBuzzSharp.props @@ -1,7 +1,7 @@  - - - + + + diff --git a/build/ImageSharp.props b/build/ImageSharp.props index 66e6580070..c1eee25ce5 100644 --- a/build/ImageSharp.props +++ b/build/ImageSharp.props @@ -1,5 +1,5 @@ - + diff --git a/build/SharedVersion.props b/build/SharedVersion.props index 0f3d685bba..bca2ef9eec 100644 --- a/build/SharedVersion.props +++ b/build/SharedVersion.props @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> Avalonia - 11.1.999 + 11.2.999 Avalonia Team Copyright 2013-$([System.DateTime]::Now.ToString(`yyyy`)) © The AvaloniaUI Project https://avaloniaui.net diff --git a/build/SkiaSharp.props b/build/SkiaSharp.props index adca6c4462..a5789e1116 100644 --- a/build/SkiaSharp.props +++ b/build/SkiaSharp.props @@ -1,7 +1,12 @@  - - - - + + + + + + + + + diff --git a/build/TargetFrameworks.props b/build/TargetFrameworks.props new file mode 100644 index 0000000000..8c88b4cf4b --- /dev/null +++ b/build/TargetFrameworks.props @@ -0,0 +1,29 @@ + + + net8.0 + $(AvsCurrentTargetFramework)-windows + $(AvsCurrentTargetFramework)-macos + $(AvsCurrentTargetFramework)-android34.0 + $(AvsCurrentTargetFramework)-ios17.0 + $(AvsCurrentTargetFramework)-tvos17.0 + $(AvsCurrentTargetFramework)-browser + $(AvsCurrentTargetFramework)-tizen + + + net6.0 + net6.0-windows + + + + + + 13.0 + 13.0 + 13.1 + 6.5 + 21.0 + + + 10.15 + + diff --git a/build/WarnAsErrors.props b/build/WarnAsErrors.props new file mode 100644 index 0000000000..dd105f206e --- /dev/null +++ b/build/WarnAsErrors.props @@ -0,0 +1,21 @@ + + + + + $(WarningsNotAsErrors);CS0649 + + $(WarningsNotAsErrors);CS0162 + + $(WarningsNotAsErrors);CA2211 + + $(WarningsNotAsErrors);CA1821 + + $(WarningsNotAsErrors);CA1823 + + $(WarningsNotAsErrors);AVLN2203 + + $(WarningsNotAsErrors);AVLN2205 + + $(WarningsNotAsErrors);AVLN2207 + + diff --git a/dirs.proj b/dirs.proj index 120212bd9f..5403847fab 100644 --- a/dirs.proj +++ b/dirs.proj @@ -3,28 +3,30 @@ - - + + - + + - - - - - + + + + + + diff --git a/external/Tmds.DBus.SourceGenerator b/external/Tmds.DBus.SourceGenerator deleted file mode 160000 index 999a4551f7..0000000000 --- a/external/Tmds.DBus.SourceGenerator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 999a4551f743f6f2eeea92f77aa65e3b2e64bb3c diff --git a/global.json b/global.json index 13a6c6d6ad..8e84e96f22 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { - "sdk": { - "version": "7.0.404", - "rollForward": "latestFeature" - }, - "msbuild-sdks": { - "Microsoft.Build.Traversal": "3.2.0" - } + "sdk": { + "version": "8.0.101", + "rollForward": "latestFeature" + }, + "msbuild-sdks": { + "Microsoft.Build.Traversal": "4.1.0" + } } diff --git a/licence.md b/licence.md index d18aef99ad..41951805ac 100644 --- a/licence.md +++ b/licence.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) .NET Foundation and Contributors +Copyright (c) AvaloniaUI OÜ All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/xcshareddata/xcschemes/Avalonia.Native.OSX.xcscheme b/native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/xcshareddata/xcschemes/Avalonia.Native.OSX.xcscheme index 87a8312c38..c1e5b91e3e 100644 --- a/native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/xcshareddata/xcschemes/Avalonia.Native.OSX.xcscheme +++ b/native/Avalonia.Native/src/OSX/Avalonia.Native.OSX.xcodeproj/xcshareddata/xcschemes/Avalonia.Native.OSX.xcscheme @@ -56,7 +56,7 @@ diff --git a/native/Avalonia.Native/src/OSX/PlatformRenderTimer.mm b/native/Avalonia.Native/src/OSX/PlatformRenderTimer.mm index f372cc9047..7f3bea0c18 100644 --- a/native/Avalonia.Native/src/OSX/PlatformRenderTimer.mm +++ b/native/Avalonia.Native/src/OSX/PlatformRenderTimer.mm @@ -8,7 +8,7 @@ private: public: FORWARD_IUNKNOWN() - virtual HRESULT RegisterTick ( + virtual int RegisterTick ( IAvnActionCallback* callback) override { START_COM_CALL; @@ -24,13 +24,13 @@ public: auto result = CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); if (result != 0) { - return E_FAIL; + return result; } result = CVDisplayLinkSetOutputCallback(_displayLink, OnTick, this); if (result != 0) { - return E_FAIL; + return result; } } return S_OK; diff --git a/native/Avalonia.Native/src/OSX/WindowImpl.h b/native/Avalonia.Native/src/OSX/WindowImpl.h index 049ef755ff..047a0d2c84 100644 --- a/native/Avalonia.Native/src/OSX/WindowImpl.h +++ b/native/Avalonia.Native/src/OSX/WindowImpl.h @@ -82,6 +82,8 @@ BEGIN_INTERFACE_MAP() virtual HRESULT GetExtendTitleBarHeight (double*ret) override; virtual HRESULT SetExtendTitleBarHeight (double value) override; + + virtual HRESULT GetWindowZOrder (long* zOrder) override; void EnterFullScreenMode (); diff --git a/native/Avalonia.Native/src/OSX/WindowImpl.mm b/native/Avalonia.Native/src/OSX/WindowImpl.mm index be761e0af7..1cdf81e2fb 100644 --- a/native/Avalonia.Native/src/OSX/WindowImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowImpl.mm @@ -366,6 +366,20 @@ HRESULT WindowImpl::GetWindowState(AvnWindowState *ret) { } } +HRESULT WindowImpl::GetWindowZOrder(long* zOrder) { + START_COM_CALL; + @autoreleasepool { + if (zOrder == nullptr) { + return E_POINTER; + } + + // negate the value to match expected z-order in Avalonia + // (top-most window should have the highest z-order value) + *zOrder = -[Window orderedIndex]; + return S_OK; + } +} + HRESULT WindowImpl::TakeFocusFromChildren() { START_COM_CALL; diff --git a/native/Avalonia.Native/src/OSX/menu.h b/native/Avalonia.Native/src/OSX/menu.h index 1bea2ccc8d..eb706d3e07 100644 --- a/native/Avalonia.Native/src/OSX/menu.h +++ b/native/Avalonia.Native/src/OSX/menu.h @@ -51,7 +51,9 @@ public: virtual HRESULT SetAction (IAvnPredicateCallback* predicate, IAvnActionCallback* callback) override; virtual HRESULT SetIsChecked (bool isChecked) override; - + + virtual HRESULT SetIsVisible (bool isVisible) override; + virtual HRESULT SetToggleType (AvnMenuItemToggleType toggleType) override; virtual HRESULT SetIcon (void* data, size_t length) override; diff --git a/native/Avalonia.Native/src/OSX/menu.mm b/native/Avalonia.Native/src/OSX/menu.mm index 3905987aab..7a7edcb1cb 100644 --- a/native/Avalonia.Native/src/OSX/menu.mm +++ b/native/Avalonia.Native/src/OSX/menu.mm @@ -205,6 +205,17 @@ HRESULT AvnAppMenuItem::SetIsChecked (bool isChecked) } } +HRESULT AvnAppMenuItem::SetIsVisible (bool isVisible) +{ + START_COM_CALL; + + @autoreleasepool + { + [_native setHidden:!isVisible]; + return S_OK; + } +} + HRESULT AvnAppMenuItem::SetToggleType(AvnMenuItemToggleType toggleType) { START_COM_CALL; diff --git a/native/Avalonia.Native/src/OSX/metal.mm b/native/Avalonia.Native/src/OSX/metal.mm index 8a66592ec4..5622f2040e 100644 --- a/native/Avalonia.Native/src/OSX/metal.mm +++ b/native/Avalonia.Native/src/OSX/metal.mm @@ -112,6 +112,7 @@ public: - (MetalRenderTarget *)initWithDevice:(IAvnMetalDevice *)device { _device = dynamic_cast(device); _layer = [CAMetalLayer new]; + _layer.opaque = false; _layer.device = _device->device; _target.setNoAddRef(new AvnMetalRenderTarget(_layer, _device)); return self; @@ -158,4 +159,4 @@ static AvnMetalDisplay* _display = new AvnMetalDisplay(); extern IAvnMetalDisplay* GetMetalDisplay() { return _display; -} \ No newline at end of file +} diff --git a/native/Avalonia.Native/src/OSX/platformthreading.mm b/native/Avalonia.Native/src/OSX/platformthreading.mm index 56b7ce97e0..4d5b28920b 100644 --- a/native/Avalonia.Native/src/OSX/platformthreading.mm +++ b/native/Avalonia.Native/src/OSX/platformthreading.mm @@ -52,6 +52,39 @@ public: // interval—on the order of decades or more" static double distantFutureInterval = (double)50*365*24*3600; + + +@implementation ObserverStateHolder : NSObject +{ + @public bool InsideCallback; +} +@end + +@implementation ObserverHolder : NSObject +{ + @public CFRunLoopObserverRef Observer; + @public ObserverStateHolder* State; +} + +- (ObserverHolder*) init +{ + self = [super init]; + self->State = [ObserverStateHolder new]; + return self; +} + +- (void) dealloc +{ + if(Observer != nil) + { + CFRunLoopObserverInvalidate(Observer); + CFRelease(Observer); + Observer = nil; + } +} + +@end + @interface Signaler : NSObject -(void) setEvents:(IAvnPlatformThreadingInterfaceEvents*) events; -(void) updateTimer:(int)ms; @@ -66,7 +99,7 @@ static double distantFutureInterval = (double)50*365*24*3600; bool _wakeupDelegateSent; bool _signaled; bool _backgroundProcessingRequested; - CFRunLoopObserverRef _observer; + @public ObserverHolder* Observer; CFRunLoopTimerRef _timer; } @@ -83,15 +116,19 @@ static double distantFutureInterval = (double)50*365*24*3600; } } -- (Signaler*) init +- (ObserverHolder*) createObserver { - _observer = CFRunLoopObserverCreateWithHandler(nil, + ObserverHolder* holder = [ObserverHolder new]; + ObserverStateHolder* state = holder->State; + + holder->Observer = CFRunLoopObserverCreateWithHandler(nil, kCFRunLoopBeforeSources | kCFRunLoopAfterWaiting | kCFRunLoopBeforeWaiting , true, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) { + state->InsideCallback = true; if(activity == kCFRunLoopBeforeWaiting) { bool triggerProcessing; @@ -103,10 +140,15 @@ static double distantFutureInterval = (double)50*365*24*3600; self->_events->ReadyForBackgroundProcessing(); } [self checkSignaled]; + state->InsideCallback = false; }); - CFRunLoopAddObserver(CFRunLoopGetMain(), _observer, kCFRunLoopCommonModes); - - + CFRunLoopAddObserver(CFRunLoopGetMain(), holder->Observer, kCFRunLoopCommonModes); + return holder; +} + +- (Signaler*) init +{ + Observer = [self createObserver]; _timer = CFRunLoopTimerCreateWithHandler(nil, CFAbsoluteTimeGetCurrent() + distantFutureInterval, distantFutureInterval, 0, 0, ^(CFRunLoopTimerRef timer) { self->_events->Timer(); }); @@ -118,12 +160,7 @@ static double distantFutureInterval = (double)50*365*24*3600; - (void) destroyObserver { - if(_observer != nil) - { - CFRunLoopObserverInvalidate(_observer); - CFRelease(_observer); - _observer = nil; - } + Observer = nil; if(_timer != nil) { @@ -182,12 +219,13 @@ class PlatformThreadingInterface : public ComSingleObject _events; Signaler* _signaler; - CFRunLoopObserverRef _observer = nil; + ObserverHolder* _currentObserver; public: FORWARD_IUNKNOWN() PlatformThreadingInterface() { _signaler = [Signaler new]; + _currentObserver = _signaler->Observer; }; ~PlatformThreadingInterface() @@ -228,18 +266,25 @@ public: } else { - while(!can->Cancelled) - { - @autoreleasepool + @autoreleasepool { + auto previousObserver = _currentObserver; + if(_currentObserver->State->InsideCallback) + _currentObserver = [_signaler createObserver]; + + while(!can->Cancelled) { - NSEvent* ev = [NSApp - nextEventMatchingMask:NSEventMaskAny - untilDate: [NSDate dateWithTimeIntervalSinceNow:1] - inMode:NSDefaultRunLoopMode - dequeue:true]; - if(ev != NULL) - [NSApp sendEvent:ev]; + @autoreleasepool + { + NSEvent* ev = [NSApp + nextEventMatchingMask:NSEventMaskAny + untilDate: [NSDate dateWithTimeIntervalSinceNow:1] + inMode:NSDefaultRunLoopMode + dequeue:true]; + if(ev != NULL) + [NSApp sendEvent:ev]; + } } + _currentObserver = previousObserver; } } }; diff --git a/native/Avalonia.Native/src/OSX/trayicon.h b/native/Avalonia.Native/src/OSX/trayicon.h index da30477005..86b61608c4 100644 --- a/native/Avalonia.Native/src/OSX/trayicon.h +++ b/native/Avalonia.Native/src/OSX/trayicon.h @@ -15,7 +15,8 @@ class AvnTrayIcon : public ComSingleObject { private: NSStatusItem* _native; - + bool _isTemplateIcon; + public: FORWARD_IUNKNOWN() @@ -28,8 +29,10 @@ public: virtual HRESULT SetMenu (IAvnMenu* menu) override; virtual HRESULT SetIsVisible (bool isVisible) override; - + virtual HRESULT SetToolTipText (char* text) override; + + virtual HRESULT SetIsTemplateIcon (bool isTemplateIcon) override; }; #endif /* trayicon_h */ diff --git a/native/Avalonia.Native/src/OSX/trayicon.mm b/native/Avalonia.Native/src/OSX/trayicon.mm index 5b75b9cc19..917ff87694 100644 --- a/native/Avalonia.Native/src/OSX/trayicon.mm +++ b/native/Avalonia.Native/src/OSX/trayicon.mm @@ -45,6 +45,7 @@ HRESULT AvnTrayIcon::SetIcon (void* data, size_t length) size.width = originalSize.width * scaleFactor; [image setSize: size]; + [image setTemplate: _isTemplateIcon]; [_native setImage:image]; } else @@ -98,3 +99,24 @@ HRESULT AvnTrayIcon::SetToolTipText(char* text) return S_OK; } + +HRESULT AvnTrayIcon::SetIsTemplateIcon(bool isTemplateIcon) +{ + START_COM_CALL; + + @autoreleasepool + { + if (_isTemplateIcon != isTemplateIcon) + { + _isTemplateIcon = isTemplateIcon; + + NSImage *image = [_native image]; + if (image) + { + [image setTemplate: _isTemplateIcon]; + } + } + } + + return S_OK; +} \ No newline at end of file diff --git a/nukebuild/ApiDiffHelper.cs b/nukebuild/ApiDiffHelper.cs index 2eabc3ef16..ac6be61ee3 100644 --- a/nukebuild/ApiDiffHelper.cs +++ b/nukebuild/ApiDiffHelper.cs @@ -52,7 +52,7 @@ public static class ApiDiffHelper e.target.StartsWith(targetTfm) && e.entry.Name == baselineDll.entry.Name); if (targetDll is null) { - if (s_tfmRedirects.FirstOrDefault(t => baselineDll.target.StartsWith(t.oldTfm)).newTfm is {} newTfm) + if (s_tfmRedirects.FirstOrDefault(t => baselineDll.target.StartsWith(t.oldTfm) && (t.package is null || packageId == t.package)).newTfm is {} newTfm) { targetTfm = newTfm; targetDll = targetDlls.FirstOrDefault(e => @@ -107,13 +107,17 @@ public static class ApiDiffHelper } } - private static readonly (string oldTfm, string newTfm)[] s_tfmRedirects = new[] + private static readonly (string package, string oldTfm, string newTfm)[] s_tfmRedirects = new[] { - // We use StartsWith below comparing these tfm, as we ignore platform versions (like, net6.0-ios16.1) - ("net6.0-android", "net7.0-android"), - ("net6.0-ios", "net7.0-ios"), - // Designer was moved from netcoreapp to netstandard - ("netcoreapp2.0", "netstandard2.0") + // We use StartsWith below comparing these tfm, as we ignore platform versions (like, net6.0-ios16.1). + ("Avalonia.Android", "net6.0-android", "net8.0-android"), + ("Avalonia.iOS", "net6.0-ios", "net8.0-ios"), + // Browser was changed from net7.0 to net8.0-browser. + ("Avalonia.Browser", "net7.0", "net8.0-browser"), + ("Avalonia.Browser.Blazor", "net7.0", "net8.0-browser"), + // Designer was moved from netcoreapp to netstandard. + ("Avalonia", "netcoreapp2.0", "netstandard2.0"), + ("Avalonia", "net461", "netstandard2.0") }; public static async Task ValidatePackage( @@ -154,7 +158,7 @@ public static class ApiDiffHelper e.target.StartsWith(targetTfm) && e.entry.Name == baselineDll.entry.Name); if (targetDll?.entry is null) { - if (s_tfmRedirects.FirstOrDefault(t => baselineDll.target.StartsWith(t.oldTfm)).newTfm is {} newTfm) + if (s_tfmRedirects.FirstOrDefault(t => baselineDll.target.StartsWith(t.oldTfm) && (t.package is null || packageId == t.package)).newTfm is {} newTfm) { targetTfm = newTfm; targetDll = targetDlls.FirstOrDefault(e => @@ -171,8 +175,15 @@ public static class ApiDiffHelper if (targetDll?.entry is null) { + if (packageId == "Avalonia" + && baselineDll.target is "net461" or "netcoreapp2.0") + { + // In 11.1 we have removed net461 and netcoreapp2.0 targets from Avalonia package. + continue; + } + var actualTargets = string.Join(", ", - targetDlls.Select(d => $"{d.target} ({baselineDll.entry.Name})")); + targetDlls.Select(d => $"{d.target} ({d.entry.Name})")); throw new InvalidOperationException( $"Some assemblies are missing in the new package {packageId}: {baselineDll.entry.Name} for {baselineDll.target}." + $"\r\nActual targets: {actualTargets}."); diff --git a/nukebuild/Build.cs b/nukebuild/Build.cs index 871af047cd..9157e4c44b 100644 --- a/nukebuild/Build.cs +++ b/nukebuild/Build.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.IO.Compression; using System.Linq; using System.Runtime.InteropServices; using System.Threading.Tasks; @@ -38,9 +39,12 @@ partial class Build : NukeBuild [PackageExecutable("Microsoft.DotNet.GenAPI.Tool", "Microsoft.DotNet.GenAPI.Tool.dll", Framework = "net8.0")] Tool ApiGenTool; + + protected override void OnBuildInitialized() { - Parameters = new BuildParameters(this); + Parameters = new BuildParameters(this, ScheduledTargets.Contains(BuildToNuGetCache)); + Information("Building version {0} of Avalonia ({1}) using version {2} of Nuke.", Parameters.Version, Parameters.Configuration, @@ -82,6 +86,12 @@ partial class Build : NukeBuild c.AddProperty("PackageVersion", Parameters.Version) .SetConfiguration(Parameters.Configuration) .SetVerbosity(DotNetVerbosity.Minimal); + if (Parameters.IsPackingToLocalCache) + c + .AddProperty("ForcePackAvaloniaNative", "True") + .AddProperty("SkipObscurePlatforms", "True") + .AddProperty("SkipBuildingSamples", "True") + .AddProperty("SkipBuildingTests", "True"); return c; } DotNetBuildSettings ApplySetting(DotNetBuildSettings c, Configure configurator = null) => @@ -140,6 +150,21 @@ partial class Build : NukeBuild ); }); + Target OutputVersion => _ => _ + .Requires(() => VersionOutputDir) + .Executes(() => + { + var versionFile = Path.Combine(Parameters.VersionOutputDir, "version.txt"); + var currentBuildVersion = Parameters.Version; + Console.WriteLine("Version is: " + currentBuildVersion); + File.WriteAllText(versionFile, currentBuildVersion); + + var prIdFile = Path.Combine(Parameters.VersionOutputDir, "prId.txt"); + var prId = Environment.GetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"); + Console.WriteLine("PR Number is: " + prId); + File.WriteAllText(prIdFile, prId); + }); + void RunCoreTest(string projectName) { Information($"Running tests from {projectName}"); @@ -166,19 +191,29 @@ partial class Build : NukeBuild foreach (var fw in targetFrameworks) { - if (fw.StartsWith("net4") + var tfm = fw; + if (tfm == "$(AvsCurrentTargetFramework)") + { + tfm = "net8.0"; + } + if (tfm == "$(AvsLegacyTargetFrameworks)") + { + tfm = "net6.0"; + } + + if (tfm.StartsWith("net4") && (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) && Environment.GetEnvironmentVariable("FORCE_LINUX_TESTS") != "1") { - Information($"Skipping {projectName} ({fw}) tests on *nix - https://github.com/mono/mono/issues/13969"); + Information($"Skipping {projectName} ({tfm}) tests on *nix - https://github.com/mono/mono/issues/13969"); continue; } - Information($"Running for {projectName} ({fw}) ..."); + Information($"Running for {projectName} ({tfm}) ..."); DotNetTest(c => ApplySetting(c) .SetProjectFile(project) - .SetFramework(fw) + .SetFramework(tfm) .EnableNoBuild() .EnableNoRestore() .When(Parameters.PublishTestResults, _ => _ @@ -325,6 +360,39 @@ partial class Build : NukeBuild .DependsOn(Package) .DependsOn(ZipFiles); + Target BuildToNuGetCache => _ => _ + .DependsOn(CreateNugetPackages) + .Executes(() => + { + if (!Parameters.IsPackingToLocalCache) + throw new InvalidOperationException(); + + foreach (var path in Parameters.NugetRoot.GlobFiles("*.nupkg")) + { + using var f = File.Open(path.ToString(), FileMode.Open, FileAccess.Read); + using var zip = new ZipArchive(f, ZipArchiveMode.Read); + var nuspecEntry = zip.Entries.First(e => e.FullName.EndsWith(".nuspec") && e.FullName == e.Name); + var packageId = XDocument.Load(nuspecEntry.Open()).Document.Root + .Elements().First(x => x.Name.LocalName == "metadata") + .Elements().First(x => x.Name.LocalName == "id").Value; + + var packagePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".nuget", + "packages", + packageId.ToLowerInvariant(), + BuildParameters.LocalBuildVersion); + if (Directory.Exists(packagePath)) + Directory.Delete(packagePath, true); + Directory.CreateDirectory(packagePath); + zip.ExtractToDirectory(packagePath); + File.WriteAllText(Path.Combine(packagePath, ".nupkg.metadata"), @"{ + ""version"": 2, + ""contentHash"": ""e900dFK7jHJ2WcprLcgJYQoOMc6ejRTwAAMi0VGOFbSczcF98ZDaqwoQIiyqpAwnja59FSbV+GUUXfc3vaQ2Jg=="", + ""source"": ""https://api.nuget.org/v3/index.json"" +}"); + } + }); + Target GenerateCppHeaders => _ => _.Executes(() => { var file = MicroComCodeGenerator.Parse( diff --git a/nukebuild/BuildParameters.cs b/nukebuild/BuildParameters.cs index 74870885bc..d664d74d2a 100644 --- a/nukebuild/BuildParameters.cs +++ b/nukebuild/BuildParameters.cs @@ -25,10 +25,13 @@ public partial class Build [Parameter(Name = "api-baseline")] public string ApiValidationBaseline { get; set; } - + [Parameter(Name = "update-api-suppression")] public bool? UpdateApiValidationSuppression { get; set; } + [Parameter(Name = "version-output-dir")] + public AbsolutePath VersionOutputDir { get; set; } + public class BuildParameters { public string Configuration { get; } @@ -53,7 +56,10 @@ public partial class Build public bool IsMyGetRelease { get; } public bool IsNuGetRelease { get; } public bool PublishTestResults { get; } - public string Version { get; } + public string Version { get; set; } + public const string LocalBuildVersion = "9999.0.0-localbuild"; + public bool IsPackingToLocalCache { get; private set; } + public AbsolutePath ArtifactsDir { get; } public AbsolutePath NugetIntermediateRoot { get; } public AbsolutePath NugetRoot { get; } @@ -67,8 +73,9 @@ public partial class Build public string ApiValidationBaseline { get; } public bool UpdateApiValidationSuppression { get; } public AbsolutePath ApiValidationSuppressionFiles { get; } + public AbsolutePath VersionOutputDir { get; } - public BuildParameters(Build b) + public BuildParameters(Build b, bool isPackingToLocalCache) { // ARGUMENTS Configuration = b.Configuration ?? "Release"; @@ -119,11 +126,17 @@ public partial class Build if (!IsNuGetRelease) { // Use AssemblyVersion with Build as version - Version += "-cibuild" + int.Parse(Environment.GetEnvironmentVariable("BUILD_BUILDID")).ToString("0000000") + "-beta"; + Version += "-cibuild" + int.Parse(Environment.GetEnvironmentVariable("BUILD_BUILDID")).ToString("0000000") + "-alpha"; } PublishTestResults = true; } + + if (isPackingToLocalCache) + { + IsPackingToLocalCache = true; + Version = LocalBuildVersion; + } // DIRECTORIES ArtifactsDir = RootDirectory / "artifacts"; @@ -137,6 +150,7 @@ public partial class Build ZipCoreArtifacts = ZipRoot / ("Avalonia-" + FileZipSuffix); ZipNuGetArtifacts = ZipRoot / ("Avalonia-NuGet-" + FileZipSuffix); ApiValidationSuppressionFiles = RootDirectory / "api"; + VersionOutputDir = b.VersionOutputDir; } string GetVersion() diff --git a/nukebuild/_build.csproj b/nukebuild/_build.csproj index dd1103db7c..7c89b896c7 100644 --- a/nukebuild/_build.csproj +++ b/nukebuild/_build.csproj @@ -6,7 +6,9 @@ False $(NoWarn);CS0649;CS0169;SYSLIB0011 1 - net7.0 + $(AvsCurrentTargetFramework) + + true https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json diff --git a/nukebuild/build-to-cache.sh b/nukebuild/build-to-cache.sh new file mode 100755 index 0000000000..80d51291d0 --- /dev/null +++ b/nukebuild/build-to-cache.sh @@ -0,0 +1,2 @@ +#!/bin/sh +dotnet run --project _build.csproj -- --target BuildToNuGetCache --skip CompileHtmlPreviewer Compile Clean diff --git a/packages/Avalonia/Avalonia.csproj b/packages/Avalonia/Avalonia.csproj index 6a3b06ee6c..d25647b01c 100644 --- a/packages/Avalonia/Avalonia.csproj +++ b/packages/Avalonia/Avalonia.csproj @@ -1,6 +1,6 @@  - net6.0;netstandard2.0;net461 + $(AvsCurrentTargetFramework);$(AvsLegacyTargetFrameworks);netstandard2.0 Avalonia diff --git a/packages/Avalonia/Avalonia.props b/packages/Avalonia/Avalonia.props index db43467f93..57b7f9dc32 100644 --- a/packages/Avalonia/Avalonia.props +++ b/packages/Avalonia/Avalonia.props @@ -3,7 +3,6 @@ $(MSBuildThisFileDirectory)\..\tools\netstandard2.0\designer\Avalonia.Designer.HostApp.dll $(MSBuildThisFileDirectory)\..\tools\net461\designer\Avalonia.Designer.HostApp.exe $(MSBuildThisFileDirectory)\..\tools\netstandard2.0\Avalonia.Build.Tasks.dll - false $(UsedAvaloniaProducts);AvaloniaUI true false diff --git a/packages/Avalonia/Avalonia.targets b/packages/Avalonia/Avalonia.targets index eacd287b59..a0c1c080d8 100644 --- a/packages/Avalonia/Avalonia.targets +++ b/packages/Avalonia/Avalonia.targets @@ -1,4 +1,5 @@ + diff --git a/packages/Avalonia/AvaloniaBuildTasks.targets b/packages/Avalonia/AvaloniaBuildTasks.targets index ef5658f1ca..99b3df9b1a 100644 --- a/packages/Avalonia/AvaloniaBuildTasks.targets +++ b/packages/Avalonia/AvaloniaBuildTasks.targets @@ -1,13 +1,10 @@ - <_AvaloniaUseExternalMSBuild>$(AvaloniaUseExternalMSBuild) - <_AvaloniaUseExternalMSBuild Condition="'$(_AvaloniaForceInternalMSBuild)' == 'true'">false low <_AvaloniaSkipXamlCompilation Condition="'$(_AvaloniaSkipXamlCompilation)' == ''">false false + true - - @@ -33,7 +30,15 @@ - + + + + + + @@ -57,8 +62,8 @@ - $(BuildAvaloniaResourcesDependsOn);AddAvaloniaResources;ResolveReferences;_GenerateAvaloniaResourcesDependencyCache;_GenerateNoWarnForExec - $(CompileAvaloniaXamlDependsOn);_GenerateNoWarnForExec + $(BuildAvaloniaResourcesDependsOn);AddAvaloniaResources;ResolveReferences;_GenerateAvaloniaResourcesDependencyCache + $(CompileAvaloniaXamlDependsOn);FindReferenceAssembliesForReferences;PrepareToCompileAvaloniaXaml @@ -81,14 +86,6 @@ - - - - - <_NoWarnForExec>'"$(NoWarn)"' - <_NoWarnForExec Condition="$([MSBuild]::IsOSPlatform('Windows'))">\"$(NoWarn)\" - - - + - - + - $(IntermediateOutputPath)/Avalonia/references - $(IntermediateOutputPath)/Avalonia/original.dll false false false <_AvaloniaHasCompiledXaml>true - - - + + + + <_DebugSymbolsIntermediatePath Update="*" AvaloniaCompileOutput="%(RelativeDir)Avalonia\%(Filename)%(Extension)"/> + + + + + + + + + + - - - + AnalyzerConfigFiles="@(EditorConfigFiles)"/> + + + + + <_AvaloniaXamlCompiledAssembly Include="@(IntermediateAssembly->Metadata('AvaloniaCompileOutput'))"/> + + + + <_AvaloniaXamlCompiledRefAssembly Include="@(IntermediateRefAssembly->Metadata('AvaloniaCompileOutput'))"/> + + + + <_AvaloniaXamlCompiledSymbols Include="@(_DebugSymbolsIntermediatePath->Metadata('AvaloniaCompileOutput'))"/> + <_DebugSymbolsIntermediatePath Remove="@(_DebugSymbolsIntermediatePath)"/> + <_DebugSymbolsIntermediatePath Include="@(_AvaloniaXamlCompiledSymbols)"/> + + + + + + + + + + + + + + + + + @@ -217,4 +242,21 @@ + + + + $(IntermediateOutputPath)/Avalonia/references + + + diff --git a/packages/Avalonia/AvaloniaSingleProject.targets b/packages/Avalonia/AvaloniaSingleProject.targets new file mode 100644 index 0000000000..793f0e36eb --- /dev/null +++ b/packages/Avalonia/AvaloniaSingleProject.targets @@ -0,0 +1,292 @@ + + + + + false + + true + + + + + <_AvaloniaWindowsTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true + <_AvaloniaMacOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">true + <_AvaloniaAndroidTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">true + <_AvaloniaIOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true + <_AvaloniaTvOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">true + <_AvaloniaBrowserTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browser'">true + <_AvaloniaTizenTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">true + + <_AvaloniaLinuxTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'linux'" >true + + + + + <_AvaloniaDesktopTarget>true + + + + WinExe + true + true + + + + browser-wasm + + + + Platforms\ + $([MSBuild]::EnsureTrailingSlash('$(PlatformsProjectFolder)')) + + <_KeepLaunchProfiles>true + + false + $(PlatformsProjectFolder)Android\ + $([MSBuild]::EnsureTrailingSlash('$(AndroidProjectFolder)')) + + false + false + $(PlatformsProjectFolder)iOS\ + $(PlatformsProjectFolder)tvOS\ + $([MSBuild]::EnsureTrailingSlash('$(iOSProjectFolder)')) + + false + $(PlatformsProjectFolder)MacCatalyst\ + $([MSBuild]::EnsureTrailingSlash('$(MacCatalystProjectFolder)')) + + false + $(PlatformsProjectFolder)macOS\ + $([MSBuild]::EnsureTrailingSlash('$(macOSProjectFolder)')) + + false + $(PlatformsProjectFolder)Windows\ + $([MSBuild]::EnsureTrailingSlash('$(WindowsProjectFolder)')) + + $(PlatformsProjectFolder)Linux\ + $([MSBuild]::EnsureTrailingSlash('$(LinuxProjectFolder)')) + + $(PlatformsProjectFolder)Browser\ + $([MSBuild]::EnsureTrailingSlash('$(BrowserProjectFolder)')) + + false + $(PlatformsProjectFolder)Tizen\ + $([MSBuild]::EnsureTrailingSlash('$(TizenProjectFolder)')) + + $(PlatformsProjectFolder)Desktop\ + $([MSBuild]::EnsureTrailingSlash('$(DesktopProjectFolder)')) + + + + + + + + + + + + + + + + + + 13.0 + 13.0 + 10.15 + 13.1 + 21.0 + 6.5 + + + + $(AndroidProjectFolder)AndroidManifest.xml + $(AndroidProjectFolder)Resources + $(AndroidProjectFolder)Assets + + + + $(iOSProjectFolder)Resources + $(iOSProjectFolder)Entitlements.plist + <_SingleProjectiOSExcludes>$(iOSProjectFolder)/**/.*/** + + + + $(DesktopProjectFolder)app.manifest + $(DesktopProjectFolder)Package.appxmanifest + $(DesktopProjectFolder)Entitlements.plist + + + + $(macOSProjectFolder)Entitlements.plist + + + + $(WindowsProjectFolder)app.manifest + $(WindowsProjectFolder)Package.appxmanifest + + + + $(TizenProjectFolder)tizen-manifest.xml + $(TizenProjectFolder)res + $(TizenProjectFolder)shared + + + + $(BrowserProjectFolder)/wwwroot/main.js + $(BrowserProjectFolder)wwwroot/index.html + + + + + + true + + + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_AndroidManifestAbsTemp Condition=" '$(AndroidManifest)' != '' ">$(ProjectDir)$(AndroidManifest) + + + + + + diff --git a/readme.md b/readme.md index 7a412f282c..30c5be7675 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ ![Header](https://user-images.githubusercontent.com/552074/235865745-2a8e7274-4f66-4f77-8f05-feeb76e7d478.png) [![Telegram](https://raw.githubusercontent.com/Patrolavia/telegram-badge/master/chat.svg)](https://t.me/Avalonia) -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AvaloniaUI/Avalonia?utm_campaign=pr-badge&utm_content=badge&utm_medium=badge&utm_source=badge) [![Discord](https://img.shields.io/badge/discord-join%20chat-46BC99)]( https://aka.ms/dotnet-discord) [![Build Status](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_apis/build/status/AvaloniaUI.Avalonia)](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_build/latest?definitionId=4) [![Backers on Open Collective](https://img.shields.io/opencollective/backers/Avalonia?logo=opencollective)](#backers) [![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/Avalonia?logo=opencollective)](#sponsors) [![GitHub Sponsors](https://img.shields.io/github/sponsors/AvaloniaUI?logo=github)](https://github.com/sponsors/AvaloniaUI) ![License](https://img.shields.io/github/license/avaloniaui/avalonia.svg) + [![Build Status](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_apis/build/status/AvaloniaUI.Avalonia)](https://dev.azure.com/AvaloniaUI/AvaloniaUI/_build/latest?definitionId=4) [![Backers on Open Collective](https://img.shields.io/opencollective/backers/Avalonia?logo=opencollective)](#backers) [![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/Avalonia?logo=opencollective)](#sponsors) [![GitHub Sponsors](https://img.shields.io/github/sponsors/AvaloniaUI?logo=github)](https://github.com/sponsors/AvaloniaUI) ![License](https://img.shields.io/github/license/avaloniaui/avalonia.svg)
[![NuGet](https://img.shields.io/nuget/v/Avalonia.svg)](https://www.nuget.org/packages/Avalonia) [![downloads](https://img.shields.io/nuget/dt/avalonia)](https://www.nuget.org/packages/Avalonia) ![Size](https://img.shields.io/github/repo-size/avaloniaui/avalonia.svg) @@ -80,7 +80,7 @@ Please read the [contribution guidelines](CONTRIBUTING.md) before submitting a p ## Code of Conduct This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. -For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). +For more information see the [Code of Conduct](CODE_OF_CONDUCT.md). ## Licence @@ -113,9 +113,6 @@ Support this project by becoming a sponsor. Your logo will show up here with a l We have a range of [support plans available](https://avaloniaui.net/support) for those looking to partner with the creators of Avalonia, enabling access to the best support at every step of the development process. *Please note that donations are not considered payment for commercial support agreements. Please contact us to discuss your needs first. [team@avaloniaui.net](mailto://team@avaloniaui.net)* -## .NET Foundation - -This project is supported by the [.NET Foundation](https://dotnetfoundation.org). ## Avalonia XPF Unleash the full potential of your existing WPF apps with our cross-platform UI framework, enabling WPF apps to run on macOS and Linux without requiring expensive and risky rewrites. diff --git a/samples/AppWithoutLifetime/AppWithoutLifetime.csproj b/samples/AppWithoutLifetime/AppWithoutLifetime.csproj index fce12af298..2e959798d0 100644 --- a/samples/AppWithoutLifetime/AppWithoutLifetime.csproj +++ b/samples/AppWithoutLifetime/AppWithoutLifetime.csproj @@ -1,7 +1,7 @@  WinExe - net6.0 + $(AvsCurrentTargetFramework) enable app.manifest diff --git a/samples/BindingDemo/BindingDemo.csproj b/samples/BindingDemo/BindingDemo.csproj index f094c0081c..faeb643d8a 100644 --- a/samples/BindingDemo/BindingDemo.csproj +++ b/samples/BindingDemo/BindingDemo.csproj @@ -1,7 +1,7 @@  Exe - net6.0 + $(AvsCurrentTargetFramework) diff --git a/samples/BindingDemo/GenericMarkupExtension.cs b/samples/BindingDemo/GenericMarkupExtension.cs new file mode 100644 index 0000000000..aed0700cb8 --- /dev/null +++ b/samples/BindingDemo/GenericMarkupExtension.cs @@ -0,0 +1,14 @@ +using System; +using Avalonia.Markup.Xaml; + +namespace BindingDemo; + +internal class GenericMarkupExtension : MarkupExtension +{ + public T Value { get; set; } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return $"{Value?.GetType().Name}: {Value}"; + } +} diff --git a/samples/BindingDemo/GenericValueConverter.cs b/samples/BindingDemo/GenericValueConverter.cs new file mode 100644 index 0000000000..ff0e9c153e --- /dev/null +++ b/samples/BindingDemo/GenericValueConverter.cs @@ -0,0 +1,30 @@ +using System; +using System.Globalization; +using Avalonia.Data.Converters; + +#nullable enable + +namespace BindingDemo; + +public class GenericValueConverter : IValueConverter +{ + public GenericValueConverter() + { + + } + + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + if (value is T) + { + return $"{typeof(T).Name}: {value}"; + } + + return null; + } + + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotSupportedException(); + } +} diff --git a/samples/BindingDemo/MainWindow.xaml b/samples/BindingDemo/MainWindow.xaml index a00bed37f9..f14ad59cd5 100644 --- a/samples/BindingDemo/MainWindow.xaml +++ b/samples/BindingDemo/MainWindow.xaml @@ -120,5 +120,20 @@ + Precise dirty rects diff --git a/samples/ControlCatalog/Pages/CompositionPage.axaml.cs b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs index 5bf46510dc..da12accd58 100644 --- a/samples/ControlCatalog/Pages/CompositionPage.axaml.cs +++ b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs @@ -24,7 +24,7 @@ public partial class CompositionPage : UserControl public CompositionPage() { - AvaloniaXamlLoader.Load(this); + InitializeComponent(); AttachAnimatedSolidVisual(this.FindControl("SolidVisualHost")!); AttachCustomVisual(this.FindControl("CustomVisualHost")!); } @@ -206,6 +206,7 @@ public partial class CompositionPage : UserControl _customVisual = compositor.CreateCustomVisual(new CustomVisualHandler()); ElementComposition.SetElementChildVisual(v, _customVisual); _customVisual.SendHandlerMessage(CustomVisualHandler.StartMessage); + PreciseDirtyRectsCheckboxCustomVisualChanged(this, new()); Update(); }; @@ -221,10 +222,16 @@ public partial class CompositionPage : UserControl private TimeSpan _animationElapsed; private TimeSpan? _lastServerTime; private bool _running; + private bool _preciseDirtyRects; - public static readonly object StopMessage = new(), StartMessage = new(); - - public override void OnRender(ImmediateDrawingContext drawingContext) + public static readonly object StopMessage = new(), + StartMessage = new(), + UsePreciseDirtyRects = new(), + UseNonPreciseDirtyRects = new(); + + private List<(Point center, double size, ImmutableSolidColorBrush brush)> _ellipses = new(); + + void UpdateRects() { if (_running) { @@ -232,6 +239,8 @@ public partial class CompositionPage : UserControl _lastServerTime = CompositionNow; } + _ellipses.Clear(); + const int cnt = 20; var maxPointSizeX = EffectiveSize.X / (cnt * 1.6); var maxPointSizeY = EffectiveSize.Y / 4; @@ -250,16 +259,22 @@ public partial class CompositionPage : UserControl var posY = (EffectiveSize.Y - pointSize) * (1 + Math.Sin(stage * 3.14 * 3 + sinOffset)) / 2 + pointSize / 2; var opacity = Math.Sin(stage * 3.14); - - drawingContext.DrawEllipse(new ImmutableSolidColorBrush(Color.FromArgb( - 255, - (byte)(255 - 255 * colorStage), - (byte)(255 * Math.Abs(0.5 - colorStage) * 2), - (byte)(255 * colorStage) - ), opacity), null, - new Point(posX, posY), pointSize / 2, pointSize / 2); + _ellipses.Add((new Point(posX, posY), pointSize / 2, new ImmutableSolidColorBrush(Color.FromArgb( + 255, + (byte)(255 - 255 * colorStage), + (byte)(255 * Math.Abs(0.5 - colorStage) * 2), + (byte)(255 * colorStage) + ), opacity))); } + } + + public override void OnRender(ImmediateDrawingContext drawingContext) + { + if (_ellipses.Count == 0) + UpdateRects(); + foreach(var e in _ellipses) + drawingContext.DrawEllipse(e.brush, null, e.center, e.size, e.size); } public override void OnMessage(object message) @@ -272,13 +287,29 @@ public partial class CompositionPage : UserControl } else if (message == StopMessage) _running = false; + else if (message == UsePreciseDirtyRects) + _preciseDirtyRects = true; + else if (message == UseNonPreciseDirtyRects) + _preciseDirtyRects = false; } + void InvalidateCurrentEllipseRects() + { + foreach (var e in _ellipses) + Invalidate(new Rect(e.center.X - e.size, e.center.Y - e.size, e.size * 2, e.size * 2)); + } + public override void OnAnimationFrameUpdate() { if (_running) { - Invalidate(); + if (_preciseDirtyRects) + InvalidateCurrentEllipseRects(); + else + Invalidate(); + UpdateRects(); + if(_preciseDirtyRects) + InvalidateCurrentEllipseRects(); RegisterForNextAnimationFrameUpdate(); } } @@ -298,6 +329,13 @@ public partial class CompositionPage : UserControl { _customVisual?.SendHandlerMessage(CustomVisualHandler.StopMessage); } + + private void PreciseDirtyRectsCheckboxCustomVisualChanged(object sender, RoutedEventArgs e) + { + _customVisual?.SendHandlerMessage(PreciseDirtyRectsCheckboxCustomVisual?.IsChecked == true + ? CustomVisualHandler.UsePreciseDirtyRects + : CustomVisualHandler.UseNonPreciseDirtyRects); + } } public class CompositionPageColorItem diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs index a5423fab52..7cfb036577 100644 --- a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Security; using System.Threading.Tasks; using Avalonia; using Avalonia.Controls; @@ -43,7 +44,7 @@ namespace ControlCatalog.Pages { lastSelectedDirectory = await GetStorageProvider().TryGetWellKnownFolderAsync(folderEnum); } - else + else if (!string.IsNullOrWhiteSpace(currentFolderBox.Text)) { if (!Uri.TryCreate(currentFolderBox.Text, UriKind.Absolute, out var folderLink)) { @@ -52,7 +53,14 @@ namespace ControlCatalog.Pages if (folderLink is not null) { - lastSelectedDirectory = await GetStorageProvider().TryGetFolderFromPathAsync(folderLink); + try + { + lastSelectedDirectory = await GetStorageProvider().TryGetFolderFromPathAsync(folderLink); + } + catch (SecurityException) + { + + } } } }; @@ -239,7 +247,6 @@ namespace ControlCatalog.Pages FileTypeChoices = fileTypes, SuggestedStartLocation = lastSelectedDirectory, SuggestedFileName = "FileName", - DefaultExtension = fileTypes?.Any() == true ? "txt" : null, ShowOverwritePrompt = true }); @@ -468,8 +475,8 @@ CanPickFolder: {storageProvider.CanPickFolder}"; private IStorageProvider GetStorageProvider() { var forceManaged = this.Get("ForceManaged").IsChecked ?? false; - return forceManaged - ? new ManagedStorageProvider(GetWindow()) + return forceManaged + ? new ManagedStorageProvider(GetWindow()) // NOTE: In your production App use 'AppBuilder.UseManagedSystemDialogs()' : GetTopLevel().StorageProvider; } diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml deleted file mode 100644 index 88be9f8e6e..0000000000 --- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - A data-driven collection control that incorporates a flexible layout system, custom views, and virtualization. - - - - Stack - Vertical - Stack - Horizontal - UniformGrid - Vertical - UniformGrid - Horizontal - - - - - - - - - - - - - - - - diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs deleted file mode 100644 index 2219966daa..0000000000 --- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using System.Linq; -using Avalonia.Controls; -using Avalonia.Controls.Primitives; -using Avalonia.Input; -using Avalonia.Layout; -using Avalonia.Markup.Xaml; -using Avalonia.VisualTree; -using ControlCatalog.ViewModels; - -namespace ControlCatalog.Pages -{ - public class ItemsRepeaterPage : UserControl - { - private readonly ItemsRepeaterPageViewModel _viewModel; - private ItemsRepeater _repeater; - private ScrollViewer _scroller; - private int _selectedIndex; - private Button _scrollToLast; - private Button _scrollToRandom; - private Button _scrollToSelected; - private Random _random = new Random(0); - - public ItemsRepeaterPage() - { - this.InitializeComponent(); - _repeater = this.Get("repeater"); - _scroller = this.Get("scroller"); - _scrollToLast = this.Get + + + Nested ToolTips + diff --git a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml index 541385dd9f..03ef86fb61 100644 --- a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml +++ b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml @@ -23,10 +23,12 @@ - - diff --git a/samples/ControlCatalog/Pages/ViewboxPage.xaml b/samples/ControlCatalog/Pages/ViewboxPage.xaml index a31a52d238..e66655253c 100644 --- a/samples/ControlCatalog/Pages/ViewboxPage.xaml +++ b/samples/ControlCatalog/Pages/ViewboxPage.xaml @@ -27,20 +27,24 @@ - - Uniform - UniformToFill - Fill - None - + + + Uniform + UniformToFill + Fill + None + + - - Both - DownOnly - UpOnly - + + + Both + DownOnly + UpOnly + + diff --git a/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs b/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs index f44d927801..dfcdd4361d 100644 --- a/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs +++ b/samples/ControlCatalog/ViewModels/CursorPageViewModel.cs @@ -18,8 +18,7 @@ namespace ControlCatalog.ViewModels .Select(x => new StandardCursorModel(x)) .ToList(); - var loader = AvaloniaLocator.Current.GetRequiredService(); - var s = loader.Open(new Uri("avares://ControlCatalog/Assets/avalonia-32.png")); + var s = AssetLoader.Open(new Uri("avares://ControlCatalog/Assets/avalonia-32.png")); var bitmap = new Bitmap(s); CustomCursor = new Cursor(bitmap, new PixelPoint(16, 16)); } diff --git a/samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs b/samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs deleted file mode 100644 index 8f8a959867..0000000000 --- a/samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using Avalonia.Media; -using MiniMvvm; - -namespace ControlCatalog.ViewModels -{ - public class ItemsRepeaterPageViewModel : ViewModelBase - { - private int _newItemIndex = 1; - private int _newGenerationIndex = 0; - private ObservableCollection _items; - - public ItemsRepeaterPageViewModel() - { - _items = CreateItems(); - } - - public ObservableCollection Items - { - get => _items; - set => this.RaiseAndSetIfChanged(ref _items, value); - } - - public ItemsRepeaterPageViewModelItem? SelectedItem { get; set; } - - public void AddItem() - { - var index = SelectedItem != null ? Items.IndexOf(SelectedItem) : -1; - Items.Insert(index + 1, new ItemsRepeaterPageViewModelItem(index + 1, $"New Item {_newItemIndex++}")); - } - - public void RemoveItem() - { - if (SelectedItem is not null) - { - Items.Remove(SelectedItem); - SelectedItem = null; - } - else if (Items.Count > 0) - { - Items.RemoveAt(Items.Count - 1); - } - } - - public void RandomizeHeights() - { - var random = new Random(); - - foreach (var i in Items) - { - i.Height = random.Next(240) + 10; - } - } - - public void ResetItems() - { - Items = CreateItems(); - } - - private ObservableCollection CreateItems() - { - var suffix = _newGenerationIndex == 0 ? string.Empty : $"[{_newGenerationIndex.ToString()}]"; - - _newGenerationIndex++; - - return new ObservableCollection( - Enumerable.Range(1, 100000).Select(i => new ItemsRepeaterPageViewModelItem(i, $"Item {i.ToString()} {suffix}"))); - } - } - - public class ItemsRepeaterPageViewModelItem : ViewModelBase - { - private double _height = double.NaN; - - public ItemsRepeaterPageViewModelItem(int index, string text) - { - Index = index; - Text = text; - } - public int Index { get; } - public string Text { get; } - - public double Height - { - get => _height; - set => this.RaiseAndSetIfChanged(ref _height, value); - } - } -} diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index 9b9e336806..1050beedf2 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -3,7 +3,6 @@ using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.Notifications; using Avalonia.Dialogs; using Avalonia.Platform; -using Avalonia.Reactive; using System; using System.ComponentModel.DataAnnotations; using Avalonia; @@ -50,28 +49,28 @@ namespace ControlCatalog.ViewModels WindowState.FullScreen, }; - this.WhenAnyValue(x => x.SystemTitleBarEnabled, x=>x.PreferSystemChromeEnabled) - .Subscribe(x => + this.PropertyChanged += (s, e) => { - var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; - - if(x.Item1) - { - hints |= ExtendClientAreaChromeHints.SystemChrome; - } - - if(x.Item2) + if (e.PropertyName is nameof(SystemTitleBarEnabled) or nameof(PreferSystemChromeEnabled)) { - hints |= ExtendClientAreaChromeHints.PreferSystemChrome; + var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar; + + if (SystemTitleBarEnabled) + { + hints |= ExtendClientAreaChromeHints.SystemChrome; + } + if (PreferSystemChromeEnabled) + { + hints |= ExtendClientAreaChromeHints.PreferSystemChrome; + } + ChromeHints = hints; } - - ChromeHints = hints; - }); + }; SystemTitleBarEnabled = true; TitleBarHeight = -1; } - + public ExtendClientAreaChromeHints ChromeHints { get { return _chromeHints; } diff --git a/samples/ControlCatalog/ViewModels/PlatformInformationViewModel.cs b/samples/ControlCatalog/ViewModels/PlatformInformationViewModel.cs index 42eac2f96a..21c87bab0f 100644 --- a/samples/ControlCatalog/ViewModels/PlatformInformationViewModel.cs +++ b/samples/ControlCatalog/ViewModels/PlatformInformationViewModel.cs @@ -9,6 +9,14 @@ public class PlatformInformationViewModel : ViewModelBase { public PlatformInformationViewModel() { + /* NOTE: + * ------------ + * The below API is not meant to be used in production Apps. + * If you need to consume this info, please use: + * - OperatingSystem ( https://learn.microsoft.com/en-us/dotnet/api/system.operatingsystem | if .NET 5 or greater) + * - or RuntimeInformation ( https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation ) + */ + var runtimeInfo = AvaloniaLocator.Current.GetService()?.GetRuntimeInfo(); if (runtimeInfo is { } info) diff --git a/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs b/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs index 00d1da46e9..5bad6c4b0f 100644 --- a/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs +++ b/samples/ControlCatalog/ViewModels/TransitioningContentControlPageViewModel.cs @@ -19,8 +19,6 @@ namespace ControlCatalog.ViewModels { public TransitioningContentControlPageViewModel() { - var assetLoader = AvaloniaLocator.Current.GetRequiredService(); - var images = new string[] { "delicate-arch-896885_640.jpg", @@ -31,7 +29,7 @@ namespace ControlCatalog.ViewModels foreach (var image in images) { var path = $"avares://ControlCatalog/Assets/{image}"; - Images.Add(new Bitmap(assetLoader.Open(new Uri(path)))); + Images.Add(new Bitmap(AssetLoader.Open(new Uri(path)))); } SetupTransitions(); @@ -250,7 +248,7 @@ namespace ControlCatalog.ViewModels }, Duration = Duration }; - tasks.Add(animation.RunAsync(from, null, cancellationToken)); + tasks.Add(animation.RunAsync(from, cancellationToken)); } if (to != null) @@ -280,7 +278,7 @@ namespace ControlCatalog.ViewModels }, Duration = Duration }; - tasks.Add(animation.RunAsync(to, null, cancellationToken)); + tasks.Add(animation.RunAsync(to, cancellationToken)); } await Task.WhenAll(tasks); diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props index 680d6d2b89..3a61d3fff9 100644 --- a/samples/Directory.Build.props +++ b/samples/Directory.Build.props @@ -4,11 +4,12 @@ false $(MSBuildThisFileDirectory)..\src\tools\Avalonia.Designer.HostApp\bin\Debug\netstandard2.0\Avalonia.Designer.HostApp.dll false - 11 + 12 $(NoWarn);CS8002 + diff --git a/samples/Generators.Sandbox/Generators.Sandbox.csproj b/samples/Generators.Sandbox/Generators.Sandbox.csproj index 37b496b924..6cbf210d3f 100644 --- a/samples/Generators.Sandbox/Generators.Sandbox.csproj +++ b/samples/Generators.Sandbox/Generators.Sandbox.csproj @@ -1,7 +1,7 @@  Exe - net6.0 + $(AvsCurrentTargetFramework) true diff --git a/samples/GpuInterop/GpuInterop.csproj b/samples/GpuInterop/GpuInterop.csproj index 161821d92a..5fbef07abc 100644 --- a/samples/GpuInterop/GpuInterop.csproj +++ b/samples/GpuInterop/GpuInterop.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + $(AvsCurrentTargetFramework) true enable false diff --git a/samples/GpuInterop/Program.cs b/samples/GpuInterop/Program.cs index 8d7ccf4866..e07780f80b 100644 --- a/samples/GpuInterop/Program.cs +++ b/samples/GpuInterop/Program.cs @@ -1,5 +1,8 @@ global using System.Reactive.Disposables; using Avalonia; +using Avalonia.Logging; +using Avalonia.Vulkan; + namespace GpuInterop { public class Program @@ -10,6 +13,21 @@ namespace GpuInterop public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() .UsePlatformDetect() - .LogToTrace(); + .With(new Win32PlatformOptions + { + RenderingMode = new [] + { + Win32RenderingMode.Vulkan + } + }) + .With(new X11PlatformOptions(){RenderingMode =new[] { X11RenderingMode.Vulkan } }) + .With(new VulkanOptions() + { + VulkanInstanceCreationOptions = new VulkanInstanceCreationOptions() + { + UseDebug = true + } + }) + .LogToTrace(LogEventLevel.Debug, "Vulkan"); } } diff --git a/samples/GpuInterop/VulkanDemo/VulkanContent.cs b/samples/GpuInterop/VulkanDemo/VulkanContent.cs index fe95db00f4..576c34e837 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanContent.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanContent.cs @@ -397,7 +397,7 @@ unsafe class VulkanContent : IDisposable Matrix4x4.CreatePerspectiveFieldOfView((float)(Math.PI / 4), (float)size.Width / size.Height, 0.01f, 1000); - _colorAttachment = new VulkanImage(_context, (uint)Format.R8G8B8A8Unorm, size, false); + _colorAttachment = new VulkanImage(_context, (uint)Format.R8G8B8A8Unorm, size, false, Array.Empty()); CreateDepthAttachment(size); var api = _context.Api; diff --git a/samples/GpuInterop/VulkanDemo/VulkanContext.cs b/samples/GpuInterop/VulkanDemo/VulkanContext.cs index 0983a373f3..6983a69d86 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanContext.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanContext.cs @@ -101,8 +101,10 @@ public unsafe class VulkanContext : IDisposable if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - if (!gpuInterop.SupportedImageHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes + if (!(gpuInterop.SupportedImageHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes .D3D11TextureGlobalSharedHandle) + || gpuInterop.SupportedImageHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes + .VulkanOpaqueNtHandle)) ) return (null, "Image sharing is not supported by the current backend"); requireDeviceExtensions.Add(KhrExternalMemoryWin32.ExtensionName); @@ -240,10 +242,13 @@ public unsafe class VulkanContext : IDisposable } }); + D3DDevice? d3dDevice = null; if (physicalDeviceIDProperties.DeviceLuidvalid && - RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && + !gpuInterop.SupportedImageHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes.VulkanOpaqueNtHandle) + ) d3dDevice = D3DMemoryHelper.CreateDeviceByLuid( new Span(physicalDeviceIDProperties.DeviceLuid, 8)); diff --git a/samples/GpuInterop/VulkanDemo/VulkanImage.cs b/samples/GpuInterop/VulkanDemo/VulkanImage.cs index a385468b26..ea43441243 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanImage.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanImage.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Runtime.InteropServices; using Avalonia; using Avalonia.Platform; @@ -44,7 +46,7 @@ public unsafe class VulkanImage : IDisposable public uint CurrentLayout => (uint) _currentLayout; public VulkanImage(VulkanContext vk, uint format, PixelSize size, - bool exportable, uint mipLevels = 0) + bool exportable, IReadOnlyList supportedHandleTypes) { _vk = vk; _instance = vk.Instance; @@ -62,8 +64,12 @@ public unsafe class VulkanImage : IDisposable //MipLevels = MipLevels != 0 ? MipLevels : (uint)Math.Floor(Math.Log(Math.Max(Size.Width, Size.Height), 2)); var handleType = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? - ExternalMemoryHandleTypeFlags.D3D11TextureBit : + (supportedHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes.D3D11TextureNtHandle) + && !supportedHandleTypes.Contains(KnownPlatformGraphicsExternalImageHandleTypes.VulkanOpaqueNtHandle) ? + ExternalMemoryHandleTypeFlags.D3D11TextureBit : + ExternalMemoryHandleTypeFlags.OpaqueWin32Bit) : ExternalMemoryHandleTypeFlags.OpaqueFDBit; + var externalMemoryCreateInfo = new ExternalMemoryImageCreateInfo { SType = StructureType.ExternalMemoryImageCreateInfo, @@ -96,35 +102,37 @@ public unsafe class VulkanImage : IDisposable Api.GetImageMemoryRequirements(_device, InternalHandle, out var memoryRequirements); - - var fdExport = new ExportMemoryAllocateInfo - { - HandleTypes = handleType, SType = StructureType.ExportMemoryAllocateInfo - }; var dedicatedAllocation = new MemoryDedicatedAllocateInfoKHR { SType = StructureType.MemoryDedicatedAllocateInfoKhr, Image = image }; + + var fdExport = new ExportMemoryAllocateInfo + { + HandleTypes = handleType, SType = StructureType.ExportMemoryAllocateInfo, + PNext = &dedicatedAllocation + }; + ImportMemoryWin32HandleInfoKHR handleImport = default; - if (exportable && RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (handleType == ExternalMemoryHandleTypeFlags.D3D11TextureBit && exportable) { - _d3dTexture2D = D3DMemoryHelper.CreateMemoryHandle(vk.D3DDevice!, size, Format); - using var dxgi = _d3dTexture2D.QueryInterface(); - - handleImport = new ImportMemoryWin32HandleInfoKHR - { - PNext = &dedicatedAllocation, - SType = StructureType.ImportMemoryWin32HandleInfoKhr, - HandleType = ExternalMemoryHandleTypeFlags.D3D11TextureBit, - Handle = dxgi.CreateSharedHandle(null, SharedResourceFlags.Read | SharedResourceFlags.Write), - }; + _d3dTexture2D = D3DMemoryHelper.CreateMemoryHandle(vk.D3DDevice, size, Format); + using var dxgi = _d3dTexture2D.QueryInterface(); + + handleImport = new ImportMemoryWin32HandleInfoKHR + { + PNext = &dedicatedAllocation, + SType = StructureType.ImportMemoryWin32HandleInfoKhr, + HandleType = ExternalMemoryHandleTypeFlags.D3D11TextureBit, + Handle = dxgi.CreateSharedHandle(null, SharedResourceFlags.Read | SharedResourceFlags.Write), + }; } var memoryAllocateInfo = new MemoryAllocateInfo { PNext = - exportable ? RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? &handleImport : &fdExport : null, + exportable ? handleImport.Handle != IntPtr.Zero ? &handleImport : &fdExport : null, SType = StructureType.MemoryAllocateInfo, AllocationSize = memoryRequirements.Size, MemoryTypeIndex = (uint)VulkanMemoryHelper.FindSuitableMemoryTypeIndex( @@ -187,14 +195,34 @@ public unsafe class VulkanImage : IDisposable return fd; } + public IntPtr ExportOpaqueNtHandle() + { + if (!Api.TryGetDeviceExtension(_instance, _device, out var ext)) + throw new InvalidOperationException(); + var info = new MemoryGetWin32HandleInfoKHR() + { + Memory = _imageMemory, + SType = StructureType.MemoryGetWin32HandleInfoKhr, + HandleType = ExternalMemoryHandleTypeFlags.OpaqueWin32Bit + }; + ext.GetMemoryWin32Handle(_device, info, out var fd).ThrowOnError(); + return fd; + } + public IPlatformHandle Export() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - using var dxgi = _d3dTexture2D!.QueryInterface(); - return new PlatformHandle( - dxgi.CreateSharedHandle(null, SharedResourceFlags.Read | SharedResourceFlags.Write), - KnownPlatformGraphicsExternalImageHandleTypes.D3D11TextureNtHandle); + if (_d3dTexture2D != null) + { + using var dxgi = _d3dTexture2D!.QueryInterface(); + return new PlatformHandle( + dxgi.CreateSharedHandle(null, SharedResourceFlags.Read | SharedResourceFlags.Write), + KnownPlatformGraphicsExternalImageHandleTypes.D3D11TextureNtHandle); + } + + return new PlatformHandle(ExportOpaqueNtHandle(), + KnownPlatformGraphicsExternalImageHandleTypes.VulkanOpaqueNtHandle); } else return new PlatformHandle(new IntPtr(ExportFd()), @@ -203,7 +231,7 @@ public unsafe class VulkanImage : IDisposable public ImageTiling Tiling => ImageTiling.Optimal; - + public bool IsDirectXBacked => _d3dTexture2D != null; internal void TransitionLayout(CommandBuffer commandBuffer, ImageLayout fromLayout, AccessFlags fromAccessFlags, diff --git a/samples/GpuInterop/VulkanDemo/VulkanSemaphorePair.cs b/samples/GpuInterop/VulkanDemo/VulkanSemaphorePair.cs index 279c313a27..163a39dd9e 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanSemaphorePair.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanSemaphorePair.cs @@ -1,4 +1,6 @@ using System; +using System.Runtime.InteropServices; +using Avalonia.Platform; using Silk.NET.Vulkan; using Silk.NET.Vulkan.Extensions.KHR; using SilkNetDemo; @@ -16,7 +18,9 @@ class VulkanSemaphorePair : IDisposable var semaphoreExportInfo = new ExportSemaphoreCreateInfo { SType = StructureType.ExportSemaphoreCreateInfo, - HandleTypes = ExternalSemaphoreHandleTypeFlags.OpaqueFDBit + HandleTypes = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? + ExternalSemaphoreHandleTypeFlags.OpaqueWin32Bit : + ExternalSemaphoreHandleTypeFlags.OpaqueFDBit }; var semaphoreCreateInfo = new SemaphoreCreateInfo @@ -46,6 +50,30 @@ class VulkanSemaphorePair : IDisposable ext.GetSemaphoreF(_resources.Device, info, out var fd).ThrowOnError(); return fd; } + + public IntPtr ExportWin32(bool renderFinished) + { + if (!_resources.Api.TryGetDeviceExtension(_resources.Instance, _resources.Device, + out var ext)) + throw new InvalidOperationException(); + var info = new SemaphoreGetWin32HandleInfoKHR() + { + SType = StructureType.SemaphoreGetWin32HandleInfoKhr, + Semaphore = renderFinished ? RenderFinishedSemaphore : ImageAvailableSemaphore, + HandleType = ExternalSemaphoreHandleTypeFlags.OpaqueWin32Bit + }; + ext.GetSemaphoreWin32Handle(_resources.Device, info, out var fd).ThrowOnError(); + return fd; + } + + public IPlatformHandle Export(bool renderFinished) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + return new PlatformHandle(ExportWin32(renderFinished), + KnownPlatformGraphicsExternalSemaphoreHandleTypes.VulkanOpaqueNtHandle); + return new PlatformHandle(new IntPtr(ExportFd(renderFinished)), + KnownPlatformGraphicsExternalSemaphoreHandleTypes.VulkanOpaquePosixFileDescriptor); + } internal Semaphore ImageAvailableSemaphore { get; } internal Semaphore RenderFinishedSemaphore { get; } @@ -55,4 +83,4 @@ class VulkanSemaphorePair : IDisposable _resources.Api.DestroySemaphore(_resources.Device, ImageAvailableSemaphore, null); _resources.Api.DestroySemaphore(_resources.Device, RenderFinishedSemaphore, null); } -} \ No newline at end of file +} diff --git a/samples/GpuInterop/VulkanDemo/VulkanSwapchain.cs b/samples/GpuInterop/VulkanDemo/VulkanSwapchain.cs index cd026b3972..a748ba4bb6 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanSwapchain.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanSwapchain.cs @@ -52,7 +52,7 @@ class VulkanSwapchainImage : ISwapchainImage _interop = interop; _target = target; Size = size; - _image = new VulkanImage(vk, (uint)Format.R8G8B8A8Unorm, size, true); + _image = new VulkanImage(vk, (uint)Format.R8G8B8A8Unorm, size, true, interop.SupportedImageHandleTypes); _semaphorePair = new VulkanSemaphorePair(vk, true); } @@ -83,7 +83,7 @@ class VulkanSwapchainImage : ISwapchainImage ImageLayout.Undefined, AccessFlags.None, ImageLayout.ColorAttachmentOptimal, AccessFlags.ColorAttachmentReadBit); - if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if(_image.IsDirectXBacked) buffer.Submit(null,null,null, null, new VulkanCommandBufferPool.VulkanCommandBuffer.KeyedMutexSubmitInfo { AcquireKey = 0, @@ -111,8 +111,7 @@ class VulkanSwapchainImage : ISwapchainImage _image.TransitionLayout(buffer.InternalHandle, ImageLayout.TransferSrcOptimal, AccessFlags.TransferWriteBit); - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (_image.IsDirectXBacked) { buffer.Submit(null, null, null, null, new VulkanCommandBufferPool.VulkanCommandBuffer.KeyedMutexSubmitInfo @@ -123,15 +122,11 @@ class VulkanSwapchainImage : ISwapchainImage else buffer.Submit(null, null, new[] { _semaphorePair.RenderFinishedSemaphore }); - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (!_image.IsDirectXBacked) { - _availableSemaphore ??= _interop.ImportSemaphore(new PlatformHandle( - new IntPtr(_semaphorePair.ExportFd(false)), - KnownPlatformGraphicsExternalSemaphoreHandleTypes.VulkanOpaquePosixFileDescriptor)); + _availableSemaphore ??= _interop.ImportSemaphore(_semaphorePair.Export(false)); - _renderCompletedSemaphore ??= _interop.ImportSemaphore(new PlatformHandle( - new IntPtr(_semaphorePair.ExportFd(true)), - KnownPlatformGraphicsExternalSemaphoreHandleTypes.VulkanOpaquePosixFileDescriptor)); + _renderCompletedSemaphore ??= _interop.ImportSemaphore(_semaphorePair.Export(true)); } _importedImage ??= _interop.ImportImage(_image.Export(), @@ -143,7 +138,7 @@ class VulkanSwapchainImage : ISwapchainImage MemorySize = _image.MemorySize }); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (_image.IsDirectXBacked) _lastPresent = _target.UpdateWithKeyedMutexAsync(_importedImage, 1, 0); else _lastPresent = _target.UpdateWithSemaphoresAsync(_importedImage, _renderCompletedSemaphore!, _availableSemaphore!); diff --git a/samples/IntegrationTestApp/IntegrationTestApp.csproj b/samples/IntegrationTestApp/IntegrationTestApp.csproj index 5cdbd77d5b..77bfa828a7 100644 --- a/samples/IntegrationTestApp/IntegrationTestApp.csproj +++ b/samples/IntegrationTestApp/IntegrationTestApp.csproj @@ -1,7 +1,7 @@  WinExe - net7.0 + $(AvsCurrentTargetFramework) enable $(NoWarn);AVP1012 diff --git a/samples/IntegrationTestApp/MainWindow.axaml.cs b/samples/IntegrationTestApp/MainWindow.axaml.cs index 170936f50d..986eb920a3 100644 --- a/samples/IntegrationTestApp/MainWindow.axaml.cs +++ b/samples/IntegrationTestApp/MainWindow.axaml.cs @@ -49,7 +49,7 @@ namespace IntegrationTestApp var menuItem = new NativeMenuItem { Header = (string?)tabItem.Header, - ToolTip = (string?)tabItem.Header, + ToolTip = $"Tip:{(string?)tabItem.Header}", IsChecked = tabItem.IsSelected, ToggleType = NativeMenuItemToggleType.Radio, }; diff --git a/samples/IntegrationTestApp/bundle.sh b/samples/IntegrationTestApp/bundle.sh index e52968215b..2b480723c2 100755 --- a/samples/IntegrationTestApp/bundle.sh +++ b/samples/IntegrationTestApp/bundle.sh @@ -9,4 +9,4 @@ arch="arm64" fi dotnet restore -r osx-$arch -dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-$arch -p:_AvaloniaUseExternalMSBuild=false \ No newline at end of file +dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-$arch diff --git a/samples/MiniMvvm/MiniCommand.cs b/samples/MiniMvvm/MiniCommand.cs index c6a9273c20..b39ceced3d 100644 --- a/samples/MiniMvvm/MiniCommand.cs +++ b/samples/MiniMvvm/MiniCommand.cs @@ -6,10 +6,10 @@ namespace MiniMvvm { public sealed class MiniCommand : MiniCommand, ICommand { - private readonly Action _cb; + private readonly Action? _cb; + private readonly Func? _acb; private bool _busy; - private Func _acb; - + public MiniCommand(Action cb) { _cb = cb; @@ -31,10 +31,11 @@ namespace MiniMvvm } - public override event EventHandler CanExecuteChanged; - public override bool CanExecute(object parameter) => !_busy; + public override event EventHandler? CanExecuteChanged; + + public override bool CanExecute(object? parameter) => !_busy; - public override async void Execute(object parameter) + public override async void Execute(object? parameter) { if(Busy) return; @@ -42,9 +43,9 @@ namespace MiniMvvm { Busy = true; if (_cb != null) - _cb((T)parameter); + _cb((T)parameter!); else - await _acb((T)parameter); + await _acb!((T)parameter!); } finally { diff --git a/samples/MiniMvvm/MiniMvvm.csproj b/samples/MiniMvvm/MiniMvvm.csproj index 2a9164624a..1f3869a2b5 100644 --- a/samples/MiniMvvm/MiniMvvm.csproj +++ b/samples/MiniMvvm/MiniMvvm.csproj @@ -1,8 +1,16 @@ + netstandard2.0 + enable + - + + + + + + diff --git a/samples/MiniMvvm/ViewModelBase.cs b/samples/MiniMvvm/ViewModelBase.cs index 8bc398607f..1b2f3b2c1b 100644 --- a/samples/MiniMvvm/ViewModelBase.cs +++ b/samples/MiniMvvm/ViewModelBase.cs @@ -6,8 +6,9 @@ namespace MiniMvvm { public class ViewModelBase : INotifyPropertyChanged { - public event PropertyChangedEventHandler PropertyChanged; - protected bool RaiseAndSetIfChanged(ref T field, T value, [CallerMemberName] string propertyName = null) + public event PropertyChangedEventHandler? PropertyChanged; + + protected bool RaiseAndSetIfChanged(ref T field, T value, [CallerMemberName] string? propertyName = null) { if (!EqualityComparer.Default.Equals(field, value)) { @@ -17,9 +18,8 @@ namespace MiniMvvm } return false; } - - - protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) + + protected void RaisePropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } diff --git a/samples/MobileSandbox.Android/MainActivity.cs b/samples/MobileSandbox.Android/MainActivity.cs deleted file mode 100644 index 702e9be9e6..0000000000 --- a/samples/MobileSandbox.Android/MainActivity.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using Android.App; -using Android.Content.PM; -using Android.OS; -using Avalonia; -using Avalonia.Android; - -namespace MobileSandbox.Android -{ - [Activity(Label = "MobileSandbox.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] - public class MainActivity : AvaloniaMainActivity - { - } -} diff --git a/samples/MobileSandbox.Android/MobileSandbox.Android.csproj b/samples/MobileSandbox.Android/MobileSandbox.Android.csproj deleted file mode 100644 index e1a75d4787..0000000000 --- a/samples/MobileSandbox.Android/MobileSandbox.Android.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - net7.0-android - 21 - Exe - enable - com.Avalonia.MobileSandbox - 1 - 1.0 - apk - true - - - - Resources\drawable\Icon.png - - - - - True - True - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/AboutResources.txt b/samples/MobileSandbox.Android/Resources/AboutResources.txt deleted file mode 100644 index c2bca974c4..0000000000 --- a/samples/MobileSandbox.Android/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -Images, layout descriptions, binary blobs and string dictionaries can be included -in your application as resource files. Various Android APIs are designed to -operate on the resource IDs instead of dealing with images, strings or binary blobs -directly. - -For example, a sample Android app that contains a user interface layout (main.axml), -an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) -would keep its resources in the "Resources" directory of the application: - -Resources/ - drawable/ - icon.png - - layout/ - main.axml - - values/ - strings.xml - -In order to get the build system to recognize Android resources, set the build action to -"AndroidResource". The native Android APIs do not operate directly with filenames, but -instead operate on resource IDs. When you compile an Android application that uses resources, -the build system will package the resources for distribution and generate a class called "R" -(this is an Android convention) that contains the tokens for each one of the resources -included. For example, for the above Resources layout, this is what the R class would expose: - -public class R { - public class drawable { - public const int icon = 0x123; - } - - public class layout { - public const int main = 0x456; - } - - public class strings { - public const int first_string = 0xabc; - public const int second_string = 0xbcd; - } -} - -You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main -to reference the layout/main.axml file, or R.strings.first_string to reference the first -string in the dictionary file values/strings.xml. \ No newline at end of file diff --git a/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml b/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml deleted file mode 100644 index dde4b5a7dd..0000000000 --- a/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml b/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml deleted file mode 100644 index 94f27d9e63..0000000000 --- a/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml b/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml deleted file mode 100644 index 2e920b4b3b..0000000000 --- a/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/values-night/colors.xml b/samples/MobileSandbox.Android/Resources/values-night/colors.xml deleted file mode 100644 index 3d47b6fc58..0000000000 --- a/samples/MobileSandbox.Android/Resources/values-night/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #212121 - diff --git a/samples/MobileSandbox.Android/Resources/values-v31/styles.xml b/samples/MobileSandbox.Android/Resources/values-v31/styles.xml deleted file mode 100644 index 7518f078e5..0000000000 --- a/samples/MobileSandbox.Android/Resources/values-v31/styles.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/values/colors.xml b/samples/MobileSandbox.Android/Resources/values/colors.xml deleted file mode 100644 index 59279d5d32..0000000000 --- a/samples/MobileSandbox.Android/Resources/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - diff --git a/samples/MobileSandbox.Android/Resources/values/styles.xml b/samples/MobileSandbox.Android/Resources/values/styles.xml deleted file mode 100644 index 22085806da..0000000000 --- a/samples/MobileSandbox.Android/Resources/values/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/samples/MobileSandbox.Android/environment.device.txt b/samples/MobileSandbox.Android/environment.device.txt deleted file mode 100644 index 107d68ca1b..0000000000 --- a/samples/MobileSandbox.Android/environment.device.txt +++ /dev/null @@ -1 +0,0 @@ -DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend diff --git a/samples/MobileSandbox.Android/environment.emulator.txt b/samples/MobileSandbox.Android/environment.emulator.txt deleted file mode 100644 index 299a0ec30b..0000000000 --- a/samples/MobileSandbox.Android/environment.emulator.txt +++ /dev/null @@ -1 +0,0 @@ -DOTNET_DiagnosticPorts=10.0.2.2:9001,suspend diff --git a/samples/MobileSandbox.Browser/Logo.svg b/samples/MobileSandbox.Browser/Logo.svg deleted file mode 100644 index 9685a23af1..0000000000 --- a/samples/MobileSandbox.Browser/Logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj b/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj deleted file mode 100644 index 6174b4f135..0000000000 --- a/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - net7.0 - browser-wasm - main.js - Exe - true - true - true - ./ - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Browser/Properties/launchSettings.json b/samples/MobileSandbox.Browser/Properties/launchSettings.json deleted file mode 100644 index 66234a3211..0000000000 --- a/samples/MobileSandbox.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "MobileSandbox.Browser": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:65312;http://localhost:65313;" - } - } -} diff --git a/samples/MobileSandbox.Browser/app.css b/samples/MobileSandbox.Browser/app.css deleted file mode 100644 index 0e6ab12461..0000000000 --- a/samples/MobileSandbox.Browser/app.css +++ /dev/null @@ -1,56 +0,0 @@ -:root { - --sat: env(safe-area-inset-top); - --sar: env(safe-area-inset-right); - --sab: env(safe-area-inset-bottom); - --sal: env(safe-area-inset-left); -} - -#out { - height: 100vh; - width: 100vw -} - -#avalonia-splash { - position: relative; - height: 100%; - width: 100%; - color: whitesmoke; - background: #171C2C; - font-family: 'Nunito', sans-serif; - background-position: center; - background-size: cover; - background-repeat: no-repeat; -} - -#avalonia-splash a{ - color: whitesmoke; - text-decoration: none; -} - -.center { - display: flex; - justify-content: center; - height: 250px; -} - -.splash-close { - animation: slide 0.5s linear 1s forwards; -} - -@keyframes slide { - 0% { - top: 0%; - } - - 50% { - opacity: 80%; - } - - 100% { - top: 100%; - overflow: hidden; - opacity: 0; - display: none; - visibility: collapse; - } -} diff --git a/samples/MobileSandbox.Browser/index.html b/samples/MobileSandbox.Browser/index.html deleted file mode 100644 index 32ab8628fb..0000000000 --- a/samples/MobileSandbox.Browser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - Mobile Sandbox - - - - - - - - - -
-
-
-

Powered by

- - Avalonia Logo - Avalonia - -
-
-
- - - - diff --git a/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj b/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj deleted file mode 100644 index c1d157a2e8..0000000000 --- a/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - WinExe - net6.0 - true - - - - - - - - - - - - - en - app.manifest - - - - - diff --git a/samples/MobileSandbox.Desktop/Program.cs b/samples/MobileSandbox.Desktop/Program.cs deleted file mode 100644 index 4d49a65994..0000000000 --- a/samples/MobileSandbox.Desktop/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Avalonia; - -namespace MobileSandbox.Desktop -{ - static class Program - { - [STAThread] - static int Main(string[] args) => - BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); - - /// - /// This method is needed for IDE previewer infrastructure - /// - public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(); - } -} diff --git a/samples/MobileSandbox.iOS/AppDelegate.cs b/samples/MobileSandbox.iOS/AppDelegate.cs deleted file mode 100644 index 60214cc541..0000000000 --- a/samples/MobileSandbox.iOS/AppDelegate.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Foundation; -using UIKit; -using Avalonia; -using Avalonia.Controls; -using Avalonia.iOS; -using Avalonia.Logging; -using Avalonia.Media; - -namespace MobileSandbox -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register("AppDelegate")] - public partial class AppDelegate : AvaloniaAppDelegate - { - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return builder.LogToTrace(LogEventLevel.Debug, "IOSIME"); - } - } -} diff --git a/samples/MobileSandbox.iOS/Main.cs b/samples/MobileSandbox.iOS/Main.cs deleted file mode 100644 index fdd78bbb11..0000000000 --- a/samples/MobileSandbox.iOS/Main.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UIKit; - -namespace MobileSandbox.iOS -{ - public class Application - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof(AppDelegate)); - } - } -} diff --git a/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj b/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj deleted file mode 100644 index 0573eb781a..0000000000 --- a/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - Exe - manual - net7.0-ios - 13.0 - - - - - - diff --git a/samples/MobileSandbox/App.xaml.cs b/samples/MobileSandbox/App.xaml.cs deleted file mode 100644 index d32d9bb5a7..0000000000 --- a/samples/MobileSandbox/App.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace MobileSandbox -{ - public class App : Application - { - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) - { - desktopLifetime.MainWindow = new MainWindow(); - } - else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) - { - singleViewLifetime.MainView = new MainView(); - } - - base.OnFrameworkInitializationCompleted(); - } - } -} diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf deleted file mode 100644 index f6986468bd..0000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf deleted file mode 100644 index 5c00b64faf..0000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf deleted file mode 100644 index 82e8762011..0000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index 278ad8aa0a..0000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf b/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf deleted file mode 100644 index 61e2583a6c..0000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/avalonia-32.png b/samples/MobileSandbox/Assets/avalonia-32.png deleted file mode 100644 index 7b443e7a25..0000000000 Binary files a/samples/MobileSandbox/Assets/avalonia-32.png and /dev/null differ diff --git a/samples/MobileSandbox/Assets/test_icon.ico b/samples/MobileSandbox/Assets/test_icon.ico deleted file mode 100644 index da8d49ff9b..0000000000 Binary files a/samples/MobileSandbox/Assets/test_icon.ico and /dev/null differ diff --git a/samples/MobileSandbox/MainView.xaml.cs b/samples/MobileSandbox/MainView.xaml.cs deleted file mode 100644 index 4b2b546b1c..0000000000 --- a/samples/MobileSandbox/MainView.xaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Windows.Input; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -namespace MobileSandbox -{ - public class MainView : UserControl - { - public MainView() - { - AvaloniaXamlLoader.Load(this); - - DataContext = this; - } - - public void ButtonCommand() - { - Console.WriteLine("Button pressed"); - } - } -} diff --git a/samples/MobileSandbox/MainWindow.xaml.cs b/samples/MobileSandbox/MainWindow.xaml.cs deleted file mode 100644 index f2ff7cf0c8..0000000000 --- a/samples/MobileSandbox/MainWindow.xaml.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -namespace MobileSandbox -{ - public class MainWindow : Window - { - public MainWindow() - { - this.InitializeComponent(); - - //Renderer.DrawFps = true; - //Renderer.DrawDirtyRects = Renderer.DrawFps = true; - } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } - } -} diff --git a/samples/MobileSandbox/MobileSandbox.csproj b/samples/MobileSandbox/MobileSandbox.csproj deleted file mode 100644 index 7fa364da9b..0000000000 --- a/samples/MobileSandbox/MobileSandbox.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - netstandard2.0;net6.0 - true - enable - - - - %(Filename) - - - Designer - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox/Views/CustomNotificationView.xaml b/samples/MobileSandbox/Views/CustomNotificationView.xaml deleted file mode 100644 index f07116583c..0000000000 --- a/samples/MobileSandbox/Views/CustomNotificationView.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -