From 6773ab41b97d83d318dc4dfaee7ec53a6a39e976 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 9 Jun 2022 18:27:26 +0800 Subject: [PATCH] Add MAUI template --- templates/maui/.gitattributes | 1 + templates/maui/.gitignore | 255 ++++++++++++ .../maui/MyCompanyName.MyProjectName.sln | 32 ++ templates/maui/common.props | 7 + .../src/MyCompanyName.MyProjectName/App.xaml | 14 + .../MyCompanyName.MyProjectName/App.xaml.cs | 11 + .../MyCompanyName.MyProjectName/AppShell.xaml | 14 + .../AppShell.xaml.cs | 9 + .../HelloWorldService.cs | 11 + .../MyCompanyName.MyProjectName/MainPage.xaml | 40 ++ .../MainPage.xaml.cs | 35 ++ .../MauiProgram.cs | 33 ++ .../MyCompanyName.MyProjectName.csproj | 56 +++ .../MyProjectNameModule.cs | 13 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.cs | 10 + .../Platforms/Android/MainApplication.cs | 15 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 9 + .../Platforms/MacCatalyst/Info.plist | 30 ++ .../Platforms/MacCatalyst/Program.cs | 15 + .../Platforms/Tizen/Main.cs | 16 + .../Platforms/Tizen/tizen-manifest.xml | 15 + .../Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.cs | 24 ++ .../Platforms/Windows/Package.appxmanifest | 43 ++ .../Platforms/Windows/app.manifest | 15 + .../Platforms/iOS/AppDelegate.cs | 9 + .../Platforms/iOS/Info.plist | 32 ++ .../Platforms/iOS/Program.cs | 15 + .../Properties/launchSettings.json | 8 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107140 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111024 bytes .../Resources/Images/dotnet_bot.svg | 93 +++++ .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 44 ++ .../Resources/Styles/Styles.xaml | 384 ++++++++++++++++++ .../appsettings.json | 3 + 41 files changed, 1366 insertions(+) create mode 100644 templates/maui/.gitattributes create mode 100644 templates/maui/.gitignore create mode 100644 templates/maui/MyCompanyName.MyProjectName.sln create mode 100644 templates/maui/common.props create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/App.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/App.xaml.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/HelloWorldService.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/MainPage.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/MainPage.xaml.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/MauiProgram.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/MyProjectNameModule.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Android/AndroidManifest.xml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Android/MainActivity.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Android/MainApplication.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Android/Resources/values/colors.xml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/MacCatalyst/Info.plist create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/MacCatalyst/Program.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Tizen/Main.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Tizen/tizen-manifest.xml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Windows/App.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Windows/App.xaml.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Windows/Package.appxmanifest create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/Windows/app.manifest create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/iOS/AppDelegate.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/iOS/Info.plist create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Platforms/iOS/Program.cs create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Properties/launchSettings.json create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/AppIcon/appicon.svg create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/AppIcon/appiconfg.svg create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Images/dotnet_bot.svg create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Raw/AboutAssets.txt create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Splash/splash.svg create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Styles/Colors.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/Resources/Styles/Styles.xaml create mode 100644 templates/maui/src/MyCompanyName.MyProjectName/appsettings.json diff --git a/templates/maui/.gitattributes b/templates/maui/.gitattributes new file mode 100644 index 0000000000..c941e52669 --- /dev/null +++ b/templates/maui/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/templates/maui/.gitignore b/templates/maui/.gitignore new file mode 100644 index 0000000000..95d81cb113 --- /dev/null +++ b/templates/maui/.gitignore @@ -0,0 +1,255 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# MyProjectName +src/MyCompanyName.MyProjectName.ConsoleApp/Logs/logs.txt diff --git a/templates/maui/MyCompanyName.MyProjectName.sln b/templates/maui/MyCompanyName.MyProjectName.sln new file mode 100644 index 0000000000..bf634844e7 --- /dev/null +++ b/templates/maui/MyCompanyName.MyProjectName.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName", "src\MyCompanyName.MyProjectName\MyCompanyName.MyProjectName.csproj", "{B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{88D70326-FD7B-4F90-8CDE-D99B7819AF7E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Release|Any CPU.Build.0 = Release|Any CPU + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B22CB1A1-A9D3-4970-9F00-50307BCCCAB7} = {88D70326-FD7B-4F90-8CDE-D99B7819AF7E} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/templates/maui/common.props b/templates/maui/common.props new file mode 100644 index 0000000000..7e29afcfb8 --- /dev/null +++ b/templates/maui/common.props @@ -0,0 +1,7 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591;CS0436 + + \ No newline at end of file diff --git a/templates/maui/src/MyCompanyName.MyProjectName/App.xaml b/templates/maui/src/MyCompanyName.MyProjectName/App.xaml new file mode 100644 index 0000000000..00e2f461db --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/templates/maui/src/MyCompanyName.MyProjectName/App.xaml.cs b/templates/maui/src/MyCompanyName.MyProjectName/App.xaml.cs new file mode 100644 index 0000000000..0a02c4e624 --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/App.xaml.cs @@ -0,0 +1,11 @@ +namespace MyCompanyName.MyProjectName; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml b/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml new file mode 100644 index 0000000000..7d34cba9c9 --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml.cs b/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml.cs new file mode 100644 index 0000000000..b35d0a3c9b --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace MyCompanyName.MyProjectName; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/templates/maui/src/MyCompanyName.MyProjectName/HelloWorldService.cs b/templates/maui/src/MyCompanyName.MyProjectName/HelloWorldService.cs new file mode 100644 index 0000000000..57a6884ea3 --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/HelloWorldService.cs @@ -0,0 +1,11 @@ +using Volo.Abp.DependencyInjection; + +namespace MyCompanyName.MyProjectName; + +public class HelloWorldService : ITransientDependency +{ + public string SayHello() + { + return "Hello, World!"; + } +} \ No newline at end of file diff --git a/templates/maui/src/MyCompanyName.MyProjectName/MainPage.xaml b/templates/maui/src/MyCompanyName.MyProjectName/MainPage.xaml new file mode 100644 index 0000000000..7e0243db86 --- /dev/null +++ b/templates/maui/src/MyCompanyName.MyProjectName/MainPage.xaml @@ -0,0 +1,40 @@ + + + + + + + + +