From de2afe33a413b8962e930d0edd2ae35f72b41251 Mon Sep 17 00:00:00 2001 From: Edward Brey Date: Wed, 24 Apr 2024 22:55:58 -0500 Subject: [PATCH 1/3] android-projects.md: New linker settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document new options and defaults for `TrimMode`. I took my best guess at the new content, but couldn’t find defninitive documentation. FWIW, here’s an AI-generated [overview of the changes](https://g.co/gemini/share/c84935d1940b). --- docs/migration/android-projects.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/migration/android-projects.md b/docs/migration/android-projects.md index 92ef1cc08..7f1677bc2 100644 --- a/docs/migration/android-projects.md +++ b/docs/migration/android-projects.md @@ -120,16 +120,16 @@ There are behavioral changes to the `String.IndexOf()` method in .NET 5+ on diff ## Linker -.NET 5+ has new settings for the linker: +.NET 8 has new settings for the linker: - `true` -- `link`, which enables member-level trimming. +- `partial`, which enables member-level trimming. For more information, see [Trimming options](/dotnet/core/deploying/trimming-options). -In .NET Android projects by default, `Debug` builds don't use the linker, and `Release` builds set `PublishTrimmed=true` and `TrimMode=link`. `TrimMode=copyused` is the default for the .NET SDK but isn't appropriate for mobile apps. However, you can still opt into `TrimMode=copyused` if required. +In .NET Android projects by default, `Debug` builds don't use the linker, and `Release` builds set `PublishTrimmed=true` and `TrimMode=partial`. `TrimMode=full` is the default for the .NET SDK but isn't appropriate for all mobile apps. -If the legacy `AndroidLinkMode` setting is used, both `SdkOnly` and `Full` default to equivalent linker settings: +If the legacy `AndroidLinkMode` setting is used, both `SdkOnly` and `Full` default to equivalent older linker settings: - `true` - `link` From 4f59b9f6eae055da98f56cb0451f94c3c93f56be Mon Sep 17 00:00:00 2001 From: David Britch Date: Wed, 19 Jun 2024 10:01:14 +0100 Subject: [PATCH 2/3] Update android-projects.md --- docs/migration/android-projects.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/migration/android-projects.md b/docs/migration/android-projects.md index 7f1677bc2..76240117e 100644 --- a/docs/migration/android-projects.md +++ b/docs/migration/android-projects.md @@ -123,18 +123,18 @@ There are behavioral changes to the `String.IndexOf()` method in .NET 5+ on diff .NET 8 has new settings for the linker: - `true` -- `partial`, which enables member-level trimming. +- `partial`, which trims assemblies that have opted-in to trimming. For more information, see [Trimming options](/dotnet/core/deploying/trimming-options). -In .NET Android projects by default, `Debug` builds don't use the linker, and `Release` builds set `PublishTrimmed=true` and `TrimMode=partial`. `TrimMode=full` is the default for the .NET SDK but isn't appropriate for all mobile apps. +In .NET Android projects by default, `Debug` builds don't use the linker, and `Release` builds set `PublishTrimmed=true` and `TrimMode=partial`. If the legacy `AndroidLinkMode` setting is used, both `SdkOnly` and `Full` default to equivalent older linker settings: - `true` -- `link` +- `partial` -With `AndroidLinkMode=SdkOnly`, only BCL and SDK assemblies marked with `%(Trimmable)` are linked at the member level. `AndroidLinkMode=Full` sets `%(TrimMode)=link` on all .NET assemblies. +With `AndroidLinkMode=SdkOnly`, only BCL and SDK assemblies marked with `%(Trimmable)` are linked at the member level. `AndroidLinkMode=Full` sets `%(TrimMode)=partial` on all .NET assemblies. > [!TIP] > You should migrate to the new linker settings, because the `AndroidLinkMode` setting will eventually be deprecated. From dc46d4bafa107283b624408b1f4e0402fa093263 Mon Sep 17 00:00:00 2001 From: David Britch Date: Wed, 19 Jun 2024 10:32:00 +0100 Subject: [PATCH 3/3] Update android-projects.md --- docs/migration/android-projects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration/android-projects.md b/docs/migration/android-projects.md index 23b9b2f64..a700df65d 100644 --- a/docs/migration/android-projects.md +++ b/docs/migration/android-projects.md @@ -129,7 +129,7 @@ For more information, see [Trimming options](/dotnet/core/deploying/trimming-opt In .NET for Android projects by default, `Debug` builds don't use the linker, and `Release` builds set `PublishTrimmed=true` and `TrimMode=partial`. -If the legacy `AndroidLinkMode` setting is used, both `SdkOnly` and `Full` default to equivalent older linker settings: +If the legacy `AndroidLinkMode` setting is used, both `SdkOnly` and `Full` default to equivalent linker settings: - `true` - `partial`