2019-01-24 10:54:43 -05:00
|
|
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-07-26 14:41:36 -04:00
|
|
|
import("//build/compiled_action.gni")
|
2018-07-23 14:46:30 -04:00
|
|
|
|
2019-01-28 20:41:28 -05:00
|
|
|
# Tempalte to generate a Rollup bundle of code.
|
|
|
|
template("bundle") {
|
|
|
|
action(target_name) {
|
|
|
|
forward_variables_from(invoker, "*")
|
|
|
|
script = "//tools/run_node.py"
|
|
|
|
outputs = [
|
|
|
|
out_dir + out_name + ".js",
|
|
|
|
out_dir + out_name + ".js.map",
|
|
|
|
]
|
2019-02-13 13:26:30 -05:00
|
|
|
inputs = [
|
2019-03-30 14:45:36 -04:00
|
|
|
"//js/" + out_name + ".ts",
|
|
|
|
"//rollup.config.js",
|
2019-02-13 13:26:30 -05:00
|
|
|
]
|
2019-01-28 20:41:28 -05:00
|
|
|
depfile = out_dir + out_name + ".d"
|
|
|
|
args = [
|
2019-06-04 13:35:51 -04:00
|
|
|
rebase_path("//third_party/node_modules/rollup/bin/rollup",
|
|
|
|
root_build_dir),
|
2019-01-28 20:41:28 -05:00
|
|
|
"-c",
|
2019-03-30 14:45:36 -04:00
|
|
|
rebase_path("//rollup.config.js", root_build_dir),
|
2019-01-28 20:41:28 -05:00
|
|
|
"-i",
|
2019-02-13 13:26:30 -05:00
|
|
|
rebase_path(inputs[0], root_build_dir),
|
2019-01-28 20:41:28 -05:00
|
|
|
"-o",
|
2019-02-13 13:26:30 -05:00
|
|
|
rebase_path(outputs[0], root_build_dir),
|
2019-01-28 20:41:28 -05:00
|
|
|
"--sourcemapFile",
|
|
|
|
rebase_path("."),
|
|
|
|
"--silent",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-15 14:02:27 -04:00
|
|
|
template("run_node") {
|
|
|
|
action(target_name) {
|
|
|
|
forward_variables_from(invoker, "*")
|
2018-07-08 02:24:29 -04:00
|
|
|
script = "//tools/run_node.py"
|
2018-06-15 14:02:27 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Template to generate different V8 snapshots based on different runtime flags.
|
2018-12-01 01:53:37 -05:00
|
|
|
template("snapshot") {
|
|
|
|
compiled_action(target_name) {
|
2018-06-15 14:02:27 -04:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"testonly",
|
|
|
|
"deps",
|
|
|
|
])
|
2019-06-04 13:35:51 -04:00
|
|
|
tool = "//core:snapshot_creator"
|
2018-06-15 14:02:27 -04:00
|
|
|
visibility = [ ":*" ] # Only targets in this file can depend on this.
|
2018-12-01 01:53:37 -05:00
|
|
|
snapshot_out_bin = "$target_gen_dir/$target_name.bin"
|
2018-07-26 14:41:36 -04:00
|
|
|
inputs = [
|
2018-12-11 13:07:31 -05:00
|
|
|
invoker.source_root,
|
2018-06-15 14:02:27 -04:00
|
|
|
]
|
2018-12-01 01:53:37 -05:00
|
|
|
|
2018-06-15 14:02:27 -04:00
|
|
|
outputs = [
|
2018-07-26 23:21:10 -04:00
|
|
|
snapshot_out_bin,
|
2018-06-15 14:02:27 -04:00
|
|
|
]
|
2018-08-02 13:13:32 -04:00
|
|
|
args = rebase_path(outputs, root_build_dir) +
|
|
|
|
rebase_path(inputs, root_build_dir)
|
2018-06-15 14:02:27 -04:00
|
|
|
|
|
|
|
# To debug snapshotting problems:
|
|
|
|
# args += ["--trace-serializer"]
|
|
|
|
}
|
|
|
|
}
|