coat: Make CommandLineOverrideHelper flavor-agnostic - #12475
Open
kjyoun wants to merge 1 commit into
Open
Conversation
Refactor CommandLineOverrideHelper to be completely build-flavor agnostic: - Remove CommandLineOverrideHelperParams and accept @nonnull List<String> commandLineArgs directly in getFlagOverrides(). - Move the non-official build check for --remote-allow-origins into CobaltActivity. - Consolidate switches into a single batch call to CommandLine.getInstance().appendSwitchesAndArguments(). - Flatten loop nesting using guard clauses. - Refactor CobaltActivity to linearly accumulate command-line arguments into a List<String> via appendIntentArgs and appendMetaDataArgs. - Update CobaltActivityTest and CommandLineOverrideHelperTest to pass List<String> directly. Bug: 414009070 TAG=agy CONV=252c4f37-0a20-4d70-84f1-eadd17dbff6a
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors command-line argument handling in CobaltActivity and CommandLineOverrideHelper by transitioning from arrays and custom parameter objects to a simpler List structure. It cleans up the initialization flow and updates the corresponding unit tests. The feedback suggests handling potential empty strings when splitting arguments by semicolons in CommandLineOverrideHelper to avoid generating malformed command-line switches.
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.
Refactor CommandLineOverrideHelper to be build-flavor agnostic by
removing the CommandLineOverrideHelperParams class and accepting a
list of strings directly. This simplifies the interface and moves
environment-specific logic, such as the official build check for
remote-allow-origins, into CobaltActivity.
The change also consolidates command-line switch applications into a
single batch call and flattens nested loops for better readability.
CobaltActivity now linearly accumulates arguments from intents and
metadata. Updated unit tests to reflect the API changes.
Bug: 414009070