Skip to content

Commit 5fa3b5f

Browse files
authored
Remove package:test version check. (#4163)
1 parent 54507bb commit 5fa3b5f

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

build_runner/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Remove undocumented / unused features: `lib/build_script_generate.dart`,
77
`bin/graph_inspector.dart`, `build_runner doctor` and
88
`build_runner generate-build-script` commands.
9+
- Remove deps on `pubspec_parse` and `timing`.
910

1011
## 2.7.0
1112

build_runner/lib/src/entrypoint/runner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BuildCommandRunner extends CommandRunner<int> {
3434
addCommand(DaemonCommand());
3535
addCommand(RunCommand());
3636
addCommand(ServeCommand());
37-
addCommand(TestCommand(packageGraph));
37+
addCommand(TestCommand());
3838
addCommand(WatchCommand());
3939
}
4040

build_runner/lib/src/entrypoint/test.dart

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import 'package:async/async.dart';
1010
import 'package:build/experiments.dart';
1111
import 'package:build_runner_core/build_runner_core.dart';
1212
import 'package:io/io.dart';
13-
import 'package:path/path.dart' as p;
14-
import 'package:pub_semver/pub_semver.dart';
15-
import 'package:pubspec_parse/pubspec_parse.dart';
1613

1714
import '../build_script_generate/build_process_state.dart';
1815
import '../generate/build.dart';
@@ -22,12 +19,7 @@ import 'options.dart';
2219
/// A command that does a single build and then runs tests using the compiled
2320
/// assets.
2421
class TestCommand extends BuildRunnerCommand {
25-
TestCommand(PackageGraph packageGraph)
26-
: super(
27-
// Use symlinks by default, if package:test supports it.
28-
symlinksDefault:
29-
_packageTestSupportsSymlinks(packageGraph) && !Platform.isWindows,
30-
);
22+
TestCommand() : super(symlinksDefault: !Platform.isWindows);
3123

3224
@override
3325
String get invocation =>
@@ -169,15 +161,6 @@ class TestCommand extends BuildRunnerCommand {
169161
}
170162
}
171163

172-
bool _packageTestSupportsSymlinks(PackageGraph packageGraph) {
173-
var testPackage = packageGraph['test'];
174-
if (testPackage == null) return false;
175-
var pubspecPath = p.join(testPackage.path, 'pubspec.yaml');
176-
var pubspec = Pubspec.parse(File(pubspecPath).readAsStringSync());
177-
if (pubspec.version == null) return false;
178-
return pubspec.version! >= Version(1, 3, 0);
179-
}
180-
181164
void _ensureBuildTestDependency(PackageGraph packageGraph) {
182165
if (!packageGraph.allPackages.containsKey('build_test')) {
183166
throw _BuildTestDependencyError();

build_runner/pubspec.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ dependencies:
3131
mime: '>=1.0.0 <3.0.0'
3232
path: ^1.8.0
3333
pub_semver: ^2.0.0
34-
pubspec_parse: ^1.0.0
3534
shelf: ^1.0.0
3635
shelf_web_socket: ">=1.0.0 <4.0.0"
3736
stack_trace: ^1.10.0
3837
stream_transform: ^2.0.0
39-
timing: ^1.0.0
4038
watcher: ^1.0.0
4139
web_socket_channel: ">=2.3.0 <4.0.0"
4240

0 commit comments

Comments
 (0)