Skip to content

[Xamarin.Android.Build.Tasks] Replace GetAppSettingsDirectory - #13383

Merged
jonathanpeppers merged 2 commits into
mainfrom
simonrozsival-replace-settings-directory-task
Nov 4, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
simonrozsival-replace-settings-directory-task

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

<GetAppSettingsDirectory/> exists only to combine Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) with Xamarin/Mono for Android. Keeping a managed task for this calculation is unnecessary when MSBuild property functions can express the same operation.

Compute $(AppSettingsDirectory) inside the existing _ResolveMonoAndroidSdks target, preserving execution timing, special-folder resolution, the directory suffix, and existing settings/keystore overrides. Remove the obsolete task implementation, registration, and GAS diagnostic-prefix entry.

The existing property contracts remain unchanged. Direct external invocations of the removed Xamarin.Android.Tasks.GetAppSettingsDirectory type are no longer supported; no additional in-tree callers or task API baseline were found. No new tests are included, as requested; there were no existing task tests to migrate.

Validation:

  • make prepare && make all: preparation and solution compilation passed; workload configuration failed because make all does not build the additional API 37.1 reference assembly.
  • make leeroy: passed, including extra API levels and local workload configuration.
  • Actual shipped-target smoke checks passed using a restored minimal net11.0-android project: ./dotnet-local.sh msbuild "$SMOKE_PROJECT" -t:_ResolveMonoAndroidSdks -getProperty:AppSettingsDirectory,_AppSettingsDirectory,_ApkDebugKeyStore -nr:false -v:quiet. The default resolved to the existing LocalApplicationData directory and debug keystore.
  • The same smoke command with '-p:AppSettingsDirectory=custom settings' '-p:_ApkDebugKeyStore=custom keys/debug.keystore' -m -mt -warnaserror:MSB4286,MSB4287,MSB4288 passed and preserved both overrides. $SMOKE_PROJECT was /Users/simon/.copilot/session-state/2b0cfa59-0133-47b7-b71e-c0b80d306571/files/settings-smoke.csproj; ./dotnet-local.sh restore "$SMOKE_PROJECT" --configfile NuGet.config -v minimal passed before the smoke checks.
  • git diff --check: passed.

No existing automated test suite was run; validation used the full local SDK build and direct target execution. The temporary 24-case target fixture passed under both system and local SDKs before being removed to honor the request not to add tests.

simonrozsival and others added 2 commits November 3, 2026 16:14
Resolve the existing LocalApplicationData/Xamarin/Mono for Android path during _ResolveMonoAndroidSdks with property functions, retaining settings and keystore overrides. Remove the obsolete task and its diagnostic-prefix documentation, and cover target-time defaults and overrides with standalone MSBuild tests.

Co-authored-by: Copilot App <[email protected]>
Keep the existing test suite unchanged as requested. There were no pre-existing GetAppSettingsDirectory tests to migrate.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the refactor that moves settings-path resolution into the existing SDK setup flow.

No open issues 🎉

What changed in this PR

Replaces the single-purpose GetAppSettingsDirectory task with an MSBuild property calculation in _ResolveMonoAndroidSdks, keeping settings-path resolution within the existing SDK setup flow.

Changes:

  • Computes AppSettingsDirectory using the same special folder and directory suffix, preserving execution timing and existing overrides.
  • Removes the obsolete task implementation and registration.
  • Removes the task’s GAS diagnostic-prefix documentation entry.
File Description
src/​Xamarin.Android.Build.Tasks/​Xamarin.Android.Common.targets Replaces the task invocation with a conditional property calculation and removes registration.
src/​Xamarin.Android.Build.Tasks/​Tasks/​GetAppSettingsDirectory.cs Deletes the obsolete managed task.
Documentation/​docs-mobile/​messages/​index.md Removes the retired task’s diagnostic-prefix entry.

Review effort: Balanced

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Nov 3, 2026
@jonathanpeppers
jonathanpeppers merged commit a777f4d into main Nov 4, 2026
42 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-replace-settings-directory-task branch November 4, 2026 07:41
@jonathanpeppers

Copy link
Copy Markdown
Member

/backport to release/11.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.1xx (link to workflow run)

jonathanpeppers pushed a commit that referenced this pull request Nov 20, 2026
…3686)

`<GetAppSettingsDirectory/>` exists only to combine `Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)` with `Xamarin/Mono for Android`.  Keeping a managed task for this calculation is unnecessary when MSBuild property functions can express the same operation.

Compute `$(AppSettingsDirectory)` inside the existing `_ResolveMonoAndroidSdks` target, preserving execution timing, special-folder resolution, the directory suffix, and existing settings/keystore overrides.  Remove the obsolete task implementation, registration, and `GAS` diagnostic-prefix entry.

The existing property contracts remain unchanged.  Direct external invocations of the removed `Xamarin.Android.Tasks.GetAppSettingsDirectory` type are no longer supported; no additional in-tree callers or task API baseline were found.  No new tests are included, as requested; there were no existing task tests to migrate.

Co-authored-by: Šimon Rozsíval <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants