| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Creates a symlink. | 5 # Creates a symlink. |
| 6 # Args: | 6 # Args: |
| 7 # source: Path to link to. | 7 # source: Path to link to. |
| 8 # output: Where to create the symlink. | 8 # output: Where to create the symlink. |
| 9 template("symlink") { | 9 template("symlink") { |
| 10 action(target_name) { | 10 action(target_name) { |
| 11 forward_variables_from(invoker, | 11 forward_variables_from(invoker, |
| 12 [ | 12 [ |
| 13 "data_deps", |
| 13 "deps", | 14 "deps", |
| 14 "testonly", | 15 "testonly", |
| 15 "visibility", | 16 "visibility", |
| 16 ]) | 17 ]) |
| 17 outputs = [ | 18 outputs = [ |
| 18 invoker.output, | 19 invoker.output, |
| 19 ] | 20 ] |
| 20 script = "//build/symlink.py" | 21 script = "//build/symlink.py" |
| 21 args = [ | 22 args = [ |
| 22 "-f", | 23 "-f", |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 # } | 51 # } |
| 51 # } | 52 # } |
| 52 template("binary_symlink") { | 53 template("binary_symlink") { |
| 53 symlink(target_name) { | 54 symlink(target_name) { |
| 54 forward_variables_from(invoker, | 55 forward_variables_from(invoker, |
| 55 [ | 56 [ |
| 56 "output", | 57 "output", |
| 57 "testonly", | 58 "testonly", |
| 58 "visibility", | 59 "visibility", |
| 59 ]) | 60 ]) |
| 60 deps = [ | 61 data_deps = [ |
| 61 invoker.binary_label, | 62 invoker.binary_label, |
| 62 ] | 63 ] |
| 64 if (defined(invoker.data_deps)) { |
| 65 data_deps += invoker.data_deps |
| 66 } |
| 63 | 67 |
| 64 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") | 68 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") |
| 65 if (defined(invoker.binary_output_name)) { | 69 if (defined(invoker.binary_output_name)) { |
| 66 _name = invoker.binary_output_name | 70 _name = invoker.binary_output_name |
| 67 } else { | 71 } else { |
| 68 _name = get_label_info(invoker.binary_label, "name") | 72 _name = get_label_info(invoker.binary_label, "name") |
| 69 } | 73 } |
| 70 source = "$_out_dir/$_name" | 74 source = "$_out_dir/$_name" |
| 71 | 75 |
| 72 _output_name = _name | 76 _output_name = _name |
| 73 if (defined(invoker.output_name)) { | 77 if (defined(invoker.output_name)) { |
| 74 _output_name = invoker.output_name | 78 _output_name = invoker.output_name |
| 75 } | 79 } |
| 76 output = "$root_out_dir/$_output_name" | 80 output = "$root_out_dir/$_output_name" |
| 77 } | 81 } |
| 78 } | 82 } |
| OLD | NEW |