mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
147 lines
3.8 KiB
Plaintext
147 lines
3.8 KiB
Plaintext
# 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("$flutter_root/common/config.gni")
|
|
import("//third_party/dart/build/dart/dart_action.gni")
|
|
|
|
# Temporary snapshot copy rules until we can use the full SDK.
|
|
_flutter_sdk_snapshots = [
|
|
[
|
|
"dart2js",
|
|
"//third_party/dart/utils/compiler:dart2js",
|
|
],
|
|
[
|
|
"kernel_worker",
|
|
"//third_party/dart/utils/bazel:kernel_worker",
|
|
],
|
|
]
|
|
|
|
group("flutter") {
|
|
testonly = true
|
|
|
|
public_deps = [
|
|
"$flutter_root/lib/snapshot:generate_snapshot_bin",
|
|
"$flutter_root/lib/snapshot:kernel_platform_files",
|
|
"$flutter_root/shell/platform/embedder:flutter_engine",
|
|
"$flutter_root/sky",
|
|
]
|
|
|
|
if (current_toolchain == host_toolchain) {
|
|
public_deps += [ "$flutter_root/shell/testing" ]
|
|
}
|
|
|
|
if (!is_fuchsia && !is_fuchsia_host) {
|
|
if (current_toolchain == host_toolchain) {
|
|
public_deps += [
|
|
"$flutter_root/frontend_server",
|
|
"//third_party/dart:create_sdk",
|
|
"$flutter_root/lib/stub_ui:stub_ui",
|
|
":dart2js_platform_files",
|
|
":flutter_dartdevc_kernel_sdk",
|
|
]
|
|
foreach(snapshot, _flutter_sdk_snapshots) {
|
|
public_deps += [ ":copy_flutter_${snapshot[0]}_snapshot" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
# If on the host, compile all unittests targets.
|
|
if (current_toolchain == host_toolchain) {
|
|
if (is_mac) {
|
|
public_deps +=
|
|
[ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ]
|
|
}
|
|
|
|
public_deps += [
|
|
"$flutter_root/flow:flow_unittests",
|
|
"$flutter_root/fml:fml_unittests",
|
|
"$flutter_root/runtime:runtime_unittests",
|
|
"$flutter_root/shell/common:shell_unittests",
|
|
"$flutter_root/shell/platform/embedder:embedder_unittests",
|
|
"$flutter_root/shell/platform/embedder:embedder_a11y_unittests", # TODO(cbracken) build these into a different kernel blob in the embedder tests and load that in a test in embedder_unittests
|
|
"$flutter_root/synchronization:synchronization_unittests",
|
|
"$flutter_root/third_party/txt:txt_unittests",
|
|
]
|
|
|
|
if (!is_win) {
|
|
public_deps += [ "$flutter_root/shell/common:shell_benchmarks" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
config("config") {
|
|
include_dirs = [ ".." ]
|
|
}
|
|
|
|
group("dist") {
|
|
testonly = true
|
|
|
|
deps = [
|
|
"$flutter_root/sky/dist",
|
|
]
|
|
}
|
|
|
|
foreach(snapshot, _flutter_sdk_snapshots) {
|
|
copy("copy_flutter_${snapshot[0]}_snapshot") {
|
|
deps = [
|
|
snapshot[1],
|
|
]
|
|
sources = [
|
|
"$root_gen_dir/${snapshot[0]}.dart.snapshot",
|
|
]
|
|
outputs = [
|
|
"$root_out_dir/dart-sdk/bin/snapshots/flutter_{{source_file_part}}",
|
|
]
|
|
}
|
|
}
|
|
|
|
copy("dart2js_platform_files") {
|
|
deps = [
|
|
"//third_party/dart/utils/compiler:compile_dart2js_platform"
|
|
]
|
|
|
|
sources = [
|
|
"$root_out_dir/dart2js_outline.dill",
|
|
"$root_out_dir/dart2js_platform.dill",
|
|
]
|
|
|
|
outputs = [
|
|
"$root_out_dir/flutter_patched_sdk/{{source_file_part}}",
|
|
]
|
|
}
|
|
|
|
|
|
prebuilt_dart_action("flutter_dartdevc_kernel_sdk") {
|
|
deps = [
|
|
"//third_party/dart:create_sdk",
|
|
]
|
|
|
|
packages = "//third_party/dart/.packages"
|
|
|
|
script = "//third_party/dart/pkg/dev_compiler/tool/kernel_sdk.dart"
|
|
|
|
inputs = [
|
|
"//third_party/dart/pkg/dev_compiler/tool/kernel_sdk.dart",
|
|
]
|
|
|
|
outputs = [
|
|
"$target_gen_dir/kernel/amd/dart_sdk.js",
|
|
"$target_gen_dir/kernel/amd/dart_sdk.js.map",
|
|
"$target_gen_dir/kernel/common/dart_sdk.js",
|
|
"$target_gen_dir/kernel/common/dart_sdk.js.map",
|
|
"$target_gen_dir/kernel/es6/dart_sdk.js",
|
|
"$target_gen_dir/kernel/es6/dart_sdk.js.map",
|
|
"$target_gen_dir/kernel/legacy/dart_sdk.js",
|
|
"$target_gen_dir/kernel/legacy/dart_sdk.js.map",
|
|
]
|
|
|
|
libraries_path = rebase_path("$flutter_root/lib/snapshot/libraries.json")
|
|
output_path = rebase_path("$target_gen_dir/kernel/flutter_ddc_sdk.dill")
|
|
|
|
args = [
|
|
"--output=$output_path",
|
|
"--libraries=$libraries_path",
|
|
]
|
|
}
|