-
Notifications
You must be signed in to change notification settings - Fork 6k
Create a package-able incremental compiler #12681
Changes from 9 commits
517ab4b
11510fe
8300b76
7855df1
5ab9de1
b91fcb9
64aa2b1
b3129a7
ee3730f
bb64ee1
5b4a902
2d0b97b
543105e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,9 @@ if (is_fuchsia_host || is_fuchsia) { | |
| main_dart = "bin/starter.dart" | ||
| deps = [ | ||
| "$flutter_root/lib/snapshot:kernel_platform_files", | ||
| ":flutter_package_vm", | ||
| ":flutter_package_build_integration", | ||
| ":flutter_package_frontend_server", | ||
| ] | ||
| dot_packages = rebase_path(".packages") | ||
| flutter_patched_sdk = rebase_path("$root_out_dir/flutter_patched_sdk") | ||
|
|
@@ -71,4 +74,118 @@ if (is_fuchsia_host || is_fuchsia) { | |
|
|
||
| inputs = frontend_server_files | ||
| } | ||
|
|
||
| # For flutter/flutter#36738 we make the source files availible so that | ||
| # we can generate a local frontend_server snapshot in the tools cache. | ||
|
|
||
| # Creates a packageable vm. | ||
| prebuilt_dart_action("flutter_package_vm") { | ||
|
||
| packages = "//third_party/dart/.packages" | ||
|
|
||
| script = "$flutter_root/frontend_server/publish.dart" | ||
|
|
||
| inputs = exec_script("//third_party/dart/tools/list_dart_files.py", | ||
| [ | ||
| "absolute", | ||
| rebase_path("../../third_party/dart/pkg/vm"), | ||
| ], | ||
| "list lines") | ||
|
|
||
| outputs = ["$root_build_dir/dist/packages/vm/pubspec.yaml"] | ||
|
|
||
| args = [ | ||
| rebase_path("//third_party/dart/pkg/vm"), | ||
| rebase_path("$root_gen_dir/dart-pkg/vm"), | ||
| "vm", | ||
| ] | ||
| } | ||
|
|
||
| # Creates a packageable build_integration. | ||
| prebuilt_dart_action("flutter_package_build_integration") { | ||
| packages = "//third_party/dart/.packages" | ||
|
|
||
| script = "$flutter_root/frontend_server/publish.dart" | ||
|
|
||
| inputs = exec_script("//third_party/dart/tools/list_dart_files.py", | ||
| [ | ||
| "absolute", | ||
| rebase_path("../../third_party/dart/pkg/build_integration"), | ||
| ], | ||
| "list lines") | ||
|
|
||
| outputs = ["$root_build_dir/dist/packages/build_integration/pubspec.yaml"] | ||
|
|
||
| args = [ | ||
| rebase_path("//third_party/dart/pkg/build_integration"), | ||
| rebase_path("$root_gen_dir/dart-pkg/build_integration"), | ||
| "build_integration", | ||
| ] | ||
|
|
||
| } | ||
|
|
||
| # Creates a packageable frontend_server. | ||
| prebuilt_dart_action("flutter_package_frontend_server") { | ||
| packages = "//third_party/dart/.packages" | ||
|
|
||
| script = "$flutter_root/frontend_server/publish.dart" | ||
|
|
||
| inputs = exec_script("//third_party/dart/tools/list_dart_files.py", | ||
| [ | ||
| "absolute", | ||
| rebase_path("lib"), | ||
| ], | ||
| "list lines") | ||
|
|
||
| outputs = ["$root_build_dir/dist/packages/frontend_server/pubspec.yaml"] | ||
|
|
||
| args = [ | ||
| rebase_path("lib"), | ||
| rebase_path("$root_gen_dir/dart-pkg/frontend_server"), | ||
| "frontend_server", | ||
| ] | ||
| } | ||
|
|
||
| # Creates a packageable front_end. | ||
| prebuilt_dart_action("flutter_package_front_end") { | ||
| packages = "//third_party/dart/.packages" | ||
|
|
||
| script = "$flutter_root/frontend_server/publish.dart" | ||
|
|
||
| inputs = exec_script("//third_party/dart/tools/list_dart_files.py", | ||
| [ | ||
| "absolute", | ||
| rebase_path("lib"), | ||
| ], | ||
| "list lines") | ||
|
|
||
| outputs = ["$root_build_dir/dist/packages/front_end/pubspec.yaml"] | ||
|
|
||
| args = [ | ||
| rebase_path("lib"), | ||
| rebase_path("$root_gen_dir/dart-pkg/front_end"), | ||
| "front_end", | ||
| ] | ||
| } | ||
|
|
||
| # Creates a packageable kernel. | ||
| prebuilt_dart_action("flutter_package_kernel") { | ||
| packages = "//third_party/dart/.packages" | ||
|
|
||
| script = "$flutter_root/frontend_server/publish.dart" | ||
|
|
||
| inputs = exec_script("//third_party/dart/tools/list_dart_files.py", | ||
| [ | ||
| "absolute", | ||
| rebase_path("lib"), | ||
| ], | ||
| "list lines") | ||
|
|
||
| outputs = ["$root_build_dir/dist/packages/kernel/pubspec.yaml"] | ||
|
|
||
| args = [ | ||
| rebase_path("lib"), | ||
| rebase_path("$root_gen_dir/dart-pkg/kernel"), | ||
| "kernel", | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:io'; | ||
| import 'package:path/path.dart' as path; | ||
|
|
||
| const String vmPubspec = r''' | ||
| name: vm | ||
| version: 0.0.1 | ||
| environment: | ||
| sdk: ">=2.2.2 <3.0.0" | ||
| dependencies: | ||
| front_end: any | ||
| kernel: any | ||
| meta: any | ||
| build_integratioon: any | ||
| '''; | ||
|
|
||
| const String buildIntegrationPubspec = r''' | ||
| name: build_integration | ||
| version: 0.0.1 | ||
| environment: | ||
| sdk: ">=2.2.2 <3.0.0" | ||
| dependencies: | ||
| front_end: any | ||
| meta: any | ||
| '''; | ||
|
|
||
| const String frontendServerPubspec = r''' | ||
|
||
| name: frontend_server | ||
| version: 0.0.1 | ||
| environment: | ||
| sdk: ">=2.2.2 <3.0.0" | ||
| dependencies: | ||
| args: any | ||
| path: any | ||
| vm: any | ||
| '''; | ||
|
|
||
| const String kernelPubspec = r''' | ||
| name: kernel | ||
| version: 0.0.1 | ||
| environment: | ||
| sdk: '>=2.2.2 <3.0.0' | ||
| dependencies: | ||
| args: any | ||
| meta: any | ||
| '''; | ||
|
|
||
| const String frontendPubspec = r''' | ||
| name: front_end | ||
| version: 0.0.1 | ||
| environment: | ||
| sdk: '>=2.2.2 <3.0.0' | ||
| dependencies: | ||
| kernel: any | ||
| package_config: any | ||
| meta: any | ||
| '''; | ||
|
|
||
| const Map<String, String> packages = <String, String>{ | ||
| 'vm': vmPubspec, | ||
| 'build_integration': buildIntegrationPubspec, | ||
| 'frontend_server': frontendServerPubspec, | ||
| 'kernel': kernelPubspec, | ||
| 'front_end': frontendPubspec, | ||
| }; | ||
|
|
||
| // A script for creating a packagable version of several SDK libraries. | ||
| void main(List<String> arguments) { | ||
| final Directory packageSource = Directory(arguments[0]); | ||
| final String destination = arguments[1]; | ||
| final String packageName = arguments[2]; | ||
| for (File file in packageSource.listSync(recursive: true).whereType<File>()) { | ||
| if (!file.path.contains('lib')) { | ||
| // Skip test/bin directories and pubspec. | ||
| continue; | ||
| } | ||
| final File destinationFile = File(path.join(destination, path.relative(file.path, from: packageSource.path))); | ||
| destinationFile.parent.createSync(recursive: true); | ||
| file.copySync(destinationFile.path); | ||
| } | ||
| if (packages.containsKey(packageName)) { | ||
| File(path.join(destination, 'pubspec.yaml')) | ||
| .writeAsStringSync(packages[packageName]); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,10 @@ description: Communication pipe to Dart Frontend | |
| homepage: http://flutter.io | ||
| author: Flutter Authors <[email protected]> | ||
|
|
||
| environment: | ||
| # The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite. | ||
| sdk: ">=2.2.2 <3.0.0" | ||
|
|
||
| dependencies: | ||
| args: any | ||
| async: any | ||
|
|
@@ -22,36 +26,3 @@ dependencies: | |
| typed_data: any | ||
| usage: any | ||
| vm: any | ||
|
|
||
| dev_dependencies: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these not needed anymore?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No more test |
||
| analyzer: any | ||
| boolean_selector: any | ||
| cli_util: any | ||
| csslib: any | ||
| glob: any | ||
| html: any | ||
| http: any | ||
| http_multi_server: any | ||
| http_parser: any | ||
| matcher: any | ||
| mime: any | ||
| mockito: any | ||
| package_resolver: any | ||
| plugin: any | ||
| pool: any | ||
| pub_semver: any | ||
| shelf: any | ||
| shelf_packages_handler: any | ||
| shelf_static: any | ||
| shelf_web_socket: any | ||
| source_map_stack_trace: any | ||
| source_maps: any | ||
| stack_trace: any | ||
| stream_channel: any | ||
| string_scanner: any | ||
| test: any | ||
| utf: any | ||
| watcher: any | ||
| web_socket_channel: any | ||
| when: any | ||
| yaml: any | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, add comments about these artifacts pointing at the github issue and add a reviewer from the engine team.