-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6c9997
commit 4402b94
Showing
122 changed files
with
1,996 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Templates/src/templates/maui-multihead/.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": { | ||
"Framework": { | ||
"longName": "framework" | ||
}, | ||
"android": { | ||
"shortName": "" | ||
}, | ||
"ios": { | ||
"shortName": "" | ||
}, | ||
"maccatalyst": { | ||
"longName": "macos", | ||
"shortName": "" | ||
}, | ||
"winui": { | ||
"longName": "windows", | ||
"shortName": "" | ||
} | ||
}, | ||
"usageExamples": [ | ||
"--framework DOTNET_TFM_VALUE --android --ios" | ||
] | ||
} |
44 changes: 44 additions & 0 deletions
44
src/Templates/src/templates/maui-multihead/.template.config/ide.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,44 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/ide.host", | ||
"icon": "ide/icon.ico", | ||
"unsupportedHosts": [ | ||
{ | ||
"id": "vs", | ||
"version": "(,17.3)" | ||
} | ||
], | ||
"requiredComponents": [ | ||
{ | ||
"id": "Microsoft.VisualStudio.ComponentGroup.Maui.All", | ||
"hostId": "vs", | ||
"componentType": "SetupComponent" | ||
} | ||
], | ||
"symbolInfo": [ | ||
{ | ||
"id": "Framework", | ||
"persistenceScope": "shared", | ||
"persistenceScopeName": "maui" | ||
}, | ||
{ | ||
"id": "android", | ||
"isVisible": true, | ||
"defaultValue": "true" | ||
}, | ||
{ | ||
"id": "ios", | ||
"isVisible": true, | ||
"defaultValue": "true" | ||
}, | ||
{ | ||
"id": "maccatalyst", | ||
"isVisible": true, | ||
"defaultValue": "true" | ||
}, | ||
{ | ||
"id": "winui", | ||
"isVisible": true, | ||
"defaultValue": "true" | ||
} | ||
] | ||
} |
Binary file added
BIN
+36 KB
src/Templates/src/templates/maui-multihead/.template.config/ide/icon.ico
Binary file not shown.
195 changes: 195 additions & 0 deletions
195
src/Templates/src/templates/maui-multihead/.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,195 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "Microsoft", | ||
"classifications": [ "MAUI", "Android", "iOS", "macOS", "Mac Catalyst", "Windows", "Tizen", "Mobile" ], | ||
"identity": "Microsoft.Maui.MultiProjectApp.CSharp.DOTNET_TFM_VERSION_VALUE", | ||
"groupIdentity": "Microsoft.Maui.MultiProjectApp", | ||
"precedence": "DOTNET_TFM_VERSION_MAJOR_VALUE", | ||
"name": ".NET MAUI Multi-Project App", | ||
"description": "A project for creating a .NET MAUI application for iOS, Android, Mac Catalyst, WinUI and Tizen with multiple, separate app projects.", | ||
"shortName": "maui-multiproject", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "MauiApp.1", | ||
"primaryOutputs": [ | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"path": "MauiApp.1/MainPage.xaml.cs" | ||
}, | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"path": "MauiApp.1/MainPage.xaml" | ||
} | ||
], | ||
"postActions": [ | ||
{ | ||
"id": "openInEditor", | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\" && HostIdentifier != \"vs\")", | ||
"description": "Opens MainPage.xaml in the editor.", | ||
"manualInstructions": [], | ||
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", | ||
"args": { | ||
"files": "0;1" | ||
}, | ||
"continueOnError": true | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"source": "./", | ||
"target": "./", | ||
"copyOnly": [ "**/*.svg", "**/*.ttf" ], | ||
"modifiers": [ | ||
{ | ||
"condition": "(!android && !AllPlatforms)", | ||
"exclude": [ | ||
"MauiApp.1.Droid/**/*" | ||
] | ||
}, | ||
{ | ||
"condition": "(!ios && !AllPlatforms)", | ||
"exclude": [ | ||
"MauiApp.1.iOS/**/*" | ||
] | ||
}, | ||
{ | ||
"condition": "(!maccatalyst && !AllPlatforms)", | ||
"exclude": [ | ||
"MauiApp.1.Mac/**/*" | ||
] | ||
}, | ||
{ | ||
"condition": "(!winui && !AllPlatforms)", | ||
"exclude": [ | ||
"MauiApp.1.WinUI/**/*" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"preferNameDirectory": true, | ||
"guids": [ | ||
"87919f9c-abb8-48e5-bae7-eb1b4140f6a8" | ||
], | ||
"symbols": { | ||
"applicationId": { | ||
"type": "parameter", | ||
"description": "Overrides the $(ApplicationId) in the project", | ||
"datatype": "string" | ||
}, | ||
"msExtensionsLoggingDebugVersion": { | ||
"type": "parameter", | ||
"dataType": "string", | ||
"replaces": "MS_EXT_LOG_DEBUG_VERSION", | ||
"defaultValue": "MS_EXT_LOG_DEBUG_VERSION_VALUE" | ||
}, | ||
"Framework": { | ||
"type": "parameter", | ||
"description": "The target framework for the project.", | ||
"datatype": "choice", | ||
"choices": [ | ||
{ | ||
"choice": "DOTNET_TFM_VALUE", | ||
"description": "Target DOTNET_TFM_VALUE" | ||
} | ||
], | ||
"replaces": "DOTNET_TFM", | ||
"defaultValue": "DOTNET_TFM_VALUE" | ||
}, | ||
"android": { | ||
"type": "parameter", | ||
"datatype": "bool", | ||
"defaultValue": "false", | ||
"defaultIfOptionWithoutValue": "true", | ||
"displayName": "Android", | ||
"description": "Include the Android app head project" | ||
}, | ||
"ios": { | ||
"type": "parameter", | ||
"datatype": "bool", | ||
"defaultValue": "false", | ||
"defaultIfOptionWithoutValue": "true", | ||
"displayName": "iOS", | ||
"description": "Include the iOS app head project" | ||
}, | ||
"maccatalyst": { | ||
"type": "parameter", | ||
"datatype": "bool", | ||
"defaultValue": "false", | ||
"defaultIfOptionWithoutValue": "true", | ||
"displayName": "macOS using Mac Catalyst", | ||
"description": "Include the macOS app head project (using Mac Catalyst)" | ||
}, | ||
"winui": { | ||
"type": "parameter", | ||
"datatype": "bool", | ||
"defaultValue": "false", | ||
"defaultIfOptionWithoutValue": "true", | ||
"displayName": "Windows using WinUI 3", | ||
"description": "Include the Windows app head project (using WinUI 3)" | ||
}, | ||
"AllPlatforms": { | ||
"type": "computed", | ||
"value": "(!android && !ios && !maccatalyst && !winui)" | ||
}, | ||
"HostIdentifier": { | ||
"type": "bind", | ||
"binding": "HostIdentifier" | ||
}, | ||
"PhoneProductId": { | ||
"type": "generated", | ||
"generator": "guid", | ||
"replaces": "$guid9$" | ||
}, | ||
"nameToLower":{ | ||
"type": "generated", | ||
"generator": "casing", | ||
"parameters": { | ||
"source" : "name", | ||
"toLower": true | ||
} | ||
}, | ||
"nameToAppId": { | ||
"type": "generated", | ||
"generator": "regex", | ||
"dataType": "string", | ||
"parameters": { | ||
"source": "nameToLower", | ||
"steps": [ | ||
{ | ||
"regex": "[^a-z0-9_\\.]", | ||
"replacement": "" | ||
} | ||
] | ||
} | ||
}, | ||
"defaultAppId":{ | ||
"type": "generated", | ||
"generator": "join", | ||
"parameters": { | ||
"symbols": [ | ||
{ | ||
"type": "const", | ||
"value": "com.companyname." | ||
}, | ||
{ | ||
"type": "ref", | ||
"value": "nameToAppId" | ||
} | ||
] | ||
} | ||
}, | ||
"finalAppId":{ | ||
"type":"generated", | ||
"generator": "coalesce", | ||
"parameters": { | ||
"sourceVariableName": "applicationId", | ||
"fallbackVariableName": "defaultAppId" | ||
}, | ||
"replaces": "com.companyname.mauiapp" | ||
} | ||
}, | ||
"defaultName": "MauiApp1" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/AndroidManifest.xml
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"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.mauiapp" android:versionCode="1" android:versionName="1.0"> | ||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:label="@string/app_name" android:supportsRtl="true"></application> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
</manifest> |
19 changes: 19 additions & 0 deletions
19
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/Assets/AboutAndroidAssets.txt
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,19 @@ | ||
Any raw assets you want to be deployed with your application can be placed in | ||
this directory (and child directories) and given a Build Action of "AndroidAsset". | ||
|
||
These files will be deployed with your package and will be accessible using Android's | ||
AssetManager, like this: | ||
|
||
public class ReadAsset : Activity | ||
{ | ||
protected override void OnCreate (Bundle bundle) | ||
{ | ||
base.OnCreate (bundle); | ||
|
||
InputStream input = Assets.Open ("my_asset.txt"); | ||
} | ||
} | ||
|
||
Additionally, some Android functions will automatically load asset files: | ||
|
||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
10 changes: 10 additions & 0 deletions
10
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/MainActivity.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,10 @@ | ||
using Android.App; | ||
using Android.Content.PM; | ||
using Android.OS; | ||
|
||
namespace MauiApp._1.Droid; | ||
|
||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] | ||
public class MainActivity : MauiAppCompatActivity | ||
{ | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/MainApplication.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,15 @@ | ||
using Android.App; | ||
using Android.Runtime; | ||
|
||
namespace MauiApp._1.Droid; | ||
|
||
[Application] | ||
public class MainApplication : MauiApplication | ||
{ | ||
public MainApplication(IntPtr handle, JniHandleOwnership ownership) | ||
: base(handle, ownership) | ||
{ | ||
} | ||
|
||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/MauiMultiHeadApp.Droid.csproj
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,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0-android</TargetFramework> | ||
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion> | ||
<OutputType>Exe</OutputType> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UseMaui>true</UseMaui> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" /> | ||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="MS_EXT_LOG_DEBUG_VERSION" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\MauiApp.1\MauiApp.1.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
14 changes: 14 additions & 0 deletions
14
src/Templates/src/templates/maui-multihead/MauiApp.1.Droid/MauiProgram.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,14 @@ | ||
namespace MauiApp._1.Droid; | ||
|
||
public static class MauiProgram | ||
{ | ||
public static MauiApp CreateMauiApp() | ||
{ | ||
var builder = MauiApp.CreateBuilder(); | ||
|
||
builder | ||
.UseSharedMauiApp(); | ||
|
||
return builder.Build(); | ||
} | ||
} |
Oops, something went wrong.