.NET 6 templates for iOS, macOS, tvOS, & MacCatalyst#10741
.NET 6 templates for iOS, macOS, tvOS, & MacCatalyst#10741jonathanpeppers merged 1 commit intodotnet:mainfrom
Conversation
| public class Application | ||
| { | ||
| // This is the main entry point of the application. | ||
| static void Main(string[] args) |
There was a problem hiding this comment.
Do template code need to use a specific coding style? Or will they be reformatted according to the user's settings when they're instantiated?
There was a problem hiding this comment.
There is a dotnet format tool: https://www.hanselman.com/blog/editorconfig-code-formatting-from-the-command-line-with-net-cores-dotnet-format-global-tool
I tested this, I copied the .editorconfig from xamarin-android, then did:
% dotnet new ios
% dotnet format
When I saw other templates, they all use VS Windows coding style -- but I guess it could really be any style? I think dotnet format would fix up anything.
There was a problem hiding this comment.
That tools looks pretty amazing!
Its mere existence makes me vote towards having the templates use our own coding style (in which case the coding style is wrong in some of the new files - I guess you could run dotnet format locally in the template directory and that'll fix it 😄 )
spouliot
left a comment
There was a problem hiding this comment.
How does it compare with what we ship today ? https://github.com/xamarin/xamarin-templates
This should not fix (close) the dotnet issue until the work is completed (or we risk losing track of the task)
| public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) | ||
| { | ||
| // create a new window instance based on the screen size | ||
| Window = new UIWindow(UIScreen.MainScreen.Bounds); |
There was a problem hiding this comment.
source code format is inconsistent, e.g. space before (
There was a problem hiding this comment.
Should I dotnet format every template to use default VS settings?
Or should I dotnet format using the .editorconfig in xamarin-macios?
There was a problem hiding this comment.
as much as I'd like to use our (mono) style it's likely best to follow VS[4m] style used for other templates
@spouliot I got these files from here ^^ I should have put that in the commit message. I didn't change anything (intentionally) other than port them to .NET 6. For the Mac template I created a new project in latest VS Mac -- I didn't find a Mac template in xamarin-templates. |
Context: https://docs.microsoft.com/dotnet/core/tutorials/cli-templates-create-template-pack Context: https://github.com/dotnet/templating/wiki Context: dotnet/designs#120 Fixes: dotnet#10252 To implement templates in a .NET workload: 1. Make `.nupkg` files that follow the structure of the `dotnet new` templating system, using `$(PackageType)` of `Template`. 2. Install the `.nupkg` files in in `dotnet/template-packs/` 3. Update `WorkloadManifest.json`, to be part of the workload: "Microsoft.@platform@.Templates": { "kind": "template", "version": "@Version@" } These are a starting point, for what I would consider the minimum for the xamarin-macios repo to provide for now: Template Name Short Name Language Tags -------------------------------------------- -------------- ---------- ---------------------- iOS Controller template ios-controller [C#] iOS iOS Application ios [C#] iOS iOS Class library ioslib [C#] iOS macOS Application macos [C#] macOS MacCatalyst Application maccatalyst [C#] macOS/Catalyst tvOS Application tvos [C#] tvOS We will probably need PM input on what the final templates will be. To use these, you might do: $ mkdir MyApp && cd MyApp $ dotnet new ios $ dotnet new ios-controller --name LoginController --namespace MyApp Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
acbc7c7 to
4614f6c
Compare
|
Latest changes:
Template Name Short Name Language Tags
-------------------------------------------- -------------- ---------- ----------------------
iOS Controller template ios-controller [C#] iOS
iOS Application ios [C#] iOS
iOS Class library ioslib [C#] iOS
macOS Application macos [C#] macOS
MacCatalyst Application maccatalyst [C#] macOS/Catalyst
tvOS Application tvos [C#] tvOS |
Context: https://docs.microsoft.com/dotnet/core/tutorials/cli-templates-create-template-pack
Context: https://github.com/dotnet/templating/wiki
Context: dotnet/designs#120
Fixes: #10252
To implement templates in a .NET workload:
.nupkgfiles that follow the structure of thedotnet newtemplating system, using
$(PackageType)ofTemplate..nupkgfiles in indotnet/template-packs/WorkloadManifest.json, to be part of the workload:These are a starting point, for what I would consider the minimum for
the xamarin-macios repo to provide for now:
We will probably need PM input on what the final templates will be.
To use these, you might do: