Skip to content

Commit 330821b

Browse files
committed
Merge branch 'net10.0' into feature/2025-05-04-Convert-nullability-3-n-NET10
2 parents 14e7ef4 + 3f53074 commit 330821b

61 files changed

Lines changed: 2617 additions & 435 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,16 @@
147147
<!-- version number information -->
148148
<PropertyGroup>
149149
<!-- Default versions from the SDKs (update when there is a new TFM version) -->
150-
<IosTargetFrameworkVersionSdkDefault>18.2</IosTargetFrameworkVersionSdkDefault>
151-
<TvosTargetFrameworkVersionSdkDefault>18.2</TvosTargetFrameworkVersionSdkDefault>
152-
<MacCatalystTargetFrameworkVersionSdkDefault>18.2</MacCatalystTargetFrameworkVersionSdkDefault>
153-
<MacosTargetFrameworkVersionSdkDefault>15.2</MacosTargetFrameworkVersionSdkDefault>
150+
<IosTargetFrameworkVersionSdkDefault>18.4</IosTargetFrameworkVersionSdkDefault>
151+
<TvosTargetFrameworkVersionSdkDefault>18.4</TvosTargetFrameworkVersionSdkDefault>
152+
<MacCatalystTargetFrameworkVersionSdkDefault>18.4</MacCatalystTargetFrameworkVersionSdkDefault>
153+
<MacosTargetFrameworkVersionSdkDefault>15.4</MacosTargetFrameworkVersionSdkDefault>
154154
<AndroidTargetFrameworkVersionSdkDefault>36.0</AndroidTargetFrameworkVersionSdkDefault>
155155
<!-- Current .NET -->
156-
<IosTargetFrameworkVersion>18.2</IosTargetFrameworkVersion>
157-
<TvosTargetFrameworkVersion>18.2</TvosTargetFrameworkVersion>
158-
<MacCatalystTargetFrameworkVersion>18.2</MacCatalystTargetFrameworkVersion>
159-
<MacosTargetFrameworkVersion>15.2</MacosTargetFrameworkVersion>
156+
<IosTargetFrameworkVersion>18.4</IosTargetFrameworkVersion>
157+
<TvosTargetFrameworkVersion>18.4</TvosTargetFrameworkVersion>
158+
<MacCatalystTargetFrameworkVersion>18.4</MacCatalystTargetFrameworkVersion>
159+
<MacosTargetFrameworkVersion>15.4</MacosTargetFrameworkVersion>
160160
<AndroidTargetFrameworkVersion>36.0</AndroidTargetFrameworkVersion>
161161
<WindowsTargetFrameworkVersion>10.0.19041.0</WindowsTargetFrameworkVersion>
162162
<Windows2TargetFrameworkVersion>10.0.20348.0</Windows2TargetFrameworkVersion>

NuGet.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<add key="darc-pub-dotnet-maui-a33a875e" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-maui-a33a875e/nuget/v3/index.json" />
2828
<!-- Added manually for dotnet/runtime 8.0.16 -->
2929
<add key="darc-pub-dotnet-runtime-6cd8ef8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-6cd8ef87/nuget/v3/index.json" />
30-
<!-- Added manually for 9.0.5 -->
31-
<add key="darc-pub-dotnet-runtime-38d99eb2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-38d99eb2/nuget/v3/index.json" />
30+
<!-- Added manually for dotnet/runtime 9.0.5 -->
31+
<add key="darc-pub-dotnet-runtime-207cda3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-207cda34/nuget/v3/index.json" />
3232
<!-- Added manually for .NET 9 Android -->
3333
<add key="darc-pub-dotnet-android-1719a35" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-android-1719a35b/nuget/v3/index.json" />
3434
<!-- Added manually for .NET 8 Android -->

build.cake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ PowerShell:
2929
//////////////////////////////////////////////////////////////////////
3030
#tool "nuget:?package=nuget.commandline&version=6.6.1"
3131

32+
3233
//////////////////////////////////////////////////////////////////////
3334
// ARGUMENTS
3435
//////////////////////////////////////////////////////////////////////

