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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 ":$_emma_instr_target_name", | 1539 ":$_emma_instr_target_name", |
1540 ":$_ijar_target_name", | 1540 ":$_ijar_target_name", |
1541 ] | 1541 ] |
1542 } | 1542 } |
1543 } | 1543 } |
1544 | 1544 |
1545 template("java_library_impl") { | 1545 template("java_library_impl") { |
1546 set_sources_assignment_filter([]) | 1546 set_sources_assignment_filter([]) |
1547 forward_variables_from(invoker, [ "testonly" ]) | 1547 forward_variables_from(invoker, [ "testonly" ]) |
1548 | 1548 |
1549 assert( | 1549 assert(defined(invoker.java_files) || defined(invoker.srcjars) || |
1550 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || | 1550 defined(invoker.srcjar_deps)) |
1551 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) | |
1552 _base_path = "$target_gen_dir/$target_name" | 1551 _base_path = "$target_gen_dir/$target_name" |
1553 | 1552 |
1554 # Jar files can be needed at runtime (by Robolectric tests or java binaries), | 1553 # Jar files can be needed at runtime (by Robolectric tests or java binaries), |
1555 # so do not put them under gen/. | 1554 # so do not put them under gen/. |
1556 _jar_name = target_name | 1555 _jar_name = target_name |
1557 if (defined(invoker.jar_name)) { | 1556 if (defined(invoker.jar_name)) { |
1558 _jar_name = invoker.jar_name | 1557 _jar_name = invoker.jar_name |
1559 } | 1558 } |
1560 target_dir_name = get_label_info(":$target_name", "dir") | 1559 target_dir_name = get_label_info(":$target_name", "dir") |
1561 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar" | 1560 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 if (defined(invoker.srcjar_deps)) { | 1642 if (defined(invoker.srcjar_deps)) { |
1644 _srcjar_deps = invoker.srcjar_deps | 1643 _srcjar_deps = invoker.srcjar_deps |
1645 } | 1644 } |
1646 | 1645 |
1647 _srcjars = [] | 1646 _srcjars = [] |
1648 if (defined(invoker.srcjars)) { | 1647 if (defined(invoker.srcjars)) { |
1649 _srcjars = invoker.srcjars | 1648 _srcjars = invoker.srcjars |
1650 } | 1649 } |
1651 | 1650 |
1652 _java_files = [] | 1651 _java_files = [] |
1653 if (defined(invoker.DEPRECATED_java_in_dir)) { | |
1654 _src_dir = invoker.DEPRECATED_java_in_dir + "/src" | |
1655 _src_dir_exists = exec_script("//build/dir_exists.py", | |
1656 [ rebase_path(_src_dir, root_build_dir) ], | |
1657 "string") | |
1658 assert(_src_dir_exists == "False", | |
1659 "In GN, java_in_dir should be the fully specified java directory " + | |
1660 "(i.e. including the trailing \"/src\")") | |
1661 | |
1662 _java_files_build_rel = | |
1663 exec_script("//build/android/gyp/find.py", | |
1664 [ | |
1665 "--pattern", | |
1666 "*.java", | |
1667 rebase_path(invoker.DEPRECATED_java_in_dir, | |
1668 root_build_dir), | |
1669 ], | |
1670 "list lines") | |
1671 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) | |
1672 } | |
1673 if (defined(invoker.java_files)) { | 1652 if (defined(invoker.java_files)) { |
1674 _java_files += invoker.java_files | 1653 _java_files += invoker.java_files |
1675 } | 1654 } |
1676 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) | 1655 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) |
1677 | 1656 |
1678 _compile_java_target = "${_template_name}__compile_java" | 1657 _compile_java_target = "${_template_name}__compile_java" |
1679 _final_deps += [ ":$_compile_java_target" ] | 1658 _final_deps += [ ":$_compile_java_target" ] |
1680 compile_java(_compile_java_target) { | 1659 compile_java(_compile_java_target) { |
1681 forward_variables_from(invoker, | 1660 forward_variables_from(invoker, |
1682 [ | 1661 [ |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 ] | 2149 ] |
2171 args = [ | 2150 args = [ |
2172 "--depfile", | 2151 "--depfile", |
2173 rebase_path(depfile, root_build_dir), | 2152 rebase_path(depfile, root_build_dir), |
2174 "--script-output-path", | 2153 "--script-output-path", |
2175 rebase_path(generated_script, root_build_dir), | 2154 rebase_path(generated_script, root_build_dir), |
2176 ] | 2155 ] |
2177 args += test_runner_args | 2156 args += test_runner_args |
2178 } | 2157 } |
2179 } | 2158 } |
OLD | NEW |