Skip to content

Commit

Permalink
Enable workspaces from dart 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdm committed Apr 17, 2024
1 parent 45e5869 commit 0aba333
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 83 deletions.
3 changes: 1 addition & 2 deletions lib/src/language_version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ class LanguageVersion implements Comparable<LanguageVersion> {
static const defaultLanguageVersion = LanguageVersion(2, 7);
static const firstVersionWithNullSafety = LanguageVersion(2, 12);
static const firstVersionWithShorterHostedSyntax = LanguageVersion(2, 15);
// TODO(https://github.com/dart-lang/pub/issues/4127) update when we know actual version.
static const firstVersionWithWorkspaces = LanguageVersion(3, 7);
static const firstVersionWithWorkspaces = LanguageVersion(3, 5);

/// Transform language version to string that can be parsed with
/// [LanguageVersion.parse].
Expand Down
2 changes: 1 addition & 1 deletion test/descriptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ FileDescriptor libPubspec(
}) {
var map = packageMap(name, version, deps, devDeps);
if (resolutionWorkspace && sdk == null) {
sdk = '3.7.0';
sdk = '3.5.0';
}
if (sdk != null) {
map['environment'] = {'sdk': sdk};
Expand Down
10 changes: 5 additions & 5 deletions test/pubspec_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ dependencies:
Pubspec.parse(
'''
environment:
sdk: ^3.7.0
sdk: ^3.5.0
workspace: ['a', 'b', 'c']
''',
sources,
Expand All @@ -366,7 +366,7 @@ workspace: ['a', 'b', 'c']
Pubspec.parse(
'''
environment:
sdk: ^3.7.0
sdk: ^3.5.0
resolution: workspace
''',
sources,
Expand Down Expand Up @@ -416,7 +416,7 @@ resolution: local
expectPubspecException(
'''
environment:
sdk: ^3.7.0
sdk: ^3.5.0
workspace: 'a string'
''',
(pubspec) => pubspec.workspace,
Expand All @@ -427,7 +427,7 @@ workspace: 'a string'
expectPubspecException(
'''
environment:
sdk: ^3.7.0
sdk: ^3.5.0
workspace: ['a string', 24]
''',
(pubspec) => pubspec.workspace,
Expand All @@ -438,7 +438,7 @@ workspace: ['a string', 24]
expectPubspecException(
'''
environment:
sdk: ^3.7.0
sdk: ^3.5.0
resolution: "sometimes"''',
(pubspec) => pubspec.resolution,
);
Expand Down
Loading

0 comments on commit 0aba333

Please sign in to comment.