docs/CgManifest.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Component Governance Manifest (cgmanifest.json)
2+
3+
This document explains how to manage, update, and include the `cgmanifest.json` file in the MAUI project.
4+
5+
## What is cgmanifest.json?
6+
7+
The Component Governance Manifest (`cgmanifest.json`) is a file that lists all the third-party components used in the project. It helps with tracking dependencies and their versions for security and compliance purposes.
8+
9+
## Automatic Generation
10+
11+
The project includes scripts to automatically generate and update the `cgmanifest.json` file with package versions from the `Versions.props` file.
12+
13+
### Using Cake Build Script
14+
15+
Run the `GenerateCgManifest` task:
16+
17+
```bash
18+
dotnet tool resotre
19+
dotnet cake --target=GenerateCgManifest --workloads=global
20+
```
21+
22+
### Using Scripts Directly
23+
24+
You can also run the PowerShell script directly (works on both Windows and macOS/Linux):
25+
26+
```bash
27+
# On all platforms (Windows/macOS/Linux)
28+
pwsh -ExecutionPolicy Bypass -File ./eng/scripts/update-cgmanifest.ps1
29+
```
30+
31+
### MSBuild Integration
32+
33+
The `CgManifest.targets` file provides MSBuild integration.
34+
35+
#### Default Behavior
36+
37+
By default, the cgmanifest.json file is **always generated** during build, but it is **not included** in the NuGet package. This ensures the manifest is always up-to-date without affecting package contents.
38+
39+
#### Manual Generation
40+
41+
You can explicitly generate the manifest file:
42+
43+
```bash
44+
dotnet build -t:GenerateCgManifest
45+
```
46+
47+
#### Disabling Generation
48+
49+
If needed, you can temporarily disable the automatic generation:
50+
51+
```bash
52+
dotnet build -p:UpdateCgManifestBeforeBuild=false
53+
```
54+
55+
## Including CG Manifest in CI Builds
56+
57+
For CI builds where you want to include the cgmanifest.json in the package:
58+
59+
```bash
60+
dotnet build -p:GenerateCgManifest=true
61+
```
62+
OR
63+
```bash
64+
dotnet pack -p:GenerateCgManifest=true
65+
```
66+
67+
This will:
68+
1. Generate the cgmanifest.json file (happens by default)
69+
2. Include it in the package (for Template projects)
70+
71+
### Azure DevOps Pipeline
72+
73+
Add the following step to your YAML pipeline to include the cgmanifest.json file in the package:
74+
75+
```yaml
76+
- task: DotNetCoreCLI@2
77+
displayName: 'Pack with CG Manifest'
78+
inputs:
79+
command: 'pack'
80+
packagesToPack: 'src/Templates/src/Microsoft.Maui.Templates.csproj'
81+
packDirectory: '$(Build.ArtifactStagingDirectory)/nuget'
82+
arguments: '-p:GenerateCgManifest=true'
83+
```
84+
85+
### GitHub Actions
86+
87+
For GitHub Actions workflows, add this step:
88+
89+
```yaml
90+
- name: Pack with CG Manifest
91+
run: dotnet pack src/Templates/src/Microsoft.Maui.Templates.csproj -p:GenerateCgManifest=true -o $GITHUB_WORKSPACE/artifacts/nuget
92+
```
93+
94+
## Customizing Package Mappings
95+
96+
To add or modify package mappings, edit the PowerShell script: `eng/scripts/update-cgmanifest.ps1` (look for `$packageVersionMappings` hashtable).
97+
98+
## Special Handling for Multiple Versions
99+
100+
The script has special handling for packages that need multiple versions to be included in the manifest:
101+
102+
- **CommunityToolkit.Maui**: Both the current version (`CommunityToolkitMauiPackageVersion`) and previous version (`CommunityToolkitMauiPreviousPackageVersion`) from `Versions.props` are included.
103+
104+
To add similar handling for other packages, modify the script to add special case handling like that implemented for CommunityToolkit.Maui.
105+
106+
## Manual Updates
107+
108+
If you need to manually add packages that aren't in `Versions.props`, you can edit the `cgmanifest.json` file directly. The update scripts preserve manually added entries and only update versions for packages it knows about.
109+
110+
## Verifying the Package
111+
112+
To verify that the cgmanifest.json file is included in the package:
113+
114+
```bash
115+
# On macOS/Linux
116+
find ./artifacts/packages -name "Microsoft.Maui.Templates*.nupkg" | xargs -I{} unzip -l {} | grep cgmanifest.json
117+
118+
# On Windows
119+
foreach ($pkg in (Get-ChildItem -Path ./artifacts/packages -Filter "Microsoft.Maui.Templates*.nupkg")) {
120+
Add-Type -AssemblyName System.IO.Compression.FileSystem
121+
$zip = [System.IO.Compression.ZipFile]::OpenRead($pkg.FullName)
122+
$zip.Entries | Where-Object { $_.Name -eq "cgmanifest.json" -or $_.FullName -like "*cgmanifest.json" }
123+
$zip.Dispose()
124+
}
125+
```

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The table below outlines the different docs in this folder and what they are hel
1010

1111
| Documentation | What is it about? | Who is it for? |
1212
|----------------------|---------------------|---------------------|
13+
| [CG Manifest](CgManifest.md) | Guide to Component Governance manifest generation and management | Contributors who need to manage third-party dependencies or include CG manifest in packages |
1314
| [Code Documentation Guidelines](CodeDocumentationGuidelines.md) | Overview of the guidelines for the inline code documentation | Community members and collaborators looking to understand how to add good inline code comments that fuel our IntelliSense and online API docs |
1415
| [Issue management](IssueManagementPolicies.md) | Overview of policies in place to manage issues| Community members and collaborators looking to understand how we handle closed issues, issues that need author feedback, etc. |
1516
| [Release Schedule](ReleaseSchedule.md) | Overview of .NET MAUI version releases | Anyone who is interested in .NET MAUI versions and release dates |

eng/CgManifest.targets

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<!--
4+
This file contains targets for generating and updating the cgmanifest.json file with versions from Versions.props.
5+
Include this file in your project to ensure component governance manifests are kept up to date.
6+
7+
Usage:
8+
- For CI: dotnet build -p:GenerateCgManifest=true
9+
- Manual: dotnet build -t:GenerateCgManifest
10+
-->
11+
12+
<PropertyGroup>
13+
<CgManifestPath>$(MSBuildThisFileDirectory)..\..\src\Templates\src\cgmanifest.json</CgManifestPath>
14+
<!-- Always generate cgmanifest.json file by default during build -->
15+
<UpdateCgManifestBeforeBuild Condition="'$(UpdateCgManifestBeforeBuild)' == ''">true</UpdateCgManifestBeforeBuild>
16+
<!-- Detect if we're in CI build -->
17+
<IsInCIBuild Condition="'$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true'">true</IsInCIBuild>
18+
<IsInCIBuild Condition="'$(IsInCIBuild)' == ''">false</IsInCIBuild>
19+
<!-- Global switch to control whether to include cgmanifest.json in package (defaults to false) -->
20+
<GenerateCgManifest Condition="'$(GenerateCgManifest)' == ''">false</GenerateCgManifest>
21+
</PropertyGroup>
22+
23+
<!-- Always update cgmanifest.json before build -->
24+
<Target Name="UpdateCgManifest" BeforeTargets="BeforeBuild" Condition="'$(UpdateCgManifestBeforeBuild)' == 'true'">
25+
<Message Text="Updating cgmanifest.json from Versions.props" Importance="high" />
26+
<Exec Command="pwsh -NonInteractive -ExecutionPolicy Bypass -File &quot;$(MSBuildThisFileDirectory)scripts\update-cgmanifest.ps1&quot;" />
27+
</Target>
28+
29+
<!-- Add a custom target to update cgmanifest.json on demand -->
30+
<Target Name="GenerateCgManifest">
31+
<Message Text="Generating cgmanifest.json from Versions.props" Importance="high" />
32+
<Exec Command="pwsh -NonInteractive -ExecutionPolicy Bypass -File &quot;$(MSBuildThisFileDirectory)scripts\update-cgmanifest.ps1&quot;" />
33+
</Target>
34+
</Project>

0 commit comments

Comments
 (0)