Index: third_party/WebKit/Source/build/convert_file_to_header_with_character_array.gni |
diff --git a/third_party/WebKit/Source/build/convert_file_to_header_with_character_array.gni b/third_party/WebKit/Source/build/convert_file_to_header_with_character_array.gni |
new file mode 100644 |
index 0000000000000000000000000000000000000000..199e78ea32deffc01298872389d7e50a63312a14 |
--- /dev/null |
+++ b/third_party/WebKit/Source/build/convert_file_to_header_with_character_array.gni |
@@ -0,0 +1,32 @@ |
+# Copyright 2016 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. |
+ |
+# To use this: |
+# convert_file_to_header_with_character_array("mytarget") { |
+# input_file_path = "myfile.js" |
+# output_file_path = "$root_gen_dir/blink/myfile.h" |
+# character_array_name = "myfile_js" |
+# } |
+template("convert_file_to_header_with_character_array") { |
+ assert(defined(invoker.input_file_path), "Need input_file_path.") |
+ assert(defined(invoker.output_file_path), "Need output_file_path.") |
+ assert(defined(invoker.character_array_name), "Need character_array_name.") |
+ |
+ action(target_name) { |
+ script = "//third_party/WebKit/Source/build/scripts/xxd.py" |
+ |
+ inputs = [ |
+ invoker.input_file_path, |
+ ] |
+ outputs = [ |
+ invoker.output_file_path, |
+ ] |
+ |
+ args = [ |
+ invoker.character_array_name, |
+ rebase_path(invoker.input_file_path, root_build_dir), |
+ rebase_path(invoker.output_file_path, root_build_dir), |
+ ] |
+ } |
+} |