-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for dotnet new Prism blank app #3054
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Getting started with dotnet new templates | ||
|
||
The Uno Platform provides a set of command line templates to create cross platform applications. | ||
|
||
To install the templates, type the following: | ||
``` | ||
dotnet new -i Uno.ProjectTemplates.Dotnet::2.2 | ||
``` | ||
|
||
If you need to determine the parameters available for a template use `dotnet new [templatename] -h`. | ||
|
||
## Uno Platform Blank Application | ||
|
||
This template can be used to create a blank cross-platform application for iOS, Android, WebAssembly and macOS. | ||
|
||
A basic example: | ||
``` | ||
dotnet new unoapp -o MyApp | ||
``` | ||
|
||
A more advanced example which will not generate the android and macOS heads: | ||
|
||
``` | ||
dotnet new unoapp -o MyApp -android=false -macos=false | ||
``` | ||
|
||
## Uno Platform Blank Prism Application | ||
|
||
This template is specializing in the creation of a [Prism Library](https://github.com/PrismLibrary/Prism) enabled blank application. | ||
|
||
A basic example: | ||
``` | ||
dotnet new unoapp-prism -o MyApp | ||
``` | ||
|
||
A more advanced example which will not generate the android and macOS heads: | ||
|
||
``` | ||
dotnet new unoapp -o MyApp -android=false -macos=false | ||
``` | ||
|
||
## Uno Platform WebAssembly support for Xamarin Forms | ||
|
||
This template is built to enhance an existing Xamarin.Forms application with the [Uno Platform WebAssembly support](https://github.com/unoplatform/Uno.Xamarin.Forms.Platform). | ||
|
||
To use it: | ||
|
||
1. Create a Xamarin.Forms project | ||
1. Check **Place project and solution in the same directory** | ||
1. Check **Windows (UWP)** | ||
1. Using a **VS Developer Command Prompt**, navigate to the folder containing the solution | ||
``` | ||
dotnet new wasmxfhead | ||
``` | ||
1. Open or Reload the solution in Visual Studio | ||
1. Set the Wasm project as the startup project | ||
1. Open the **Nuget Package manager** for the Wasm project and update the `Uno.Xamarin.Forms.Platform` project to the latest **stable** package | ||
1. Run the app using **Ctrl+F5** (without the Visual Studio debugger), and you�re good to go! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ate/Uno.ProjectTemplates.Dotnet/content/unoapp-prism/.template.config/dotnetcli.host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/dotnetcli.host", | ||
"symbolInfo": { | ||
"WebAssembly": { | ||
"longName": "webassembly", | ||
"shortName": "wasm" | ||
}, | ||
"UWP": { | ||
"longName": "uwp", | ||
"shortName": "uwp" | ||
}, | ||
"iOS": { | ||
"longName": "ios", | ||
"shortName": "ios" | ||
}, | ||
"Android": { | ||
"longName": "android", | ||
"shortName": "android" | ||
}, | ||
"macOS": { | ||
"longName": "macos", | ||
"shortName": "macos" | ||
}, | ||
} | ||
jeromelaban marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
167 changes: 167 additions & 0 deletions
167
...nTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-prism/.template.config/template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "Uno Platform", | ||
"classifications": [ "Prism", "Xamarin", "Uno Platform", "WebAssembly", "iOS", "Android", "WinUI", "UWP" ], | ||
"name": "Prism Cross-Platform App (Uno Platform)", | ||
"identity": "Uno.Platform.Prism.CSharp", // Unique name for this template | ||
"groupIdentity": "Uno.Platform.Prism", | ||
"shortName": "unoapp-prism", // Short name that can be used on the cli | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "BlankApp", | ||
"preferNameDirectory": true, | ||
"guids": [ | ||
"4C26868E-5E7C-458D-82E3-040509D0C71F", // Solution file (SLN) | ||
"99E19497-29A6-4B77-B773-BEC55F9B55DC", // .NET Standard Library | ||
"8D9F8CF0-E178-402D-8D40-A88B7B5F3D42", // Android | ||
"91D74A40-E440-42AD-B51F-C2D641C49384", // iOS | ||
"B445DF73-AC9E-4276-9FBA-7CB5AD5D2518", | ||
"3EA9E612-E717-4E55-9034-DE653429FEFD", // WPF | ||
"3EA9E612-E717-4E55-9034-C415CD62AF9A", // UWP | ||
"2B1FDFB6-C93C-4CA1-A6AB-528C4B3654B9" // UWP | ||
], | ||
"symbols": { | ||
"guid1": { | ||
"type": "generated", | ||
"generator": "guid", | ||
"replaces": "$guid1$", | ||
"parameters": { | ||
"format": "N" | ||
} | ||
}, | ||
"guid2": { | ||
"type": "generated", | ||
"generator": "guid", | ||
"replaces": "$guid2$", | ||
"parameters": { | ||
"format": "N" | ||
} | ||
}, | ||
"windowsPublisherName": { | ||
"type": "parameter", | ||
"datatype": "text", | ||
"replaces": "$XmlEscapedPublisherDistinguishedName$", | ||
"description": "Provides the value to use for the Windows head publisher", | ||
"defaultValue": "O=MyCompany" | ||
}, | ||
"WebAssembly": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "true", | ||
"description": "Enables the WebAssembly platform support project" | ||
}, | ||
"UWP": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "true", | ||
"description": "Enables the Windows platform support project" | ||
}, | ||
"iOS": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "true", | ||
"description": "Enables the iOS platform support project" | ||
}, | ||
"Android": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "true", | ||
"description": "Enables the Android platform support project" | ||
}, | ||
"macOS": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "true", | ||
"description": "Enables the macOS platform support project" | ||
}, | ||
"vscodeWasm": { | ||
"type": "parameter", | ||
"dataType": "bool", | ||
"defaultValue": "false", | ||
"description": "Adds the Visual Studio Code Debugging support files for WebAssembly" | ||
}, | ||
"Container": { | ||
"type": "parameter", | ||
"dataType": "choice", | ||
"defaultValue": "DryIoc", | ||
"choices": [ | ||
{ | ||
"choice": "DryIoc", | ||
"description": "Uses DryIoc as the Dependency Injection Container" | ||
}, | ||
{ | ||
"choice": "Unity", | ||
"description": "Uses Unity as the Dependency Injection Container" | ||
} | ||
], | ||
"description": "The Dependency Injection Container to use" | ||
}, | ||
"DryIocContainer": { | ||
"type": "computed", | ||
"value": "(Container == \"DryIoc\")" | ||
}, | ||
"UnityContainer": { | ||
"type": "computed", | ||
"value": "(Container == \"Unity\")" | ||
} | ||
}, | ||
"primaryOutputs": [ | ||
{ | ||
"path": "BlankApp.Shared\\BlankApp.Shared.shproj" | ||
}, | ||
{ | ||
"condition": "Android", | ||
"path": "BlankApp.Droid\\BlankApp.Droid.csproj" | ||
}, | ||
{ | ||
"condition": "iOS", | ||
"path": "BlankApp.iOS\\BlankApp.iOS.csproj" | ||
}, | ||
{ | ||
"condition": "UWP", | ||
"path": "BlankApp.UWP\\BlankApp.Uwp.csproj" | ||
}, | ||
{ | ||
"condition": "Wasm", | ||
"path": "BlankApp.Wasm\\BlankApp.Wasm.csproj" | ||
}, | ||
{ | ||
"condition": "macOS", | ||
"path": "BlankApp.macOS\\BlankApp.macOS.csproj" | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"modifiers": [ | ||
{ | ||
"condition": "(!Android)", | ||
"exclude": [ "BlankApp/BlankApp.Android/**/*" ] | ||
}, | ||
{ | ||
"condition": "(!iOS)", | ||
"exclude": [ "BlankApp/BlankApp.iOS/**/*" ] | ||
}, | ||
{ | ||
"condition": "(!UWP)", | ||
"exclude": [ "BlankApp/BlankApp.UWP/**/*" ] | ||
}, | ||
{ | ||
"condition": "(!WebAsembly)", | ||
"exclude": [ "BlankApp/BlankApp.Wasm/**/*" ] | ||
}, | ||
{ | ||
"condition": "(!macOS)", | ||
"exclude": [ "BlankApp/BlankApp.macOS/**/*" ] | ||
}, | ||
{ | ||
"condition": "(!vscodeWasm)", | ||
"exclude": [ | ||
".vscode/**/*" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-prism/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (Uno Platform App)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"program": "dotnet", | ||
"args": [ "run" ], | ||
"cwd": "${workspaceFolder}/UnoQuickStart.Wasm", | ||
"env": { | ||
} | ||
}, | ||
{ | ||
"name": ".NET Core Debug Uno Platform WebAssembly in Chrome", | ||
"type": "pwa-chrome", | ||
"request": "launch", | ||
"timeout": 30000, | ||
// If you have changed the default port / launch URL make sure to update the expectation below | ||
"url": "http://localhost:5000", | ||
"webRoot": "${workspaceFolder}/UnoQuickStart.Wasm", | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" | ||
} | ||
] | ||
} |
44 changes: 44 additions & 0 deletions
44
src/SolutionTemplate/Uno.ProjectTemplates.Dotnet/content/unoapp-prism/.vscode/tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/UnoQuickStart.Wasm/UnoQuickStart.Wasm.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/UnoQuickStart.Wasm/UnoQuickStart.Wasm.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"options": { "cwd": "${workspaceFolder}/UnoQuickStart.Wasm" }, | ||
"isBackground": true, | ||
"args": [ | ||
"watch", | ||
"run", | ||
"${workspaceFolder}/UnoQuickStart.Wasm/UnoQuickStart.Wasm.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to https://github.com/unoplatform/uno/blob/master/doc/articles/toc.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not yet added on purpose. Will add soon.