Add build_integration package and move multi_root_file_system there.

This is following the design discussion we had a few months ago.

Change-Id: I48b2e82af33d10b9cd1e599e1b3a4e8e419417c8
Reviewed-on: https://dart-review.googlesource.com/56035
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
diff --git a/.packages b/.packages
index 68a0766..5e2e043 100644
--- a/.packages
+++ b/.packages
@@ -17,6 +17,7 @@
 barback:third_party/pkg/barback/lib
 bazel_worker:third_party/pkg/bazel_worker/lib
 boolean_selector:third_party/pkg/boolean_selector/lib
+build_integration:pkg/build_integration/lib
 charcode:third_party/pkg/charcode/lib
 charted:third_party/observatory_pub_packages/packages/charted/lib
 cli_util:third_party/pkg/cli_util/lib
diff --git a/pkg/build_integration/README.md b/pkg/build_integration/README.md
new file mode 100644
index 0000000..2b97b10
--- /dev/null
+++ b/pkg/build_integration/README.md
@@ -0,0 +1,4 @@
+## Package build\_integration
+
+This package contains libraries for integrating Dart tools with build systems
+like bazel and build\_runner.
diff --git a/pkg/front_end/lib/src/multi_root_file_system.dart b/pkg/build_integration/lib/file_system/multi_root.dart
similarity index 95%
rename from pkg/front_end/lib/src/multi_root_file_system.dart
rename to pkg/build_integration/lib/file_system/multi_root.dart
index a30e75f..1163d39 100644
--- a/pkg/front_end/lib/src/multi_root_file_system.dart
+++ b/pkg/build_integration/lib/file_system/multi_root.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-/// A file system that implements [CopilerOptions.multiRoots].
-library front_end.src.multi_roots_file_system;
-
 import 'dart:async';
 
 import 'package:front_end/src/api_prototype/file_system.dart';
diff --git a/pkg/build_integration/pubspec.yaml b/pkg/build_integration/pubspec.yaml
new file mode 100644
index 0000000..cb58f97
--- /dev/null
+++ b/pkg/build_integration/pubspec.yaml
@@ -0,0 +1,9 @@
+name: build_integration
+version: 0.0.1
+author: Dart Team <misc@dartlang.org>
+description: >
+  Libraries for integrating Dart tools with build systems like bazel
+  and build_runner.
+homepage: https://github.com/dart-lang/sdk/tree/master/pkg/build_integration
+dependencies:
+  front_end: ^0.1.0
diff --git a/pkg/front_end/test/src/multi_root_file_system_test.dart b/pkg/build_integration/test/file_system/multi_root_test.dart
similarity index 97%
rename from pkg/front_end/test/src/multi_root_file_system_test.dart
rename to pkg/build_integration/test/file_system/multi_root_test.dart
index 9a29993..e86fc3f 100644
--- a/pkg/front_end/test/src/multi_root_file_system_test.dart
+++ b/pkg/build_integration/test/file_system/multi_root_test.dart
@@ -6,8 +6,8 @@
 
 import 'dart:async';
 
+import 'package:build_integration/file_system/multi_root.dart';
 import 'package:front_end/src/api_prototype/memory_file_system.dart';
-import 'package:front_end/src/multi_root_file_system.dart';
 
 import 'package:test/test.dart';
 
diff --git a/pkg/dev_compiler/lib/src/kernel/command.dart b/pkg/dev_compiler/lib/src/kernel/command.dart
index b2b01e9..f8a4624 100644
--- a/pkg/dev_compiler/lib/src/kernel/command.dart
+++ b/pkg/dev_compiler/lib/src/kernel/command.dart
@@ -7,9 +7,9 @@
 import 'dart:io';
 
 import 'package:args/args.dart';
+import 'package:build_integration/file_system/multi_root.dart';
 import 'package:front_end/src/api_prototype/standard_file_system.dart';
 import 'package:front_end/src/api_unstable/ddc.dart' as fe;
-import 'package:front_end/src/multi_root_file_system.dart';
 import 'package:kernel/kernel.dart';
 import 'package:path/path.dart' as path;
 import 'package:source_maps/source_maps.dart';
diff --git a/pkg/pkg.status b/pkg/pkg.status
index a6d778d..70fb077 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -63,6 +63,7 @@
 analyzer_cli/test/*: SkipByDesign # Only meant to run on vm
 analyzer_plugin/test/*: SkipByDesign # Only meant to run on vm
 analyzer_plugin/tool/*: SkipByDesign # Only meant to run on vm
+build_integration/test/*: SkipByDesign # Only meant to run on vm, most use dart:mirrors and dart:io
 collection/test/equality_test/01: Fail # Issue 1533
 collection/test/equality_test/02: Fail # Issue 1533
 collection/test/equality_test/03: Fail # Issue 1533
diff --git a/pkg/vm/lib/frontend_server.dart b/pkg/vm/lib/frontend_server.dart
index 4ef849c..1c7c2f8 100644
--- a/pkg/vm/lib/frontend_server.dart
+++ b/pkg/vm/lib/frontend_server.dart
@@ -9,6 +9,7 @@
 import 'dart:io' hide FileSystemEntity;
 
 import 'package:args/args.dart';
+import 'package:build_integration/file_system/multi_root.dart';
 // front_end/src imports below that require lint `ignore_for_file`
 // are a temporary state of things until frontend team builds better api
 // that would replace api used below. This api was made private in
@@ -18,11 +19,7 @@
 import 'package:front_end/src/api_prototype/file_system.dart'
     show FileSystemEntity;
 import 'package:front_end/src/api_prototype/front_end.dart';
-// Use of multi_root_file_system.dart directly from front_end package is a
-// temporarily solution while we are looking for better home for that
-// functionality.
 import 'package:front_end/src/fasta/kernel/utils.dart';
-import 'package:front_end/src/multi_root_file_system.dart';
 import 'package:kernel/ast.dart';
 import 'package:kernel/binary/ast_to_binary.dart';
 import 'package:kernel/binary/limited_ast_to_binary.dart';
diff --git a/pkg/vm/pubspec.yaml b/pkg/vm/pubspec.yaml
index 66ed423..c6632f8 100644
--- a/pkg/vm/pubspec.yaml
+++ b/pkg/vm/pubspec.yaml
@@ -6,6 +6,7 @@
 environment:
   sdk: ">=1.8.0 <2.0.0"
 dependencies:
+  build_integration: 0.0.1
   front_end: 0.1.0-alpha.6
   kernel: 0.3.0-alpha.3
 dev_dependencies:
diff --git a/utils/bazel/kernel_summary_worker.dart b/utils/bazel/kernel_summary_worker.dart
index c572e88..2b1246b 100644
--- a/utils/bazel/kernel_summary_worker.dart
+++ b/utils/bazel/kernel_summary_worker.dart
@@ -14,8 +14,8 @@
 
 import 'package:args/args.dart';
 import 'package:bazel_worker/bazel_worker.dart';
+import 'package:build_integration/file_system/multi_root.dart';
 import 'package:front_end/src/api_unstable/summary_worker.dart' as fe;
-import 'package:front_end/src/multi_root_file_system.dart';
 import 'package:kernel/ast.dart' show Component, Library;
 import 'package:kernel/target/targets.dart';