Skip to content
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

[gen_l10n] Create pubspec.yaml in ".dart_tool/flutter_gen" if it does not already exist #68206

Merged
merged 4 commits into from
Oct 16, 2020

Conversation

shihaohong
Copy link
Contributor

Fixes dart-lang/build#2835

Tests

I added the following tests:

  • A test to ensure that a valid pubspec.yaml file is created
  • A test to ensure that existing pubspec.yaml file is not overwritten

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.

@shihaohong shihaohong added the a: internationalization Supporting other languages or locales. (aka i18n) label Oct 15, 2020
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 15, 2020
@google-cla google-cla bot added the cla: yes label Oct 15, 2020
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

const String emptyPubspecTemplate = '''name: synthetic_package
Copy link
Member

Choose a reason for hiding this comment

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

I think this also needs to have an SDK constraint too? I'm not sure if build will prefer the one in the package_config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The build_runner exception no longer appears with a pubspec that does not specify an SDK constraint. Could you clarify what you mean by build preferring the one in package_config over providing one here?

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't happen at all, then I would leave this as minimal as possible and with a comment what generated it

Copy link
Member

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

@kuhnroyal
Copy link

This change looks small, can this be picked into a 1.22 hotfix?

@shihaohong
Copy link
Contributor Author

Since there's a workaround for this and it's not a breaking regression, I don't think it fits into the description of a hotfix: https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: internationalization Supporting other languages or locales. (aka i18n) tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[build_runner 1.10.3] Bad state: Unable to generate package graph
3 participants