mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
98 lines
2.8 KiB
Plaintext
98 lines
2.8 KiB
Plaintext
# Copyright 2015 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# Template to generate a dart embedder package.
|
|
# Required invoker inputs:
|
|
# String package (relative path to package e.g. mojo/public/interfaces/application)
|
|
template("dart_embedder_package") {
|
|
package = invoker.package
|
|
package_path = "//$package"
|
|
|
|
destination = package
|
|
if (defined(invoker.destination)) {
|
|
destination = invoker.destination
|
|
}
|
|
|
|
action_foreach(target_name) {
|
|
deps = [
|
|
package_path,
|
|
]
|
|
list_generated_bindings_script =
|
|
rebase_path(
|
|
"//mojo/dart/embedder/tools/dart_list_generated_bindings.py")
|
|
root_prefix = rebase_path("//")
|
|
source_directory = rebase_path(package_path)
|
|
generated_bindings = exec_script(list_generated_bindings_script,
|
|
[
|
|
source_directory,
|
|
root_prefix,
|
|
],
|
|
"list lines")
|
|
sources = rebase_path(generated_bindings, ".", root_gen_dir)
|
|
outputs = [
|
|
"$root_gen_dir/dart_embedder_packages/$destination/{{source_file_part}}",
|
|
]
|
|
script = rebase_path(
|
|
"//mojo/dart/embedder/tools/dart_rewrite_embedder_package_imports.py")
|
|
args = [
|
|
rebase_path("{{source}}", "", root_build_dir),
|
|
rebase_path(
|
|
"$root_gen_dir/dart_embedder_packages/$destination/{{source_file_part}}"),
|
|
]
|
|
}
|
|
}
|
|
|
|
# Template to generate a dart embedder resource.cc file.
|
|
# Required invoker inputs:
|
|
# String output (name of output file)
|
|
# List inputs (list of input files to be included)
|
|
# String table_name (name of symbol for resource table)
|
|
# String root_prefix (base directory of resources)
|
|
# Optional invoker inputs:
|
|
# String input_directory (directory of resources that are recursively added)
|
|
# List deps
|
|
# List datadeps
|
|
template("dart_embedder_resources") {
|
|
action(target_name) {
|
|
script = "//dart/runtime/tools/create_resources.py"
|
|
deps = []
|
|
if (defined(invoker.deps)) {
|
|
deps += invoker.deps
|
|
}
|
|
datadeps = []
|
|
if (defined(invoker.datadeps)) {
|
|
datadeps = invoker.datadeps
|
|
}
|
|
|
|
output = invoker.output
|
|
outputs = [
|
|
output,
|
|
]
|
|
|
|
inputs = [ script ] + invoker.inputs
|
|
|
|
root_prefix = rebase_path(invoker.root_prefix)
|
|
|
|
args = [
|
|
"--output",
|
|
rebase_path(output),
|
|
"--outer_namespace",
|
|
"mojo",
|
|
"--inner_namespace",
|
|
"dart",
|
|
"--table_name",
|
|
invoker.table_name,
|
|
"--root_prefix",
|
|
root_prefix,
|
|
]
|
|
if (defined(invoker.input_directory)) {
|
|
args += [
|
|
"--client_root",
|
|
rebase_path(invoker.input_directory),
|
|
]
|
|
}
|
|
args += rebase_path(invoker.inputs)
|
|
}
|
|
}
|