Skip to content

Commit

Permalink
Merge pull request #274 from egvijayanand/working
Browse files Browse the repository at this point in the history
Templates updated for .NET MAUI 9
  • Loading branch information
egvijayanand authored Nov 19, 2024
2 parents 7796146 + 53c751a commit 7ee2493
Show file tree
Hide file tree
Showing 69 changed files with 477 additions and 1,142 deletions.
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Release Details:
|:---:|:---:|:---:|:---:|:---:|
|Stable|.NET 6 SR11 (6.0.553)|VS2022 17.4.x - 17.8.x|Tue, Apr 25, 2023|[Out of Support](https://dotnet.microsoft.com/en-us/platform/support/policy/maui ".NET MAUI Support Policy")|
|Stable|.NET 7 SR10 (7.0.101)|VS2022 17.4.x - 17.9.x|Tue, Nov 7, 2023|[Out of Support](https://dotnet.microsoft.com/en-us/platform/support/policy/maui ".NET MAUI Support Policy")|
|Stable|[.NET 8 SR9.3](https://github.com/dotnet/maui/releases/tag/8.0.93 "Changelog") (8.0.93) <br /> _Requires JDK 17 and Android SDK 34_ <br /> _Requires Apple Xcode 15.4 and Supports Apple Xcode 16_|VS2022 17.11.x|Thu, Nov 7, 2024|Active|
|Preview|[.NET 9 RC2](https://github.com/dotnet/maui/releases/tag/9.0.0-rc.2.24503.2 "Changelog") (9.0.0-rc.2.24503.2) <br /> _Requires JDK 17 and Android SDK 35_ <br /> _Requires Apple Xcode 15.4 and Supports Apple Xcode 16_|VS2022 17.12 Preview 4.0|Tue, Oct 8, 2024|Preview|
|Stable|[.NET 8 SR10](https://github.com/dotnet/maui/releases/tag/8.0.100 "Changelog") (8.0.100) <br /> _Requires JDK 17 and Android SDK 34_ <br /> _Requires Apple Xcode 15.4 and Supports Apple Xcode 16_|VS2022 17.12.x|Tue, Nov 12, 2024|Active|
|Stable|[.NET 9 SR1](https://github.com/dotnet/maui/releases/tag/9.0.10 "Changelog") (9.0.10) <br /> _Requires JDK 17 and Android SDK 35_ <br /> _Requires Apple Xcode 16_|VS2022 17.13 Preview 1.0|Thu, Nov 14, 2024|Active|

Version History and its dependencies are [here](https://aka.ms/maui/versions).

Expand Down Expand Up @@ -319,39 +319,31 @@ And from [v5.15.0](https://www.nuget.org/packages/VijayAnand.MauiTemplates/5.15.
dotnet new mauiapp -lang F#
```

For creating a .NET MAUI App on .NET 7:
For creating a .NET MAUI App on .NET 9:

```shell
dotnet new mauiapp -lang F# -f net7.0
dotnet new mauiapp -lang F#
```

* Framework: (Short notation: `-f`)

This can take `net6.0` / `net7.0` / `net8.0` / `net9.0` as its options (with `net8.0` being the default value, if not specified).
This can take `net8.0` / `net9.0` as its options (with `net9.0` being the default value, if not specified).

Examples:

```shell
dotnet new mauiapp -f net6.0
```

```shell
dotnet new mauiapp -f net7.0
```

For creating a .NET MAUI App on .NET 8:

Below command can be simplified to `dotnet new mauiapp` as default value of `framework` parameter is `net8.0`
_Explicit value for the `framework` parameter is required._

```shell
dotnet new mauiapp -f net8.0
```

For creating a .NET MAUI App on .NET 9:

Below command can be simplified to `dotnet new mauiapp` as default value of `framework` parameter is `net9.0`

_Explicit value for the `framework` parameter is required._

```shell
```shell
dotnet new mauiapp -f net9.0
```

Expand Down Expand Up @@ -402,7 +394,7 @@ And now conditional compilation can be configured so that platform source files
For existing projects, add the below block of code in the project file (.csproj). _This will modify the behavior of build process so due care must be taken if doing so._

```xml
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<ItemGroup Condition="'$(TargetFramework)' != 'net9.0'">
<Compile Remove="**\*.Standard.cs" />
<None Include="**\*.Standard.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
Expand Down Expand Up @@ -460,7 +452,6 @@ Can take any one of the following values, with default value set to `Plain`:
|Hybrid|App configured to work in a Hybrid fashion using BlazorWebView.|
|Markup|App configured to work with C# Markup syntax.|
|Razor|App configured to work with Razor syntax.|
|Comet|App configured to work with MVU pattern using Comet.|
|Reactor|App configured to work with MVU pattern using Reactor.|

* `-tp` | `--target-platform`
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sdk": {
"allowPrerelease": false,
"rollForward": "latestMinor",
"version": "8.0.100"
"version": "9.0.100"
}
}
7 changes: 6 additions & 1 deletion src/MauiTemplatesCLI/Create-Template.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ call Info ".NET SDK Version"

dotnet --version

if not exist .\bin\%config%\%packageName%.%packageVersion%.nupkg goto create

echo.
call Info "Deleting existing package ..."

if exist .\bin\%config%\%packageName%.%packageVersion%.nupkg del .\bin\%config%\%packageName%.%packageVersion%.nupkg
echo.
del .\bin\%config%\%packageName%.%packageVersion%.nupkg

:create

echo.
call Info "Creating %packageName% template ver. %packageVersion% NuGet package in %config% mode ..."
Expand Down
6 changes: 3 additions & 3 deletions src/MauiTemplatesCLI/MauiAppCS/.template.config/ide.host.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@
{
"id": "include-maps",
"name": {
"text": "Add and configure Microsoft.Maui.Controls.M_aps NuGet package reference (.NET 7 or later)"
"text": "Add and configure Microsoft.Maui.Controls.M_aps NuGet package reference"
},
"isVisible": true,
"defaultValue": "false"
},
{
"id": "include-media-element",
"name": {
"text": "Add and configure CommunityToolkit.Maui.Media_Element NuGet package reference (.NET 7 or later)"
"text": "Add and configure CommunityToolkit.Maui.Media_Element NuGet package reference"
},
"isVisible": true,
"defaultValue": "false"
},
{
"id": "include-foldable",
"name": {
"text": "Add and configure Microsoft.Maui.Controls.Fo_ldable NuGet package reference (.NET 7 or later)"
"text": "Add and configure Microsoft.Maui.Controls.Fo_ldable NuGet package reference"
},
"isVisible": true,
"defaultValue": "false"
Expand Down
94 changes: 19 additions & 75 deletions src/MauiTemplatesCLI/MauiAppCS/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@
"MauiApp.1.xml"
]
},
{
"condition": "(!Net8 && !CentralPkgMgmt)",
"exclude": [
"Directory.Packages.props"
]
},
{
"condition": "(Xaml || CSharp)",
"exclude": [
Expand Down Expand Up @@ -104,30 +98,6 @@
"MauiApp.1/_Imports.razor": "_Imports.razor"
}
},
{
"condition": "(Comet)",
"exclude": [
"*.xaml",
"*.xaml.cs",
"Controls/*.xaml",
"Controls/*.xaml.cs",
"Helpers/*.cs",
"Resources/*.cs",
"Resources/*.xaml",
"Views/*.xaml",
"Views/*.xaml.cs"
],
"rename": {
"App.markup.cs": "App.cs",
"Views/MainPage.markup.cs": "Views/MainPage.cs"
}
},
{
"condition": "(!Comet)",
"exclude": [
"**/Extensions/**"
]
},
{
"condition": "(Reactor)",
"exclude": [
Expand Down Expand Up @@ -520,7 +490,7 @@
}
},
{
"condition": "((Razor || Comet || Reactor) || !MauiLib)",
"condition": "((Razor || Reactor) || !MauiLib)",
"exclude": [
"MauiApp.1.MauiLib/**/*"
]
Expand Down Expand Up @@ -556,7 +526,7 @@
]
},
{
"condition": "(!(Net8 && Nightly))",
"condition": "(!Nightly)",
"exclude": [
"NuGet.config"
]
Expand All @@ -582,26 +552,16 @@
{
"choice": "net9.0",
"description": "Target .NET 9",
"displayName": ".NET 9 (Preview)"
"displayName": ".NET 9 (STS)"
},
{
"choice": "net8.0",
"description": "Target .NET 8",
"displayName": ".NET 8 (LTS)"
},
{
"choice": "net7.0",
"description": "Target .NET 7",
"displayName": ".NET 7 (STS)"
},
{
"choice": "net6.0",
"description": "Target .NET 6",
"displayName": ".NET 6 (LTS)"
}
],
"replaces": "MAUI_TFM",
"defaultValue": "net8.0"
"defaultValue": "net9.0"
},
"application-id": {
"type": "parameter",
Expand Down Expand Up @@ -643,10 +603,6 @@
"choice": "Razor",
"description": "App configured to work with Razor syntax."
},
{
"choice": "Comet",
"description": "App configured to work with MVU pattern using Comet."
},
{
"choice": "Reactor",
"description": "App configured to work with MVU pattern using Reactor."
Expand Down Expand Up @@ -790,21 +746,21 @@
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Option to add and configure Microsoft.Maui.Controls.Maps NuGet package reference (.NET 7 or later).",
"description": "Option to add and configure Microsoft.Maui.Controls.Maps NuGet package reference.",
"displayName": "Add and configure Microsoft.Maui.Controls.M_aps NuGet package reference"
},
"include-media-element": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Option to add and configure CommunityToolkit.Maui.MediaElement NuGet package reference (.NET 7 or later).",
"description": "Option to add and configure CommunityToolkit.Maui.MediaElement NuGet package reference.",
"displayName": "Add and configure CommunityToolkit.Maui.Media_Element NuGet package reference"
},
"include-foldable": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Option to add and configure Microsoft.Maui.Controls.Foldable NuGet package reference (.NET 7 or later).",
"description": "Option to add and configure Microsoft.Maui.Controls.Foldable NuGet package reference.",
"displayName": "Add and configure Microsoft.Maui.Controls.Fo_ldable NuGet package reference"
},
"include-shared-toolkit": {
Expand Down Expand Up @@ -914,10 +870,6 @@
"type": "computed",
"value": "(design-pattern == \"Razor\" || designPatternLower == \"razor\")"
},
"Comet": {
"type": "computed",
"value": "(design-pattern == \"Comet\" || designPatternLower == \"comet\")"
},
"Reactor": {
"type": "computed",
"value": "(design-pattern == \"Reactor\" || designPatternLower == \"reactor\")"
Expand All @@ -944,15 +896,11 @@
},
"Mvu": {
"type": "computed",
"value": "(Comet || Reactor)"
"value": "(Reactor)"
},
"Auxiliary": {
"type": "computed",
"value": "(Razor || Comet || Reactor)"
},
"Net7": {
"type": "computed",
"value": "(frameworkLower == \"net7.0\")"
"value": "(Razor || Reactor)"
},
"Net8": {
"type": "computed",
Expand All @@ -962,17 +910,13 @@
"type": "computed",
"value": "(frameworkLower == \"net9.0\")"
},
"Net7OrEarlier": {
"type": "computed",
"value": "(frameworkLower == \"net6.0\" || frameworkLower == \"net7.0\")"
},
"Net7OrLater": {
"Net8OrLater": {
"type": "computed",
"value": "(frameworkLower == \"net7.0\" || frameworkLower == \"net8.0\" || frameworkLower == \"net9.0\")"
"value": "(Net8 || Net9)"
},
"Net8OrLater": {
"Net9OrLater": {
"type": "computed",
"value": "(frameworkLower == \"net8.0\" || frameworkLower == \"net9.0\")"
"value": "(Net9)"
},
"AllPlatforms": {
"type": "computed",
Expand Down Expand Up @@ -1016,27 +960,27 @@
},
"AddCamera": {
"type": "computed",
"value": "(Net8OrLater && include-camera)"
"value": "(include-camera)"
},
"AddMaps": {
"type": "computed",
"value": "(Net7OrLater && include-maps)"
"value": "(include-maps)"
},
"AddMedia": {
"type": "computed",
"value": "(Net7OrLater && include-media-element)"
"value": "(include-media-element)"
},
"AddFoldable": {
"type": "computed",
"value": "(Net7OrLater && include-foldable)"
"value": "(include-foldable)"
},
"AddToolkit": {
"type": "computed",
"value": "(include-toolkit)"
},
"AddSyncfusionToolkit": {
"type": "computed",
"value": "(Net8OrLater && include-syncfusion-toolkit)"
"value": "(include-syncfusion-toolkit)"
},
"AddMarkup": {
"type": "computed",
Expand Down Expand Up @@ -1068,7 +1012,7 @@
},
"PackageRef": {
"type": "computed",
"value": "(AddToolkit || AddMarkup || AddMvvmToolkit || Net7OrLater || Razor || Mvu || CompiledBindings)"
"value": "(AddToolkit || AddMarkup || AddMvvmToolkit || Net8OrLater || Razor || Mvu || CompiledBindings)"
},
"UseSlnx": {
"type": "computed",
Expand Down
Loading

0 comments on commit 7ee2493

Please sign in to comment.