1 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 # To use this: 6 # convert_file_to_header_with_character_array("mytarget") { 7 # input_file_path = "myfile.js" 8 # output_file_path = "$root_gen_dir/blink/myfile.h" 9 # character_array_name = "myfile_js" 10 # } 11 template("convert_file_to_header_with_character_array") { 12 assert(defined(invoker.input_file_path), "Need input_file_path.") 13 assert(defined(invoker.output_file_path), "Need output_file_path.") 14 assert(defined(invoker.character_array_name), "Need character_array_name.") 15 16 action(target_name) { 17 script = "//third_party/WebKit/Source/build/scripts/xxd.py" 18 19 source_prereqs = [ invoker.input_file_path ] 20 outputs = [ invoker.output_file_path ] 21 22 args = [ 23 invoker.character_array_name, 24 rebase_path(invoker.input_file_path, root_build_dir), 25 rebase_path(invoker.output_file_path, root_build_dir), 26 ] 27 } 28 } 29