Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Apr 7, 2019

Description

Adds desktop embedding shells to cache logic, and allows downloading via the precache command.

Related Issues

Fixes #30663

Tests

I added the following tests:

  • precache with all flags requests all artifacts off stable.
  • precache with all flags requests only stable platforms on stable branch

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.

@jonahwilliams jonahwilliams marked this pull request as ready for review April 8, 2019 03:01
@jonahwilliams
Copy link
Contributor Author

This should not land until #30153 to prevent this from leaking into stable.

@goderbauer goderbauer added a: desktop Running on desktop tool Affects the "flutter" command-line tool. See also t: labels. labels Apr 8, 2019

_makeFilesExecutable(dir);

// TODO(jonahwilliams): clean this logic up to better handle different framework names.
Copy link
Contributor

Choose a reason for hiding this comment

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

How about something like:

final List<String> frameworkNames = ['Flutter', 'FlutterMacOS'];
for (frameworkName in frameworkNames) {
  final File frameworkZip = fs.file(fs.path.join(dir.path, '$frameworkName.framework.zip'));
  ...
}

rather than duplicating the code.

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

framework.createSync();
os.unzip(frameworkZip, framework);
}
final File desktopFrameworkZip = fs.file(fs.path.join(dir.path, 'FlutterMacOS.framework.zip'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Since I'm not familiar with the overall structure of this code: why does the macOS framework need to be specified/handled in two different places? It's both here and in the artifact list later. The iOS code doesn't seem to have the same structure (it's not obvious to me why Flutter.framework has special handling here, but it's not in the list below like the macOS version is.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its a bit of a historical artifact (har-har), I can't quite remove it yet but eventually this will be gone. TLDR: I am scared to touch it

@jonahwilliams jonahwilliams force-pushed the download_desktop_artifacts branch from e6d4573 to 4425191 Compare April 9, 2019 23:29
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.

I cloned this to try it out (with the fix for the check below); --macos is working for me, but --linux and --windows appear to be no-ops; nothing prints out, and I can't find any .dll or .so files in bin/cache, nor the client wrapper source. Is it filtering by my host platform?

}
if (argResults['web']) {
requiredArtifacts.add(DevelopmentArtifact.web);
if (FlutterVersion.instance.isStable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check is reversed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps I should add a test...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test added.

@jonahwilliams
Copy link
Contributor Author

Right now this is filtering by host platform, so macos artifacts are only downloaded for mac. If that isn't correct, I can remove that restriction.

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 with nits. (Caveat: I'm not familiar with the Dart testing infrastructure yet, so my review of the tests is probably useful. Up to you if you want a second reviewer for that part.)

@jonahwilliams jonahwilliams merged commit 259641c into flutter:master Apr 11, 2019
@jonahwilliams jonahwilliams deleted the download_desktop_artifacts branch April 11, 2019 05:08
jiisd added a commit to jiisd/flutter that referenced this pull request Apr 12, 2019
* master: (209 commits)
  Allow mouse hover to only respond to some mouse events but not all. (flutter#30886)
  Fix issue 23527: Exception: RenderViewport exceeded its maximum number of layout cycles (flutter#30809)
  Keep hover annotation layers in sync with the mouse detector. (flutter#30829)
  Use identical instead of '==' in a constant expression. (flutter#30921)
  Add toggle for debugProfileWidgetBuilds (flutter#30867)
  Revert "Manual engine roll with disabled service authentication codes (flutter#30919)" (flutter#30930)
  Manual engine roll with disabled service authentication codes (flutter#30919)
  Baseline Aligned Row (flutter#30746)
  [Material] Fix showDialog crasher caused by old contexts (flutter#30754)
  Let `sliver.dart` `_createErrorWidget` work with other Widgets (flutter#30880)
  Add more dialog doc cross-reference (flutter#30887)
  Allow downloading of desktop embedding artifacts (flutter#30648)
  CupertinoDatePicker initialDateTime accounts for minuteInterval  (flutter#30862)
  add golden tests for CupertinoDatePicker (flutter#30828)
  Simplify toImage future handling (flutter#30876)
  Fixed Table flex column layout error flutter#30437 (flutter#30470)
  Fix iTunes Transporter quirk (flutter#30883)
  Bump Android build tools to 28.0.3 in Dockerfile (flutter#30832)
  Update the upload key which seems to have trouble for some reason (flutter#30871)
  Check for invalid elevations (flutter#30215)
  ...
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: desktop Running on desktop tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update flutter cache/precache to support desktop artifacts

4 participants