summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn4
-rw-r--r--libdeno/BUILD.gn8
-rw-r--r--libdeno/deno.gni19
3 files changed, 12 insertions, 19 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 494b46830..86326ed6e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -113,8 +113,8 @@ ts_sources = [
group("deno_deps") {
deps = [
- ":create_snapshot_deno",
":msg_rs",
+ ":snapshot_deno",
"libdeno:libdeno",
]
}
@@ -210,7 +210,7 @@ rust_flatbuffer("msg_rs") {
}
# Generates $target_gen_dir/snapshot_deno.bin
-create_snapshot("deno") {
+snapshot("snapshot_deno") {
js = "$target_gen_dir/bundle/main.js"
source_map = "$target_gen_dir/bundle/main.js.map"
deps = [
diff --git a/libdeno/BUILD.gn b/libdeno/BUILD.gn
index 652369718..47971ee01 100644
--- a/libdeno/BUILD.gn
+++ b/libdeno/BUILD.gn
@@ -83,20 +83,20 @@ v8_executable("test_cc") {
"test.cc",
]
deps = [
- ":create_snapshot_libdeno_test",
":libdeno",
+ ":snapshot_test",
"//testing/gtest:gtest",
]
data = [
- "$target_gen_dir/snapshot_libdeno_test.bin",
+ "$target_gen_dir/snapshot_test.bin",
]
snapshot_path = rebase_path(data[0], root_build_dir)
defines = [ "SNAPSHOT_PATH=\"$snapshot_path\"" ]
configs = [ ":deno_config" ]
}
-# Generates $target_gen_dir/snapshot_libdeno_test.bin
-create_snapshot("libdeno_test") {
+# Generates $target_gen_dir/snapshot_test.bin
+snapshot("snapshot_test") {
testonly = true
js = "libdeno_test.js"
}
diff --git a/libdeno/deno.gni b/libdeno/deno.gni
index 55662145f..896902207 100644
--- a/libdeno/deno.gni
+++ b/libdeno/deno.gni
@@ -14,18 +14,8 @@ template("run_node") {
}
# Template to generate different V8 snapshots based on different runtime flags.
-# Can be invoked with run_mksnapshot(<name>). The target will resolve to
-# run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
-# Otherwise files are suffixed, e.g. embedded_<name>.cc and
-# snapshot_blob_<name>.bin.
-#
-# The template exposes the variables:
-# args: additional flags for mksnapshots
-# embedded_suffix: a camel case suffix for method names in the embedded
-# snapshot.
-template("create_snapshot") {
- name = target_name
- compiled_action("create_snapshot_" + name) {
+template("snapshot") {
+ compiled_action(target_name) {
forward_variables_from(invoker,
[
"testonly",
@@ -33,10 +23,13 @@ template("create_snapshot") {
])
tool = "//libdeno:snapshot_creator"
visibility = [ ":*" ] # Only targets in this file can depend on this.
- snapshot_out_bin = "$target_gen_dir/snapshot_$name.bin"
+ snapshot_out_bin = "$target_gen_dir/$target_name.bin"
inputs = [
invoker.js,
]
+
+ # TODO(ry) source_map should not be involved at this layer. Remove the
+ # following.
if (defined(invoker.source_map)) {
inputs += [ invoker.source_map ]
}