Unverified Commit 2dbf0106 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Create dart tool directory if it is missing (#39543)

parent eefe9d95
...@@ -140,6 +140,10 @@ class WebFs { ...@@ -140,6 +140,10 @@ class WebFs {
@required FlutterProject flutterProject, @required FlutterProject flutterProject,
@required BuildInfo buildInfo @required BuildInfo buildInfo
}) async { }) async {
// workaround for https://github.com/flutter/flutter/issues/38290
if (!flutterProject.dartTool.existsSync()) {
flutterProject.dartTool.createSync(recursive: true);
}
// Start the build daemon and run an initial build. // Start the build daemon and run an initial build.
final BuildDaemonClient client = await buildDaemonCreator final BuildDaemonClient client = await buildDaemonCreator
.startBuildDaemon(fs.currentDirectory.path, release: buildInfo.isRelease, profile: buildInfo.isProfile); .startBuildDaemon(fs.currentDirectory.path, release: buildInfo.isRelease, profile: buildInfo.isProfile);
......
...@@ -72,10 +72,11 @@ void main() { ...@@ -72,10 +72,11 @@ void main() {
}); });
test('Can create webFs from mocked interfaces', () => testbed.run(() async { test('Can create webFs from mocked interfaces', () => testbed.run(() async {
final FlutterProject flutterProject = FlutterProject.current();
await WebFs.start( await WebFs.start(
target: fs.path.join('lib', 'main.dart'), target: fs.path.join('lib', 'main.dart'),
buildInfo: BuildInfo.debug, buildInfo: BuildInfo.debug,
flutterProject: FlutterProject.current(), flutterProject: flutterProject,
); );
// The build daemon is told to build once. // The build daemon is told to build once.
...@@ -83,6 +84,9 @@ void main() { ...@@ -83,6 +84,9 @@ void main() {
// Chrome is launched based on port from above. // Chrome is launched based on port from above.
verify(mockChromeLauncher.launch('http://localhost:1234/')).called(1); verify(mockChromeLauncher.launch('http://localhost:1234/')).called(1);
// .dart_tool directory is created.
expect(flutterProject.dartTool.existsSync(), true);
})); }));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment