Skip to content

[flutter_tools] maintain file manifest for create - #59706

Merged
jonahwilliams merged 5 commits into
flutter:masterfrom
jonahwilliams:add_manifest
Jun 24, 2020
Merged

jonahwilliams merged 5 commits into
flutter:masterfrom
jonahwilliams:add_manifest

Conversation

@jonahwilliams

@jonahwilliams jonahwilliams commented Jun 17, 2020 •

Copy link
Copy Markdown
Contributor

Description

First pass at fixing #57985 and implementing #59602

This doesn't have enough metadata to be useful for IDEs yet, but it prevents the issue from getting worse while we iterate on it.

@fluttergithubbot fluttergithubbot added tool Affects the "flutter" command-line tool. See also t: labels. work in progress; do not review labels Jun 17, 2020
@jonahwilliams

Copy link
Copy Markdown
Contributor Author

This is an attempt at the smallest possible change to prevent the bug without doing any large refactoring to create. I'd be interested to get your thoughts @christopherfujino @jmagman

future changes could be a little smarter than this...

@jonahwilliams
jonahwilliams marked this pull request as ready for review June 23, 2020 01:45
@jonahwilliams

Copy link
Copy Markdown
Contributor Author

Friendly ping @jmagman @christopherfujino

return Set<Uri>.from(
(manifest['files'] as List<Object>)
.cast<String>()
.map<Uri>((String path) => Uri.file(globals.fs.path.join(flutterToolsAbsolutePath, path))),

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.

if that string is not a valid path, Uri.file() will throw. I'm thinking we should catch that, especially since we're re-constructing the absolute path.

@christopherfujino christopherfujino Jun 24, 2020 •

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.

oh wait, nvm. i see the manifest is checked in.

// We are only interesting in template *file* URIs.
continue;
}
if (_templateManifest != null && !_templateManifest.contains(Uri.file(entity.absolute.path))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add logging, or metrics for this?

final Set<Uri> activeTemplateList = Directory('templates')
.listSync(recursive: true)
.whereType<File>()
.where((File file) => path.basename(file.path) != 'template_manifest.json')

@jmagman jmagman Jun 24, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For those of us on Macs, can you also ignore .DS_Store?

00:03 +0 -1: Check template manifest is up to date [E]                                                                                                                              
  Expected: empty
    Actual: Set:[
              Uri:templates/.DS_Store,
              Uri:templates/app/ios-swift.tmpl/.DS_Store,
              Uri:templates/module/ios/library/.DS_Store
            ]

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.

Noooo

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.

I always forget about .DS_Store

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

I see nothing obviously wrong. LGTM, though I'd like Jenn's approval too.

@jmagman

jmagman commented Jun 24, 2020

Copy link
Copy Markdown
Member

though I'd like Jenn's approval too.

LGTM too, I'll run it again locally after the DS_Store update and approve.

@flutter-github-sync

Copy link
Copy Markdown

Started Google testing for this PR

@jonahwilliams
jonahwilliams requested a review from jmagman June 24, 2020 21:26

@jmagman jmagman left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

Google testing passed!

@jonahwilliams
jonahwilliams merged commit a0334fb into flutter:master Jun 24, 2020
@jonahwilliams
jonahwilliams deleted the add_manifest branch June 24, 2020 23:20
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
First pass at fixing flutter#57985 and implementing flutter#59602

This doesn't have enough metadata to be useful for IDEs yet, but it prevents the issue from getting worse while we iterate on it.
@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.

6 participants