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 = [
|
|
|
|
"js/" + out_name + ".ts",
|
|
|
|
"rollup.config.js",
|
|
|
|
]
|
2019-01-28 20:41:28 -05:00
|
|
|
depfile = out_dir + out_name + ".d"
|
|
|
|
args = [
|
|
|
|
rebase_path("third_party/node_modules/rollup/bin/rollup", root_build_dir),
|
|
|
|
"-c",
|
|
|
|
rebase_path("rollup.config.js", root_build_dir),
|
|
|
|
"-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",
|
|
|
|
])
|
2018-11-25 16:56:04 -05:00
|
|
|
tool = "//libdeno: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"]
|
|
|
|
}
|
|
|
|
}
|