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

Error out if the language version of the target package is too low #1474

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented Jan 11, 2025

Must be at least 3.0 since we generate code with case statements

Fixes #1462

Much be at least 3.0 since we generate code with case statements

Fixes #1462
@kevmoo kevmoo requested review from natebosch and jakemac53 January 11, 2025 23:48
Copy link

Package publishing

Package Version Status Publish tag (post-merge)
package:json_serializable 6.9.3 ready to publish json_serializable-v6.9.3
package:checked_yaml 2.0.4-wip WIP (no publish necessary)
package:json_annotation 4.9.1-wip WIP (no publish necessary)

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

final proc = await TestProcess.start(
'dart',
Platform.resolvedExecutable,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tests should run on windows now!

final output = lines.toString();
final expectedWarningCount = message == null ? 0 : 1;
final warningCount = '[WARNING]'.allMatches(output).length;
expect(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make sure there are only the warnings we are expecting and no more!

@@ -37,21 +41,36 @@ Future<void> _validatePubspec(bool production, BuildStep buildStep) async {
return;
}

Future<Pubspec> readPubspec(AssetId asset) async {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No clue why I had an inline function called once. Ditched it.

final string = await buildStep.readAsString(pubspecAssetId);
final pubspec = Pubspec.parse(string, sourceUrl: pubspecAssetId.uri);

if (_checkAnnotationConstraint(pubspec, !production)
Copy link
Collaborator Author

@kevmoo kevmoo Jan 11, 2025

Choose a reason for hiding this comment

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

Seemed the cleanest way to call the function and "do the thing" if the result is not null.

@kevmoo kevmoo merged commit 3dd6767 into master Jan 13, 2025
18 checks passed
@kevmoo kevmoo deleted the i1462_no_old_dart branch January 13, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error out of the language version of the target package is <3.0.0
2 participants