OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 import("//build/config/zip.gni") | 7 import("//build/config/zip.gni") |
8 import("//third_party/ijar/ijar.gni") | 8 import("//third_party/ijar/ijar.gni") |
9 | 9 |
10 assert(is_android) | 10 assert(is_android) |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 _jar_name = invoker.jar_name | 1583 _jar_name = invoker.jar_name |
1584 } | 1584 } |
1585 target_dir_name = get_label_info(":$target_name", "dir") | 1585 target_dir_name = get_label_info(":$target_name", "dir") |
1586 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar" | 1586 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar" |
1587 if (defined(invoker.jar_path)) { | 1587 if (defined(invoker.jar_path)) { |
1588 _jar_path = invoker.jar_path | 1588 _jar_path = invoker.jar_path |
1589 } | 1589 } |
1590 _template_name = target_name | 1590 _template_name = target_name |
1591 | 1591 |
1592 _final_deps = [] | 1592 _final_deps = [] |
1593 _final_datadeps = [] | |
1594 if (defined(invoker.datadeps)) { | |
1595 _final_datadeps = invoker.datadeps | |
1596 } | |
1597 | 1593 |
1598 _supports_android = | 1594 _supports_android = |
1599 defined(invoker.supports_android) && invoker.supports_android | 1595 defined(invoker.supports_android) && invoker.supports_android |
1600 _requires_android = | 1596 _requires_android = |
1601 defined(invoker.requires_android) && invoker.requires_android | 1597 defined(invoker.requires_android) && invoker.requires_android |
1602 assert(_requires_android || true) # Mark as used. | 1598 assert(_requires_android || true) # Mark as used. |
1603 _android_manifest = "//build/android/AndroidManifest.xml" | 1599 _android_manifest = "//build/android/AndroidManifest.xml" |
1604 if (defined(invoker.android_manifest)) { | 1600 if (defined(invoker.android_manifest)) { |
1605 _android_manifest = invoker.android_manifest | 1601 _android_manifest = invoker.android_manifest |
1606 } | 1602 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 build_config = _build_config | 1716 build_config = _build_config |
1721 jar_path = _jar_path | 1717 jar_path = _jar_path |
1722 script_name = _template_name | 1718 script_name = _template_name |
1723 if (defined(invoker.wrapper_script_name)) { | 1719 if (defined(invoker.wrapper_script_name)) { |
1724 script_name = invoker.wrapper_script_name | 1720 script_name = invoker.wrapper_script_name |
1725 } | 1721 } |
1726 deps = build_config_deps | 1722 deps = build_config_deps |
1727 } | 1723 } |
1728 } | 1724 } |
1729 | 1725 |
| 1726 _has_lint_target = false |
1730 if (_supports_android) { | 1727 if (_supports_android) { |
1731 if (_chromium_code) { | 1728 if (_chromium_code) { |
1732 _final_datadeps += [ ":${_template_name}__lint" ] | 1729 _has_lint_target = true |
1733 android_lint("${_template_name}__lint") { | 1730 android_lint("${_template_name}__lint") { |
1734 android_manifest = _android_manifest | 1731 android_manifest = _android_manifest |
1735 build_config = _build_config | 1732 build_config = _build_config |
1736 jar_path = _jar_path | 1733 jar_path = _jar_path |
1737 java_files = _java_files | 1734 java_files = _java_files |
1738 deps = build_config_deps + [ ":$_compile_java_target" ] | 1735 deps = build_config_deps + [ ":$_compile_java_target" ] |
1739 if (defined(invoker.deps)) { | 1736 if (defined(invoker.deps)) { |
1740 deps += invoker.deps | 1737 deps += invoker.deps |
1741 } | 1738 } |
1742 } | 1739 } |
1743 | 1740 |
1744 if (_run_findbugs) { | 1741 if (_run_findbugs) { |
1745 _final_datadeps += [ ":${_template_name}__findbugs" ] | |
1746 findbugs("${_template_name}__findbugs") { | 1742 findbugs("${_template_name}__findbugs") { |
1747 build_config = _build_config | 1743 build_config = _build_config |
1748 jar_path = _jar_path | 1744 jar_path = _jar_path |
1749 deps = build_config_deps + [ ":$_compile_java_target" ] | 1745 deps = build_config_deps + [ ":$_compile_java_target" ] |
1750 } | 1746 } |
1751 } | 1747 } |
| 1748 |
| 1749 # Use an intermediate group() rather as the data_deps target in order to |
| 1750 # avoid lint artifacts showing up as runtime_deps (while still having lint |
| 1751 # run in parallel to other targets). |
| 1752 group("${_template_name}__analysis") { |
| 1753 public_deps = [ |
| 1754 ":${_template_name}__lint", |
| 1755 ] |
| 1756 if (_run_findbugs) { |
| 1757 public_deps += [ ":${_template_name}__findbugs" ] |
| 1758 } |
| 1759 } |
1752 } | 1760 } |
1753 | 1761 |
1754 _final_deps += [ ":${_template_name}__dex" ] | 1762 _final_deps += [ ":${_template_name}__dex" ] |
1755 dex("${_template_name}__dex") { | 1763 dex("${_template_name}__dex") { |
1756 sources = [ | 1764 sources = [ |
1757 _jar_path, | 1765 _jar_path, |
1758 ] | 1766 ] |
1759 output = _dex_path | 1767 output = _dex_path |
1760 deps = [ | 1768 deps = [ |
1761 ":$_compile_java_target", | 1769 ":$_compile_java_target", |
1762 ] | 1770 ] |
1763 } | 1771 } |
1764 } | 1772 } |
1765 | 1773 |
1766 group(target_name) { | 1774 group(target_name) { |
1767 forward_variables_from(invoker, [ "visibility" ]) | 1775 data_deps = [] |
| 1776 forward_variables_from(invoker, |
| 1777 [ |
| 1778 "data_deps", |
| 1779 "visibility", |
| 1780 ]) |
1768 public_deps = _final_deps | 1781 public_deps = _final_deps |
1769 data_deps = _final_datadeps | 1782 if (_has_lint_target) { |
| 1783 data_deps += [ ":${_template_name}__analysis" ] |
| 1784 } |
1770 } | 1785 } |
1771 } | 1786 } |
1772 | 1787 |
1773 # Runs process_resources.py | 1788 # Runs process_resources.py |
1774 template("process_resources") { | 1789 template("process_resources") { |
1775 set_sources_assignment_filter([]) | 1790 set_sources_assignment_filter([]) |
1776 forward_variables_from(invoker, [ "testonly" ]) | 1791 forward_variables_from(invoker, [ "testonly" ]) |
1777 | 1792 |
1778 zip_path = invoker.zip_path | 1793 zip_path = invoker.zip_path |
1779 srcjar_path = invoker.srcjar_path | 1794 srcjar_path = invoker.srcjar_path |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 | 2201 |
2187 args = [ | 2202 args = [ |
2188 "--depfile", | 2203 "--depfile", |
2189 rebase_path(depfile, root_build_dir), | 2204 rebase_path(depfile, root_build_dir), |
2190 "--script-output-path", | 2205 "--script-output-path", |
2191 rebase_path(generated_script, root_build_dir), | 2206 rebase_path(generated_script, root_build_dir), |
2192 ] | 2207 ] |
2193 args += test_runner_args | 2208 args += test_runner_args |
2194 } | 2209 } |
2195 } | 2210 } |
OLD | NEW |