forked from xamarin/xamarin-macios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.NET 6 templates for iOS, macOS, tvOS, & MacCatalyst
Context: https://docs.microsoft.com/dotnet/core/tutorials/cli-templates-create-template-pack Context: https:/dotnet/templating/wiki Context: dotnet/designs#120 Fixes: xamarin#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 -------------------------------------------- -------------- ---------- ---------------------- MacCatalyst Application maccatalyst [C#] MacCatalyst iOS Controller template ios-controller [C#] iOS iOS Application ios [C#] iOS iOS Class library ioslib [C#] iOS macOS Application macos [C#] macOS 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 <[email protected]>
- Loading branch information
1 parent
effe7dc
commit acbc7c7
Showing
108 changed files
with
2,608 additions
and
7 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
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
34 changes: 34 additions & 0 deletions
34
dotnet/Microsoft.MacCatalyst.Templates/maccatalyst/.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,34 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "Microsoft", | ||
"classifications": [ "MacCatalyst" ], | ||
"identity": "Microsoft.MacCatalyst.MacCatalystApp", | ||
"name": "MacCatalyst Application", | ||
"description": "A project for creating an MacCatalyst application", | ||
"shortName": "maccatalyst", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "MacCatalystApp1", | ||
"preferNameDirectory": true, | ||
"primaryOutputs": [ | ||
{ "path": "MacCatalystApp1.csproj" } | ||
], | ||
"symbols": { | ||
"bundleId": { | ||
"type": "parameter", | ||
"description": "Overrides CFBundleIdentifier in the Info.plist", | ||
"datatype": "string", | ||
"replaces": "com.companyname.MacCatalystApp1" | ||
}, | ||
"minOSVersion": { | ||
"type": "parameter", | ||
"description": "Overrides LSMinimumSystemVersion in the Info.plist", | ||
"replaces": "minOSVersion", | ||
"datatype": "string", | ||
"defaultValue": "10.15.1" | ||
} | ||
}, | ||
"defaultName": "MacCatalystApp1" | ||
} |
36 changes: 36 additions & 0 deletions
36
dotnet/Microsoft.MacCatalyst.Templates/maccatalyst/AppDelegate.cs
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,36 @@ | ||
using Foundation; | ||
using UIKit; | ||
|
||
namespace MacCatalystApp1 | ||
{ | ||
[Register("AppDelegate")] | ||
public class AppDelegate : UIApplicationDelegate | ||
{ | ||
public override UIWindow Window | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) | ||
{ | ||
// create a new window instance based on the screen size | ||
Window = new UIWindow(UIScreen.MainScreen.Bounds); | ||
|
||
// create a UIViewController with a single UILabel | ||
var vc = new UIViewController (); | ||
vc.View.AddSubview (new UILabel (Window.Frame) | ||
{ | ||
BackgroundColor = UIColor.White, | ||
TextAlignment = UITextAlignment.Center, | ||
Text = "Hello, Catalyst!" | ||
}); | ||
Window.RootViewController = vc; | ||
|
||
// make the window visible | ||
Window.MakeKeyAndVisible(); | ||
|
||
return true; | ||
} | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
...rosoft.MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Contents.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,117 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"scale": "2x", | ||
"size": "20x20", | ||
"idiom": "iphone", | ||
"filename": "Icon40.png" | ||
}, | ||
{ | ||
"scale": "3x", | ||
"size": "20x20", | ||
"idiom": "iphone", | ||
"filename": "Icon60.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "29x29", | ||
"idiom": "iphone", | ||
"filename": "Icon58.png" | ||
}, | ||
{ | ||
"scale": "3x", | ||
"size": "29x29", | ||
"idiom": "iphone", | ||
"filename": "Icon87.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "40x40", | ||
"idiom": "iphone", | ||
"filename": "Icon80.png" | ||
}, | ||
{ | ||
"scale": "3x", | ||
"size": "40x40", | ||
"idiom": "iphone", | ||
"filename": "Icon120.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "60x60", | ||
"idiom": "iphone", | ||
"filename": "Icon120.png" | ||
}, | ||
{ | ||
"scale": "3x", | ||
"size": "60x60", | ||
"idiom": "iphone", | ||
"filename": "Icon180.png" | ||
}, | ||
{ | ||
"scale": "1x", | ||
"size": "20x20", | ||
"idiom": "ipad", | ||
"filename": "Icon20.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "20x20", | ||
"idiom": "ipad", | ||
"filename": "Icon40.png" | ||
}, | ||
{ | ||
"scale": "1x", | ||
"size": "29x29", | ||
"idiom": "ipad", | ||
"filename": "Icon29.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "29x29", | ||
"idiom": "ipad", | ||
"filename": "Icon58.png" | ||
}, | ||
{ | ||
"scale": "1x", | ||
"size": "40x40", | ||
"idiom": "ipad", | ||
"filename": "Icon40.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "40x40", | ||
"idiom": "ipad", | ||
"filename": "Icon80.png" | ||
}, | ||
{ | ||
"scale": "1x", | ||
"size": "76x76", | ||
"idiom": "ipad", | ||
"filename": "Icon76.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "76x76", | ||
"idiom": "ipad", | ||
"filename": "Icon152.png" | ||
}, | ||
{ | ||
"scale": "2x", | ||
"size": "83.5x83.5", | ||
"idiom": "ipad", | ||
"filename": "Icon167.png" | ||
}, | ||
{ | ||
"scale": "1x", | ||
"size": "1024x1024", | ||
"idiom": "ios-marketing", | ||
"filename": "Icon1024.png" | ||
} | ||
], | ||
"properties": {}, | ||
"info": { | ||
"version": 1, | ||
"author": "xcode" | ||
} | ||
} |
Binary file added
BIN
+68.8 KB
...cCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.68 KB
...acCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.64 KB
...acCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.58 KB
...acCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.07 KB
...acCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.28 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+845 Bytes
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.08 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.72 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon58.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.48 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.28 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.4 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.69 KB
...MacCatalyst.Templates/maccatalyst/Assets.xcassets/AppIcon.appiconset/Icon87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
dotnet/Microsoft.MacCatalyst.Templates/maccatalyst/Entitlements.plist
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
</dict> | ||
</plist> |
30 changes: 30 additions & 0 deletions
30
dotnet/Microsoft.MacCatalyst.Templates/maccatalyst/Info.plist
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,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDisplayName</key> | ||
<string>MacCatalystApp1</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.companyname.MacCatalystApp1</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>minOSVersion</string> | ||
<key>UIDeviceFamily</key> | ||
<array> | ||
<integer>2</integer> | ||
</array> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>XSAppIconAssets</key> | ||
<string>Assets.xcassets/AppIcon.appiconset</string> | ||
</dict> | ||
</plist> |
26 changes: 26 additions & 0 deletions
26
dotnet/Microsoft.MacCatalyst.Templates/maccatalyst/LaunchScreen.storyboard
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="222" launchScreen="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<scene sceneID="221"> | ||
<objects> | ||
<viewController id="222" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="219"/> | ||
<viewControllerLayoutGuide type="bottom" id="220"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="223"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="224" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="-200" y="-388"/> | ||
</scene> | ||
</scenes> | ||
</document> |
Oops, something went wrong.