Skip to content

Conversation

@stuartmorgan-g
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g commented Jun 28, 2022

Adds Windows support to the platform_channels example, implementing battery querying and charge state listening/reporting.

This is mostly flutter create boilerplate; see individual commits for actual changes.

Also fixes the license check script to check .cpp files, and fixes the new violations that found.

Part of #79204

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.

@flutter-dashboard flutter-dashboard bot added d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jun 28, 2022
@flutter-dashboard
Copy link

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 (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

@stuartmorgan-g
Copy link
Contributor Author

@cbracken @gspencergoog Do we not have any devicelab Windows tests? I noticed that hello_world still doesn't have a windows directory. I thought we had enabled one app at some point, but maybe I'm misremembering?

Ideally we'd be running the driver tests for all the examples on Windows, but I didn't see any place we already have that set up.

@loic-sharma
Copy link
Member

- bin/**
- .ci.yaml

- name: Windows platform_channel_sample_test_windows
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keyonghan Does this look right? As usual with .ci.yaml changes I don't do it often enough to remember how to manually test this in advance, and since it's bringup it won't be tested here.

Copy link
Contributor

Choose a reason for hiding this comment

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

The ci config looks good to me.
You may want to add the test ownership entry in https://github.com/flutter/flutter/blob/master/TESTOWNERS#L218 by following:

# Windows platform_channel_sample_test_windows
<path-to-test> @<owner> @<team>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I gave it to @cbracken since desktop seemed like the best fit for it, but we could adjust it to me+plugins later if it turns out to be problematic.

Copy link
Member

Choose a reason for hiding this comment

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

That sgtm.

}

TaskFunction createPlatformChannelSampleTest() {
TaskFunction createPlatformChannelSampleTest({String? deviceIdOverride}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the change below follow the pattern from #45264

@stuartmorgan-g
Copy link
Contributor Author

@cbracken @gspencergoog Do we not have any devicelab Windows tests? I noticed that hello_world still doesn't have a windows directory. I thought we had enabled one app at some point, but maybe I'm misremembering?

Ideally we'd be running the driver tests for all the examples on Windows, but I didn't see any place we already have that set up.

I think I figured out setting this up 🤞🏻. Added to the PR.

@stuartmorgan-g
Copy link
Contributor Author

Copy link
Contributor

@keyonghan keyonghan left a comment

Choose a reason for hiding this comment

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

Configs LGTM.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

lgtm

@stuartmorgan-g
Copy link
Contributor Author

While fixing the missing licenses, I noticed that it was only flagging the .h files, not the .cpp files, so I fixed the script that checks this to check cpp files (we were only getting .h because it was configured for Obj-C already). And then fixed the missing licenses in other Windows examples.

@flutter-dashboard flutter-dashboard bot added the d: api docs Issues with https://api.flutter.dev/ label Jun 30, 2022
@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 30, 2022
stuartmorgan-g added a commit to flutter/website that referenced this pull request Jun 30, 2022
This adds a Windows section to the existing iOS and Android section, following the same structure as those examples, and using the code from flutter/flutter#106754

Part of flutter/flutter#79204
@auto-submit auto-submit bot merged commit 6c6ae06 into flutter:master Jun 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jun 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 30, 2022
@stuartmorgan-g stuartmorgan-g deleted the platform-channel-example-windows branch June 30, 2022 16:21
sfshaza2 pushed a commit to flutter/website that referenced this pull request Jun 30, 2022
This adds a Windows section to the existing iOS and Android section, following the same structure as those examples, and using the code from flutter/flutter#106754

Part of flutter/flutter#79204
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
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 c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants