From 8ed448dac26b2ad0fc3d8716ccbc1e5ce3ab69c0 Mon Sep 17 00:00:00 2001 From: mrxx99 Date: Sun, 1 Jan 2023 22:03:37 +0100 Subject: [PATCH] added primary outputs and post action to open relevant files in IDE --- .../app-mvvm/.template.config/template.json | 28 +++++++++++++++++ .../csharp/app/.template.config/template.json | 28 +++++++++++++++++ .../xplat/.template.config/template.json | 30 ++++++++++++++++++- .../app-mvvm/.template.config/template.json | 30 ++++++++++++++++++- .../fsharp/app/.template.config/template.json | 30 ++++++++++++++++++- .../xplat/.template.config/template.json | 30 ++++++++++++++++++- 6 files changed, 172 insertions(+), 4 deletions(-) diff --git a/templates/csharp/app-mvvm/.template.config/template.json b/templates/csharp/app-mvvm/.template.config/template.json index cf44cfce..05ebd80e 100644 --- a/templates/csharp/app-mvvm/.template.config/template.json +++ b/templates/csharp/app-mvvm/.template.config/template.json @@ -72,6 +72,10 @@ "AvaloniaStableChosen": { "type": "computed", "value": "(AvaloniaVersion == \"0.10.18\")" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" } }, "sources": [ @@ -85,5 +89,29 @@ } ] } + ], + "primaryOutputs": [ + { "path": "AvaloniaAppTemplate.csproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "ViewModels/MainWindowViewModel.cs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "Views/MainWindow.axaml" + } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainWindow and MainWindowViewModel in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": true + } ] } \ No newline at end of file diff --git a/templates/csharp/app/.template.config/template.json b/templates/csharp/app/.template.config/template.json index a03a71eb..181e542d 100644 --- a/templates/csharp/app/.template.config/template.json +++ b/templates/csharp/app/.template.config/template.json @@ -52,6 +52,34 @@ "AvaloniaStableChosen": { "type": "computed", "value": "(AvaloniaVersion == \"0.10.18\")" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" } + }, + "primaryOutputs": [ + { "path": "AvaloniaAppTemplate.csproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "MainWindow.axaml.cs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "MainWindow.axaml" } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainWindow in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": 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 b345be5d..74481240 100644 --- a/templates/csharp/xplat/.template.config/template.json +++ b/templates/csharp/xplat/.template.config/template.json @@ -27,6 +27,34 @@ ], "replaces": "FrameworkParameter", "defaultValue": "net7.0" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" } - } + }, + "primaryOutputs": [ + { "path": "AvaloniaTest/AvaloniaTest.csproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "AvaloniaTest/ViewModels/MainViewModel.cs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "AvaloniaTest/Views/MainView.axaml" + } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainView and MainViewModel in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": 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 571cdcd6..6d23daea 100644 --- a/templates/fsharp/app-mvvm/.template.config/template.json +++ b/templates/fsharp/app-mvvm/.template.config/template.json @@ -52,6 +52,34 @@ "AvaloniaStableChosen": { "type": "computed", "value": "(AvaloniaVersion == \"0.10.18\")" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" + } + }, + "primaryOutputs": [ + { "path": "AvaloniaAppTemplate.fsproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "ViewModels/MainWindowViewModel.fs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "Views/MainWindow.axaml" + } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainWindow and MainWindowViewModel in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": true } - } + ] } \ No newline at end of file diff --git a/templates/fsharp/app/.template.config/template.json b/templates/fsharp/app/.template.config/template.json index e65d2249..5321eda8 100644 --- a/templates/fsharp/app/.template.config/template.json +++ b/templates/fsharp/app/.template.config/template.json @@ -52,6 +52,34 @@ "AvaloniaStableChosen": { "type": "computed", "value": "(AvaloniaVersion == \"0.10.18\")" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" + } + }, + "primaryOutputs": [ + { "path": "AvaloniaAppTemplate.fsproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "MainWindow.axaml.fs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "MainWindow.axaml" + } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainWindow in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": true } - } + ] } \ No newline at end of file diff --git a/templates/fsharp/xplat/.template.config/template.json b/templates/fsharp/xplat/.template.config/template.json index fceb6b3f..b36db1dd 100644 --- a/templates/fsharp/xplat/.template.config/template.json +++ b/templates/fsharp/xplat/.template.config/template.json @@ -27,6 +27,34 @@ ], "replaces": "FrameworkParameter", "defaultValue": "net7.0" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" } - } + }, + "primaryOutputs": [ + { "path": "AvaloniaTest/AvaloniaTest.fsproj" }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "AvaloniaTest/ViewModels/MainViewModel.fs" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "AvaloniaTest/Views/MainView.axaml" + } + ], + "postActions": [ + { + "id": "editor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens MainView and MainViewModel in the editor", + "manualInstructions": [ ], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1;2" + }, + "continueOnError": true + } + ] } \ No newline at end of file