-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for Prism library
dotnet new
template
- Loading branch information
1 parent
ff5171b
commit 18cccbb
Showing
92 changed files
with
3,303 additions
and
4 deletions.
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" | ||
}, | ||
} | ||
} |
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.