Skip to content

Change the way macOS app names are located - #32706

Merged
stuartmorgan-g merged 4 commits into
flutter:masterfrom
stuartmorgan-g:macos-appname-from-file
May 16, 2019
Merged

stuartmorgan-g merged 4 commits into
flutter:masterfrom
stuartmorgan-g:macos-appname-from-file

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Contributor

Description

Instead of requiring a name_output.sh, expect a file called
.app_filename in the macos/Flutter directory containing just the name of
the application. The expectation is that the Xcode build will create
that file with a script.

This is not intended as a long-term solution, but it's a substantial
improvement over name_output.sh:

  • name_output.sh required constructing the full build output path; this
    made sense when it was coupled with build.sh, but now that the
    decision for where build output goes lives in flutter_tool, that logic
    should as well.
  • Changing the name of the application required also updating
    name_output.sh, which is error-prone. With .app_filename, it can be
    created using $PRODUCT_NAME, which means that the usual way of setting
    the application name will automatically update this flow as well.

Related Issues

#30706

Tests

I added the following tests: None

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

This is a breaking change for the desktop workflow, but it is explicitly volatile at this stage.

Instead of requiring a name_output.sh, expect a file called
.app_filename in the macos/Flutter directory containing just the name of
the application. The expectation is that the Xcode build will create
that file with a script.

This is not intended as a long-term solution, but it's a substantial
improvement over name_output.sh:
- name_output.sh required constructing the full build output path; this
  made sense when it was coupled with build.sh, but now that the
  decision for where build output goes lives in flutter_tool, that logic
  should as well.
- Changing the name of the application required also updating
  name_output.sh, which is error-prone. With .app_filename, it can be
  created using $PRODUCT_NAME, which means that the usual way of setting
  the application name will automatically update this flow as well.

Related to flutter#30706

// Ensure that the executable is locatable.
final String executable = package.executable(debuggingOptions?.buildInfo?.mode);
if (executable == null) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this check so that the tool exits gracefully, rather than crashing, if the name of the executable couldn't be determined.

@jonahwilliams jonahwilliams 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.

LGTM

@stuartmorgan-g
stuartmorgan-g merged commit f8b07e2 into flutter:master May 16, 2019
@stuartmorgan-g
stuartmorgan-g deleted the macos-appname-from-file branch May 16, 2019 15:01
stuartmorgan-g added a commit to google/flutter-desktop-embedding that referenced this pull request May 16, 2019
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants