Fix AcceptLicensesAsync silently ignoring exit code failures#288
Draft
Copilot wants to merge 4 commits intofeature/sdk-managerfrom
Draft
Fix AcceptLicensesAsync silently ignoring exit code failures#288Copilot wants to merge 4 commits intofeature/sdk-managerfrom
Copilot wants to merge 4 commits intofeature/sdk-managerfrom
Conversation
Adds SdkManager to Xamarin.Android.Tools.AndroidSdk for programmatic Android SDK setup. Two-phase approach: manifest-driven bootstrap downloads cmdline-tools, then delegates to sdkmanager CLI. New files: - SdkManager.cs: Bootstrap, list, install, uninstall, update, licenses - EnvironmentVariableNames.cs: Centralized env var constants - Models/Sdk/: SdkPackage, SdkLicense, SdkManifestComponent, etc. - ProcessUtils.cs: Extended with StartProcess helpers - SdkManagerTests.cs: Unit tests for parsing and configuration Modified: - JdkInfo.cs: Use EnvironmentVariableNames constants Key design decisions: - Manifest-driven (no hardcoded URLs), supports Google manifest - XmlReader streaming parse, SHA-1 verification, Zip Slip protection - p/invoke chmod on Unix, ArrayPool buffers on NET5_0_OR_GREATER - License presentation API for IDE/CLI UI - IDisposable, CancellationToken, netstandard2.0 compatible Closes #271 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP address feedback on SDK bootstrap and sdkmanager wrapper PR
Fix AcceptLicensesAsync silently ignoring exit code failures
Feb 25, 2026
Member
|
@copilot how do we test this? |
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Contributor
Author
Added 4 tests in commit c35e787 using a fake sdkmanager shell script (
|
6afcbfa to
05eefc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AcceptLicensesAsyncdiscardedexitCode/stderrentirely, meaning genuine sdkmanager failures (badJAVA_HOME, process errors, etc.) were silently treated as success.Changes
AcceptLicensesAsync: Non-zero exits now check output for known benign phrases before deciding to fail"licenses have already been accepted"or"all sdk package licenses accepted"InvalidOperationExceptionwithstderrfor diagnostics.baton Windows):"All SDK package licenses accepted."is tolerated (benign)"Licenses have already been accepted."is tolerated (benign)InvalidOperationException✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.