Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes scheme and target optional parameter when getting universal lin… #134571

Merged
merged 4 commits into from Sep 15, 2023

Conversation

chunhtai
Copy link
Contributor

…k settings

the show build settings xcode command can only accept one of the target or scheme flag. Therefore I make them optional.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 12, 2023
@@ -221,9 +222,12 @@ class IosProject extends XcodeBasedProject {
/// The return future will resolve to string path to the output file.
Future<String> outputsUniversalLinkSettings({
required String configuration,
required String scheme,
required String target,
String? scheme,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I am not sure if we should support scheme at all. My understanding of scheme is that it contains a set of targets. I am not sure what does it mean to get build settings for a scheme.

Copy link
Member

Choose a reason for hiding this comment

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

@andrewkolos can you review this PR? I'm still fuzzy on the relationship between targets and schemes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hah, I hardly know the difference myself, but—no worries—I'll take a look.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand, projects and targets can have Build Settings, while schemes can have a Build Configuration. Settings are applied in this order: project settings, build configuration settings, then target settings1.

Footnotes

  1. https://developer.apple.com/documentation/xcode/adding-a-build-configuration-file-to-your-project#Map-build-settings-to-a-build-configuration

Copy link
Contributor

Choose a reason for hiding this comment

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

the show build settings xcode command can only accept one of the target or scheme flag. Therefore I make them optional.

Running xcodebuild -scheme iosapp -configuration jk -target iosapp -showBuildSettings in one of my local projects doesn't result in any error. Are you sure that the command only accepts exactly one of -scheme and -target?

Copy link
Contributor

@vashworth vashworth Sep 13, 2023

Choose a reason for hiding this comment

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

So getBuildSettings specifies -project, which if -project is specified, you can only use either -scheme or -target. However, if you were to exclude the -project flag and use -scheme and -target together, it basically just ignores the -target flag.

So @andrewkolos xcodebuild -scheme iosapp -configuration jk -target iosapp -showBuildSettings works because -project is not specified.

Also, Build Configuration is not per scheme but per project, although in flutter tooling we use the scheme to determine the configuration for flavors.

When -scheme is specified, it shows the build settings for all runnable targets. This can be seen if you edit the scheme and check the Run column for more than one targets.

Screenshot 2023-09-13 at 10 44 01 AM

So if I ran xcodebuild -project xxx -configuration xxx -scheme Runner -showBuildSettings, it would show something like:

Build settings for action build and target Runner:
...
Build settings for action build and target RunnerTests:
...

When -target is set, it will only show the build settings for only the set target.

Copy link
Contributor

@vashworth vashworth Sep 13, 2023

Choose a reason for hiding this comment

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

Looking at our code, seems like we don't really handle multiple targets per scheme. It operates under the assumption that there's only one target per scheme.

I think there are improvements that could be made here, but probably out of scope for this PR. I filed an issue to follow up on that: #134669

For your PR, since -configuration is required, I think it's okay to only use -target.

If -configuration was not set, you would have needed -scheme to get the correct -configuration for flavors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, thanks for explanation. I will update the code.

Copy link
Contributor

@andrewkolos andrewkolos left a comment

Choose a reason for hiding this comment

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

I added some comments. I will do a full review soon.

Comment on lines 155 to 156
'The "--configuration", and one of "--scheme" or "--target" must also '
'be set.',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: grammar

Suggested change
'The "--configuration", and one of "--scheme" or "--target" must also '
'be set.',
'The "--configuration" and either "--scheme" or "--target" must also '
'be set.',

Copy link
Contributor

Choose a reason for hiding this comment

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

On second thought, "one of" is fine too. Feel free to ignore.

@@ -221,9 +222,12 @@ class IosProject extends XcodeBasedProject {
/// The return future will resolve to string path to the output file.
Future<String> outputsUniversalLinkSettings({
required String configuration,
required String scheme,
required String target,
String? scheme,
Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand, projects and targets can have Build Settings, while schemes can have a Build Configuration. Settings are applied in this order: project settings, build configuration settings, then target settings1.

Footnotes

  1. https://developer.apple.com/documentation/xcode/adding-a-build-configuration-file-to-your-project#Map-build-settings-to-a-build-configuration

@chunhtai
Copy link
Contributor Author

I completely removed scheme from ios analyzer and related API. PTAL :)

Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

LGTM with nits

packages/flutter_tools/lib/src/commands/analyze.dart Outdated Show resolved Hide resolved
packages/flutter_tools/lib/src/commands/ios_analyze.dart Outdated Show resolved Hide resolved
Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 14, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 14, 2023

auto label is removed for flutter/flutter/134571, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 14, 2023
@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 15, 2023
@auto-submit auto-submit bot merged commit 367203b into flutter:master Sep 15, 2023
119 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 16, 2023
flutter/flutter@72b69f9...e5e36ad

2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 326faf1762d6 to 30b7e9ded7a0 (5 revisions) (flutter/flutter#134876)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 51e643de62aa to 326faf1762d6 (6 revisions) (flutter/flutter#134875)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from d623ecf43c66 to 51e643de62aa (5 revisions) (flutter/flutter#134865)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from c0eaf2633686 to d623ecf43c66 (5 revisions) (flutter/flutter#134861)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 5aa9db365ed6 to c0eaf2633686 (5 revisions) (flutter/flutter#134860)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 67dd12f8dfca to 5aa9db365ed6 (5 revisions) (flutter/flutter#134856)
2023-09-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 45bc4307cda3 to 67dd12f8dfca (6 revisions) (flutter/flutter#134791)
2023-09-15 47866232+chunhtai@users.noreply.github.com Makes scheme and target optional parameter when getting universal lin� (flutter/flutter#134571)
2023-09-15 polinach@google.com Dispose layers in test. (flutter/flutter#134802)
2023-09-15 31859944+LongCatIsLooong@users.noreply.github.com [Windows_android channels_integration_test] Column -> ListView (flutter/flutter#134836)
2023-09-15 30870216+gaaclarke@users.noreply.github.com moved hello_world_impeller to a 7pro (flutter/flutter#134830)
2023-09-15 dacoharkes@google.com Speed up native assets target (flutter/flutter#134523)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
flutter#134571)

�k settings

the show build settings xcode command can only accept one of the target or scheme flag. Therefore I make them optional.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
…r#4938)

flutter/flutter@72b69f9...e5e36ad

2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 326faf1762d6 to 30b7e9ded7a0 (5 revisions) (flutter/flutter#134876)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 51e643de62aa to 326faf1762d6 (6 revisions) (flutter/flutter#134875)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from d623ecf43c66 to 51e643de62aa (5 revisions) (flutter/flutter#134865)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from c0eaf2633686 to d623ecf43c66 (5 revisions) (flutter/flutter#134861)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 5aa9db365ed6 to c0eaf2633686 (5 revisions) (flutter/flutter#134860)
2023-09-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 67dd12f8dfca to 5aa9db365ed6 (5 revisions) (flutter/flutter#134856)
2023-09-16 engine-flutter-autoroll@skia.org Roll Flutter Engine from 45bc4307cda3 to 67dd12f8dfca (6 revisions) (flutter/flutter#134791)
2023-09-15 47866232+chunhtai@users.noreply.github.com Makes scheme and target optional parameter when getting universal lin� (flutter/flutter#134571)
2023-09-15 polinach@google.com Dispose layers in test. (flutter/flutter#134802)
2023-09-15 31859944+LongCatIsLooong@users.noreply.github.com [Windows_android channels_integration_test] Column -> ListView (flutter/flutter#134836)
2023-09-15 30870216+gaaclarke@users.noreply.github.com moved hello_world_impeller to a 7pro (flutter/flutter#134830)
2023-09-15 dacoharkes@google.com Speed up native assets target (flutter/flutter#134523)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants