keep the clide.dart barrel Flutter-free
`lib/kernel/src/toolchain.dart` is a `ChangeNotifier`, so it pulls in `package:flutter/foundation.dart`. `GitClient` and `PqlClient` imported it for the resolved binary paths, which leaked Flutter through the `package:clide/clide.dart` barrel — breaking `dart test` on every core subsystem suite (`ci/test_core.sh`), since pure Dart can't compile Flutter packages. Split the Flutter-free pieces into `toolchain_paths.dart`: `ResolvedPaths`, `resolveToolchainPaths`, and a new read-only `ToolchainView` interface with a `ToolchainView.resolved()` const factory. `Toolchain` now implements `ToolchainView`; the clients depend on the interface. Core test setups that built a `Toolchain` just to call `applyResolved` switch to the factory. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ library;
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:clide/clide.dart';
|
||||
import 'package:clide/kernel/src/toolchain.dart';
|
||||
import 'package:clide/kernel/src/toolchain_paths.dart';
|
||||
import 'package:clide/src/daemon/pql_commands.dart';
|
||||
import 'package:clide/src/pql/client.dart';
|
||||
import 'package:test/test.dart';
|
||||
@@ -17,8 +17,7 @@ void main() {
|
||||
late DaemonDispatcher dispatcher;
|
||||
|
||||
setUp(() {
|
||||
final toolchain = Toolchain();
|
||||
toolchain.applyResolved(const ResolvedPaths(pql: '/tmp/clide-no-such-pql-binary'));
|
||||
final toolchain = ToolchainView.resolved(const ResolvedPaths(pql: '/tmp/clide-no-such-pql-binary'));
|
||||
final pql = PqlClient(workDir: Directory.current, toolchain: toolchain);
|
||||
dispatcher = DaemonDispatcher();
|
||||
registerPqlCommands(dispatcher, pql);
|
||||
|
||||
Reference in New Issue
Block a user