Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Set the application-id in the Linux shell #60053

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 11 commits into from
Jul 29, 2020

Conversation

robert-ancell
Copy link
Contributor

Description

Set the application-id in the Linux shell.

Related Issues

Fixes #59234.

Tests

No tests added.

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 read the Tree Hygiene wiki page, which explains my responsibilities.
  • 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

Did any tests fail when you ran them? Please read Handling breaking changes.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 23, 2020
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

The code looks good, but could you update the has correct application id for android and bundle id for ios test in create_test to check for this as well? That would be a good way to ensure that if Android changes formats, Linux doesn't accidentally regress, for instance.

(You'll need to add FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: true), to the overrides block at the end of the test so that the create step will include Linux.)

@flutter flutter deleted a comment from MixHetDanger Jun 24, 2020
@robert-ancell
Copy link
Contributor Author

I've updated the test, but please check the following:

  • I'm pulling the application ID out of my_application.cc. This feels a bit hacky, so not sure if we want to move this into a more common location, e.g. CMakeLists.txt?
  • By requiring the test to run with Linux support, does this make it harder to run elsewhere? Should it be split out from the Android/iOS code?
  • I couldn't work out how to run the tests locally, so I'm relying on the CI system to have run them correctly.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@flutter-github-sync
Copy link

Started Google testing for this PR

@stuartmorgan-g
Copy link
Contributor

  • I'm pulling the application ID out of my_application.cc. This feels a bit hacky, so not sure if we want to move this into a more common location, e.g. CMakeLists.txt?

That would make the parsing less subject to accidental breakage. Probably worth doing in case this code gets used in production, rather than just tests.

  • By requiring the test to run with Linux support, does this make it harder to run elsewhere? Should it be split out from the Android/iOS code?

No, that's just the mock context; it'll run everywhere.

  • I couldn't work out how to run the tests locally, so I'm relying on the CI system to have run them correctly.
cd packages/flutter_tools
pub get
pub run test <relative path to test file>

Or if you use VS Code with the Flutter extension, you'll get an affordance to run individual tests from the UI.

@flutter-github-sync
Copy link

Google testing passed!

@robert-ancell
Copy link
Contributor Author

I wasted far too much time trying to debug that regexp 🤯...

@stuartmorgan, can you have a quick look and see if the CMake changes look good to you. The only other thing I was thinking is the application ID is coded into both the CMakeLists.txt and my_application.cc - we could use a define/generated header to pass that variable through. I'm not sure what your preferred method of doing is that with CMake or if it really matters.

@stuartmorgan-g
Copy link
Contributor

The only other thing I was thinking is the application ID is coded into both the CMakeLists.txt and my_application.cc - we could use a define/generated header to pass that variable through. I'm not sure what your preferred method of doing is that with CMake or if it really matters.

A define should work fine, and would be much simpler than a generated header, so that SGTM. I do think we shouldn't have it in two places, as that's a foot-gun.

@robert-ancell robert-ancell merged commit 392e25c into flutter:master Jul 29, 2020
@robert-ancell robert-ancell deleted the linux-shell-app-id branch July 29, 2020 20:46
Pragya007 pushed a commit to Pragya007/flutter that referenced this pull request Aug 11, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

Set application ID for Linux apps
5 participants