这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] Port xcode backend to dart #86753

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

Merged
merged 29 commits into from
Jul 27, 2021

Conversation

christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Jul 21, 2021

fixes #84382

Manually ran flavors_test_ios and it passes.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 21, 2021
@google-cla google-cla bot added the cla: yes label Jul 21, 2021
@christopherfujino christopherfujino marked this pull request as ready for review July 22, 2021 01:23
@christopherfujino christopherfujino changed the title Refactor xcode backend [flutter_tools] Port xcode backend to dart Jul 22, 2021
@jmagman
Copy link
Member

jmagman commented Jul 22, 2021

The done from the pipe isn't being suppressed anymore:

Running Xcode build...                                                  
done └─Compiling, linking and signing...                     5.3s

Screen Shot 2021-07-22 at 1 27 27 PM

Should be:

Running Xcode build...                                                  
 └─Compiling, linking and signing...                         3.2s

@jmagman
Copy link
Member

jmagman commented Jul 22, 2021

There seems to be additional newlines in Xcode's log:
Before:
Screen Shot 2021-07-22 at 1 34 50 PM
This PR:
Screen Shot 2021-07-22 at 1 33 12 PM

@christopherfujino
Copy link
Contributor Author

The done from the pipe isn't being suppressed anymore:

Running Xcode build...                                                  
done └─Compiling, linking and signing...                     5.3s
Screen Shot 2021-07-22 at 1 27 27 PM

Should be:

Running Xcode build...                                                  
 └─Compiling, linking and signing...                         3.2s

fixed with unit test coverage

@christopherfujino
Copy link
Contributor Author

There seems to be additional newlines in Xcode's log:
Before:
Screen Shot 2021-07-22 at 1 34 50 PM
This PR:
Screen Shot 2021-07-22 at 1 33 12 PM

I fixed this by changing print() -> stdio.write() in the echo() method. However, I'm pretty sure echoError() is supposed to append a newline char(?)

@christopherfujino
Copy link
Contributor Author

@jmagman I addressed all your comments, and ran flavors_test_ios locally and it passed. please take another look.

);

if (result.exitCode != 0) {
echo(result.stdout as String);
Copy link
Contributor Author

@christopherfujino christopherfujino Jul 23, 2021

Choose a reason for hiding this comment

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

As far as I can tell, the only behavioral difference after this change are these additional echoes before exiting if flutter assemble failed.

Does this satisfy:

Would be really awesome also to get the logging piped from assemble back into the Xcode logs--right now it just gets eaten and you get an exit code in Xcode and you don't know why it failed.

#84382 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

It's outputting a bunch of newlines when assemble fails, which is unexpected:
Screen Shot 2021-07-23 at 3 00 30 PM

To reproduce I changed

if (environment.defines[kSdkRoot] == null) {
throw MissingDefineException(kSdkRoot, name);
}

to instead throw:

    if (environment.defines[kSdkRoot] != null) {
      throw MissingDefineException(kSdkRoot, name);
    }

Would be really awesome also to get the logging piped from assemble back into the Xcode logs

I would hope to see "Target debug_universal_framework required define SdkRoot but it was not provided" in the Xcode logs or flutter build ios output. But I think feature parity is good enough for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the extraneous newlines. Not seeing assemble failures (except in verbose mode) will have to be fixed in the assemble command.

@christopherfujino
Copy link
Contributor Author

friendly ping @jmagman

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM, thank you so much for tackling this!

@fluttergithubbot fluttergithubbot merged commit 2d07436 into flutter:master Jul 27, 2021
@christopherfujino christopherfujino deleted the refactor-xcode-backend branch July 29, 2021 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

port xcode_backend.sh to Dart
3 participants