From 8f0cc48cf6d69fa162fc393da0265bd97ce5440c Mon Sep 17 00:00:00 2001 From: mrxx99 Date: Sat, 3 Dec 2022 21:49:03 +0100 Subject: [PATCH 1/2] added avalonia version choice for MVVM templates --- .../app-mvvm/.template.config/ide.host.json | 20 +++++++++++ .../app-mvvm/.template.config/template.json | 20 +++++++++++ .../app-mvvm/AvaloniaAppTemplate.csproj | 13 +++++++ .../app-mvvm/.template.config/ide.host.json | 13 +++++++ .../app-mvvm/.template.config/template.json | 35 +++++++++++++++++++ .../app-mvvm/AvaloniaAppTemplate.fsproj | 9 +++++ 6 files changed, 110 insertions(+) create mode 100644 templates/csharp/app-mvvm/.template.config/ide.host.json create mode 100644 templates/fsharp/app-mvvm/.template.config/ide.host.json diff --git a/templates/csharp/app-mvvm/.template.config/ide.host.json b/templates/csharp/app-mvvm/.template.config/ide.host.json new file mode 100644 index 00000000..01f1de90 --- /dev/null +++ b/templates/csharp/app-mvvm/.template.config/ide.host.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json.schemastore.org/ide.host", + "icon": "icon.png", + "symbolInfo": [ + { + "id": "AvaloniaVersion", + "name": { + "text": "Avalonia Version" + }, + "isVisible": true + }, + { + "id": "MVVMToolkit", + "name": { + "text": "MVVM Toolkit" + }, + "isVisible": true + } + ] +} \ No newline at end of file diff --git a/templates/csharp/app-mvvm/.template.config/template.json b/templates/csharp/app-mvvm/.template.config/template.json index 1d6483f0..aee258b0 100644 --- a/templates/csharp/app-mvvm/.template.config/template.json +++ b/templates/csharp/app-mvvm/.template.config/template.json @@ -47,6 +47,26 @@ "ReactiveUIToolkitChosen": { "type": "computed", "value": "(MVVMToolkit == \"ReactiveUI\")" + }, + "AvaloniaVersion": { + "type": "parameter", + "description": "The target version of Avalonia NuGet packages.", + "datatype": "choice", + "choices": [ + { + "choice": "0.10.18", + "description": "Target 0.10.18 (Latest stable)." + }, + { + "choice": "11.0.0-preview4", + "description": "Target 11.0.0-preview4" + } + ], + "defaultValue": "0.10.18" + }, + "AvaloniaStableChosen": { + "type": "computed", + "value": "(AvaloniaVersion == \"0.10.18\")" } }, "sources": [ diff --git a/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj b/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj index f18ab0cf..a66d1a9e 100644 --- a/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj +++ b/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj @@ -18,6 +18,7 @@ + @@ -27,6 +28,18 @@ + + + + + + + + + + + + diff --git a/templates/fsharp/app-mvvm/.template.config/ide.host.json b/templates/fsharp/app-mvvm/.template.config/ide.host.json new file mode 100644 index 00000000..937f4730 --- /dev/null +++ b/templates/fsharp/app-mvvm/.template.config/ide.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/ide.host", + "icon": "icon.png", + "symbolInfo": [ + { + "id": "AvaloniaVersion", + "name": { + "text": "Avalonia Version" + }, + "isVisible": true + } + ] +} \ No newline at end of file diff --git a/templates/fsharp/app-mvvm/.template.config/template.json b/templates/fsharp/app-mvvm/.template.config/template.json index 567595fe..f92543a8 100644 --- a/templates/fsharp/app-mvvm/.template.config/template.json +++ b/templates/fsharp/app-mvvm/.template.config/template.json @@ -13,5 +13,40 @@ "tags": { "language": "F#", "type": "project" + }, + "symbols": { + "Framework": { + "type": "parameter", + "description": "The target framework for the project.", + "datatype": "choice", + "choices": [ + { + "choice": "net6.0", + "description": "Target net6.0" + } + ], + "replaces": "net6.0", + "defaultValue": "net6.0" + }, + "AvaloniaVersion": { + "type": "parameter", + "description": "The target version of Avalonia NuGet packages.", + "datatype": "choice", + "choices": [ + { + "choice": "0.10.18", + "description": "Target 0.10.18 (Latest stable)." + }, + { + "choice": "11.0.0-preview4", + "description": "Target 11.0.0-preview4" + } + ], + "defaultValue": "0.10.18" + }, + "AvaloniaStableChosen": { + "type": "computed", + "value": "(AvaloniaVersion == \"0.10.18\")" + } } } \ No newline at end of file diff --git a/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj b/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj index befc547e..e7bafe33 100644 --- a/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj +++ b/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj @@ -26,10 +26,19 @@ + + + + + + + + + From 461d88c9b717a101f5fa4f669d7b4c24704457a7 Mon Sep 17 00:00:00 2001 From: mrxx99 Date: Sat, 3 Dec 2022 22:59:05 +0100 Subject: [PATCH 2/2] simplified avalonia version choosing --- .../app-mvvm/.template.config/template.json | 1 + .../app-mvvm/AvaloniaAppTemplate.csproj | 22 +++++-------------- .../csharp/app/.template.config/template.json | 1 + .../csharp/app/AvaloniaAppTemplate.csproj | 17 +++++--------- .../app-mvvm/.template.config/template.json | 1 + .../app-mvvm/AvaloniaAppTemplate.fsproj | 21 +++++++----------- .../fsharp/app/.template.config/template.json | 1 + .../fsharp/app/AvaloniaAppTemplate.fsproj | 18 ++++++--------- 8 files changed, 31 insertions(+), 51 deletions(-) diff --git a/templates/csharp/app-mvvm/.template.config/template.json b/templates/csharp/app-mvvm/.template.config/template.json index aee258b0..c237b1c0 100644 --- a/templates/csharp/app-mvvm/.template.config/template.json +++ b/templates/csharp/app-mvvm/.template.config/template.json @@ -62,6 +62,7 @@ "description": "Target 11.0.0-preview4" } ], + "replaces": "AvaloniaVersionTemplateParameter", "defaultValue": "0.10.18" }, "AvaloniaStableChosen": { diff --git a/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj b/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj index a66d1a9e..896e6f86 100644 --- a/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj +++ b/templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj @@ -18,28 +18,18 @@ - - - - - - - - - + + + + - - - - - + - + - diff --git a/templates/csharp/app/.template.config/template.json b/templates/csharp/app/.template.config/template.json index 18126f40..5787f266 100644 --- a/templates/csharp/app/.template.config/template.json +++ b/templates/csharp/app/.template.config/template.json @@ -42,6 +42,7 @@ "description": "Target 11.0.0-preview4" } ], + "replaces": "AvaloniaVersionTemplateParameter", "defaultValue": "0.10.18" }, "AvaloniaStableChosen": { diff --git a/templates/csharp/app/AvaloniaAppTemplate.csproj b/templates/csharp/app/AvaloniaAppTemplate.csproj index f511eb66..1f48068e 100644 --- a/templates/csharp/app/AvaloniaAppTemplate.csproj +++ b/templates/csharp/app/AvaloniaAppTemplate.csproj @@ -15,18 +15,13 @@ - - - + + + + + - - - - - - - - + diff --git a/templates/fsharp/app-mvvm/.template.config/template.json b/templates/fsharp/app-mvvm/.template.config/template.json index f92543a8..35732fce 100644 --- a/templates/fsharp/app-mvvm/.template.config/template.json +++ b/templates/fsharp/app-mvvm/.template.config/template.json @@ -42,6 +42,7 @@ "description": "Target 11.0.0-preview4" } ], + "replaces": "AvaloniaVersionTemplateParameter", "defaultValue": "0.10.18" }, "AvaloniaStableChosen": { diff --git a/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj b/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj index e7bafe33..a6e3aef9 100644 --- a/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj +++ b/templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj @@ -26,19 +26,14 @@ - - - + + + + + - - - - - - - - - - + + + diff --git a/templates/fsharp/app/.template.config/template.json b/templates/fsharp/app/.template.config/template.json index b795be6c..df8cacfe 100644 --- a/templates/fsharp/app/.template.config/template.json +++ b/templates/fsharp/app/.template.config/template.json @@ -42,6 +42,7 @@ "description": "Target 11.0.0-preview4" } ], + "replaces": "AvaloniaVersionTemplateParameter", "defaultValue": "0.10.18" }, "AvaloniaStableChosen": { diff --git a/templates/fsharp/app/AvaloniaAppTemplate.fsproj b/templates/fsharp/app/AvaloniaAppTemplate.fsproj index c0791d0e..02508a99 100644 --- a/templates/fsharp/app/AvaloniaAppTemplate.fsproj +++ b/templates/fsharp/app/AvaloniaAppTemplate.fsproj @@ -21,17 +21,13 @@ - - - + + + + + - - - - - - - - + +