Chromium Code Reviews| Index: remoting/android/credits_tmpl.gni |
| diff --git a/remoting/android/credits_tmpl.gni b/remoting/android/credits_tmpl.gni |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..84ef706d8d387ca1eef0c1de252b53be57c1ceee |
| --- /dev/null |
| +++ b/remoting/android/credits_tmpl.gni |
| @@ -0,0 +1,57 @@ |
| +# Copyright 2017 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. |
| + |
| +# Generate Android credits HTML file, based on the third-party dependencies of |
| +# a provided GN target. |
| +# Parameters: |
| +# gn_target: The target whose dependencies should be listed in the credits. |
| +template("remoting_android_credits") { |
| + action(target_name) { |
| + _credits_html_file = "$target_gen_dir/credits.html" |
|
agrieve
2017/03/21 02:07:13
unintuitively, $target_gen_dir == "gen/remoting/an
Lambros
2017/03/22 21:31:00
Done.
|
| + _credits_template = "//remoting/credits/credits.tmpl" |
| + _credits_entry_template = "//remoting/credits/credits_entry.tmpl" |
| + script = "//tools/licenses.py" |
| + depfile = "$target_gen_dir/$target_name.d" |
| + inputs = [ |
| + _credits_template, |
| + _credits_entry_template, |
| + ] |
| + outputs = [ |
| + _credits_html_file, |
| + ] |
| + args = [ |
| + "credits", |
| + rebase_path(_credits_html_file, root_build_dir), |
| + "--file-template", |
| + rebase_path(_credits_template, root_build_dir), |
| + "--entry-template", |
| + rebase_path(_credits_entry_template, root_build_dir), |
| + "--depfile", |
| + rebase_path(depfile, root_build_dir), |
| + "--gn-target", |
| + invoker.gn_target, |
| + "--gn-out-dir", |
| + rebase_path(root_build_dir), |
| + ] |
| + } |
| + |
| + # Copies the generated HTML and the source CSS/JS, into a new directory for |
| + # Android resource processing. |
| + # The target is named this way, instead of "..._raw_resources", specifically |
| + # to avoid matching any of the _java_target_whitelist items in |
| + # build/config/android/internal_rules.gni |
| + copy(target_name + "_resources_raw") { |
| + _copy_target_name = target_name + "_resources_raw" |
|
agrieve
2017/03/21 02:07:13
I think this will evaluate to "credits_resources_r
Lambros
2017/03/22 21:31:00
In my testing, this doesn't seem to be the case. t
|
| + sources = [ |
| + "//remoting/credits/credits_css.css", |
| + "//remoting/credits/credits_js.js", |
| + ] + get_target_outputs(":$target_name") |
|
agrieve
2017/03/21 02:07:13
Might likewise be an issue here.
Lambros
2017/03/22 21:31:00
Same here.
|
| + outputs = [ |
| + "$target_gen_dir/${_copy_target_name}/res/raw/{{source_file_part}}", |
| + ] |
| + deps = [ |
| + ":$target_name", |
| + ] |
| + } |
| +} |