From b39f4c146e7c13a7489e37b315a86e1a4a03a1a8 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 1 Dec 2018 01:53:37 -0500 Subject: gn snapshot template's target_name should be target --- BUILD.gn | 4 ++-- libdeno/BUILD.gn | 8 ++++---- libdeno/deno.gni | 19 ++++++------------- 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(). The target will resolve to -# run_mksnapshot_. If is "default", no file suffixes will be used. -# Otherwise files are suffixed, e.g. embedded_.cc and -# snapshot_blob_.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 ] } -- cgit v1.2.3