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

This commit is contained in:
Jonah Williams 2019-08-29 21:31:57 -07:00 committed by GitHub
parent eefe9d9527
commit 2dbf0106d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -140,6 +140,10 @@ class WebFs {
@required FlutterProject flutterProject,
@required BuildInfo buildInfo
}) 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.
final BuildDaemonClient client = await buildDaemonCreator
.startBuildDaemon(fs.currentDirectory.path, release: buildInfo.isRelease, profile: buildInfo.isProfile);

View file

@ -72,10 +72,11 @@ void main() {
});
test('Can create webFs from mocked interfaces', () => testbed.run(() async {
final FlutterProject flutterProject = FlutterProject.current();
await WebFs.start(
target: fs.path.join('lib', 'main.dart'),
buildInfo: BuildInfo.debug,
flutterProject: FlutterProject.current(),
flutterProject: flutterProject,
);
// The build daemon is told to build once.
@ -83,6 +84,9 @@ void main() {
// Chrome is launched based on port from above.
verify(mockChromeLauncher.launch('http://localhost:1234/')).called(1);
// .dart_tool directory is created.
expect(flutterProject.dartTool.existsSync(), true);
}));
}