diff --git a/templates/csharp/xplat/.template.config/dotnetcli.host.json b/templates/csharp/xplat/.template.config/dotnetcli.host.json index b4e5778..563cb73 100644 --- a/templates/csharp/xplat/.template.config/dotnetcli.host.json +++ b/templates/csharp/xplat/.template.config/dotnetcli.host.json @@ -15,6 +15,10 @@ }, "RemoveViewLocator": { "longName": "remove-view-locator" + }, + "UseCentralPackageManagement": { + "longName": "cpm", + "shortName": "cpm" } }, "usageExamples": [ diff --git a/templates/csharp/xplat/.template.config/ide.host.json b/templates/csharp/xplat/.template.config/ide.host.json index 4774aa4..b791f94 100644 --- a/templates/csharp/xplat/.template.config/ide.host.json +++ b/templates/csharp/xplat/.template.config/ide.host.json @@ -29,6 +29,13 @@ "text": "Remove View Locator" }, "isVisible": true + }, + { + "id": "UseCentralPackageManagement", + "name": { + "text": "Use Central Package Management (CPM)" + }, + "isVisible": true } ] } \ No newline at end of file diff --git a/templates/csharp/xplat/.template.config/template.json b/templates/csharp/xplat/.template.config/template.json index a888cc6..aff3d8d 100644 --- a/templates/csharp/xplat/.template.config/template.json +++ b/templates/csharp/xplat/.template.config/template.json @@ -77,6 +77,13 @@ "displayName": "Remove Avalonia ViewLocator", "defaultValue": "false" }, + "UseCentralPackageManagement": { + "type": "parameter", + "description": "Defines if your app will Central Package Management (CPM). If disabled, Directory.Build.props will be created with shared Avalonia version.", + "datatype": "bool", + "displayName": "Use Central Package Management (CPM)", + "defaultValue": "true" + }, "HostIdentifier": { "type": "bind", "binding": "HostIdentifier" @@ -100,6 +107,18 @@ "exclude": [ "AvaloniaTest/App.RemoveViewLocator.axaml" ] + }, + { + "condition": "(UseCentralPackageManagement)", + "exclude": [ + "Directory.Build.props" + ] + }, + { + "condition": "(!UseCentralPackageManagement)", + "exclude": [ + "Directory.Packages.props" + ] } ] } diff --git a/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj b/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj index a994825..2821af2 100644 --- a/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj +++ b/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj @@ -18,8 +18,13 @@ + + + + + diff --git a/templates/csharp/xplat/AvaloniaTest.Browser/AvaloniaTest.Browser.csproj b/templates/csharp/xplat/AvaloniaTest.Browser/AvaloniaTest.Browser.csproj index e4db428..18aa3a7 100644 --- a/templates/csharp/xplat/AvaloniaTest.Browser/AvaloniaTest.Browser.csproj +++ b/templates/csharp/xplat/AvaloniaTest.Browser/AvaloniaTest.Browser.csproj @@ -7,7 +7,11 @@ + + + + diff --git a/templates/csharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.csproj b/templates/csharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.csproj index 7857972..1a1ed3c 100644 --- a/templates/csharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.csproj +++ b/templates/csharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.csproj @@ -13,12 +13,21 @@ - + + - + None All + + + + + None + All + + diff --git a/templates/csharp/xplat/AvaloniaTest.iOS/AvaloniaTest.iOS.csproj b/templates/csharp/xplat/AvaloniaTest.iOS/AvaloniaTest.iOS.csproj index b9b4125..512325b 100644 --- a/templates/csharp/xplat/AvaloniaTest.iOS/AvaloniaTest.iOS.csproj +++ b/templates/csharp/xplat/AvaloniaTest.iOS/AvaloniaTest.iOS.csproj @@ -7,7 +7,11 @@ + + + + diff --git a/templates/csharp/xplat/AvaloniaTest/AvaloniaTest.csproj b/templates/csharp/xplat/AvaloniaTest/AvaloniaTest.csproj index beaeb65..128cc19 100644 --- a/templates/csharp/xplat/AvaloniaTest/AvaloniaTest.csproj +++ b/templates/csharp/xplat/AvaloniaTest/AvaloniaTest.csproj @@ -13,11 +13,26 @@ + + + + + + + None + All + + + + + + + - + - + None All @@ -26,5 +41,6 @@ + diff --git a/templates/csharp/xplat/Directory.Packages.props b/templates/csharp/xplat/Directory.Packages.props new file mode 100644 index 0000000..7950431 --- /dev/null +++ b/templates/csharp/xplat/Directory.Packages.props @@ -0,0 +1,23 @@ + + + + true + 11.1.0 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/fsharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.fsproj b/templates/fsharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.fsproj index 7d0abd2..35a2189 100644 --- a/templates/fsharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.fsproj +++ b/templates/fsharp/xplat/AvaloniaTest.Desktop/AvaloniaTest.Desktop.fsproj @@ -18,7 +18,7 @@ - + None All diff --git a/templates/fsharp/xplat/AvaloniaTest/AvaloniaTest.fsproj b/templates/fsharp/xplat/AvaloniaTest/AvaloniaTest.fsproj index b4aeea2..e2ca5c9 100644 --- a/templates/fsharp/xplat/AvaloniaTest/AvaloniaTest.fsproj +++ b/templates/fsharp/xplat/AvaloniaTest/AvaloniaTest.fsproj @@ -27,7 +27,7 @@ - + None All diff --git a/tests/build-test.ps1 b/tests/build-test.ps1 index d520fb1..e2200a5 100644 --- a/tests/build-test.ps1 +++ b/tests/build-test.ps1 @@ -130,7 +130,10 @@ Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "cb" "false" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "rvl" "true" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "rvl" "false" $binlog +Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "f" "net8.0" $binlog Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "f" "net9.0" $binlog +Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "cpm" "true" $binlog +Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "cpm" "false" $binlog Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "av" "11.2.1" $binlog Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "m" "ReactiveUI" $binlog Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "m" "CommunityToolkit" $binlog