diff --git a/src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json b/src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json index fdfd02825..685d9459a 100644 --- a/src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json +++ b/src/Uno.Templates/content/unoapp/.template.config/dotnetcli.host.json @@ -153,6 +153,16 @@ }, "isVsix": { "isHidden": true + }, + "projectOnly": { + "longName": "project-only", + "shortName": "project-only", + "isHidden": true + }, + "includeGlobalJson": { + "longName": "include-global-json", + "shortName": "include-global-json", + "isHidden": true } } } diff --git a/src/Uno.Templates/content/unoapp/.template.config/template.json b/src/Uno.Templates/content/unoapp/.template.config/template.json index 8c95ecf98..e1d486048 100644 --- a/src/Uno.Templates/content/unoapp/.template.config/template.json +++ b/src/Uno.Templates/content/unoapp/.template.config/template.json @@ -803,6 +803,13 @@ "description": "If specified, skips the automatic restore of the project on create.", "defaultValue": "false" }, + "projectOnly": { + "type": "parameter", + "datatype": "bool", + "displayName": "Project Only", + "description": "If specified, creates only the main project folder without solution file or top-level configuration files. Intended for adding projects to existing solutions.", + "defaultValue": "false" + }, "unoSdkVersion": { "type": "parameter", "datatype": "text", @@ -818,6 +825,11 @@ "description": "If specified, generates a global.json file with the Uno.SDK version. Set to false to manage SDK versions externally.", "defaultValue": "true" }, + "includeGlobalJsonEvaluator": { + "type": "computed", + "datatype": "bool", + "value": "(includeGlobalJson && !projectOnly)" + }, "unoWasmBootstrapVersion": { "type": "parameter", "datatype": "text" @@ -2360,7 +2372,7 @@ ] }, { - "condition": "(isVsix)", + "condition": "(isVsix || (projectOnly && !requiresNugetPackages))", "exclude": [ "MyExtensionsApp.1.sln" ] @@ -2766,12 +2778,27 @@ ] }, { - "condition": "(!includeGlobalJson)", + "condition": "(!includeGlobalJsonEvaluator)", "exclude": [ "global.json" ] + }, + { + "condition": "(projectOnly && !requiresNugetPackages)", + "exclude": [ + ".editorconfig", + ".vsconfig", + ".run/**/*", + ".vscode/**/*", + "MyExtensionsApp.1/**" + ] } ] + }, + { + "condition": "(projectOnly && !requiresNugetPackages)", + "source": "MyExtensionsApp.1/", + "target": "./" } ], "postActions": [