Skip to content

Commit

Permalink
DAS plugins: Add an SDK constraint to generated pubspec
Browse files Browse the repository at this point in the history
Change-Id: I98765c019d5e41b347b11b874165e3de0e381002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404760
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
  • Loading branch information
srawlins authored and Commit Queue committed Jan 21, 2025
1 parent c3dd74b commit 6c5fe06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/analysis_server/lib/src/plugin2/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Future<void> main(List<String> args, SendPort sendPort) async {
buffer.write('''
name: plugin_entrypoint
version: 0.0.1
environment:
sdk: ^3.6.0
dependencies:
analyzer: '$analyzerVersion'
analyzer_plugin: '$analyzerPluginVersion'
Expand Down
11 changes: 11 additions & 0 deletions pkg/analysis_server/test/src/plugin2/generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ dependencies:
);
}

void test_pubspecContainsSdkConstraint() {
var pluginPackageGenerator = PluginPackageGenerator([]);
expect(
pluginPackageGenerator.generatePubspec(),
contains('''
environment:
sdk: ^3.6.0
'''),
);
}

void test_pubspecContainsVersionedDependencies() {
var pluginPackageGenerator = PluginPackageGenerator([
PluginConfiguration(
Expand Down

0 comments on commit 6c5fe06

Please sign in to comment.