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/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
7 import("//build/config/dcheck_always_on.gni") | 7 import("//build/config/dcheck_always_on.gni") |
8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 | 9 |
10 assert(is_android) | 10 assert(is_android) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 action(_find_deps_target_name) { | 42 action(_find_deps_target_name) { |
43 forward_variables_from(invoker, [ "deps" ]) | 43 forward_variables_from(invoker, [ "deps" ]) |
44 | 44 |
45 script = "//build/android/gyp/write_ordered_libraries.py" | 45 script = "//build/android/gyp/write_ordered_libraries.py" |
46 depfile = "$target_gen_dir/$target_name.d" | 46 depfile = "$target_gen_dir/$target_name.d" |
47 inputs = [ | 47 inputs = [ |
48 invoker.binary, | 48 invoker.binary, |
49 android_readelf, | 49 android_readelf, |
50 ] | 50 ] |
51 outputs = [ | 51 outputs = [ |
52 depfile, | |
53 _libraries_list, | 52 _libraries_list, |
54 ] | 53 ] |
55 rebased_binaries = rebase_path([ invoker.binary ], root_build_dir) | 54 rebased_binaries = rebase_path([ invoker.binary ], root_build_dir) |
56 args = [ | 55 args = [ |
57 "--depfile", | 56 "--depfile", |
58 rebase_path(depfile, root_build_dir), | 57 rebase_path(depfile, root_build_dir), |
59 "--input-libraries=$rebased_binaries", | 58 "--input-libraries=$rebased_binaries", |
60 "--libraries-dir", | 59 "--libraries-dir", |
61 rebase_path(root_shlib_dir, root_build_dir), | 60 rebase_path(root_shlib_dir, root_build_dir), |
62 "--output", | 61 "--output", |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 176 |
178 jni_generator_include = | 177 jni_generator_include = |
179 "//base/android/jni_generator/jni_generator_helper.h" | 178 "//base/android/jni_generator/jni_generator_helper.h" |
180 | 179 |
181 foreach_target_name = "${target_name}__jni_gen" | 180 foreach_target_name = "${target_name}__jni_gen" |
182 action_foreach(foreach_target_name) { | 181 action_foreach(foreach_target_name) { |
183 script = "//base/android/jni_generator/jni_generator.py" | 182 script = "//base/android/jni_generator/jni_generator.py" |
184 depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d" | 183 depfile = "$target_gen_dir/$target_name.{{source_name_part}}.d" |
185 sources = invoker.sources | 184 sources = invoker.sources |
186 outputs = [ | 185 outputs = [ |
187 depfile, | |
188 "${jni_output_dir}/{{source_name_part}}_jni.h", | 186 "${jni_output_dir}/{{source_name_part}}_jni.h", |
189 ] | 187 ] |
190 | 188 |
191 args = [ | 189 args = [ |
192 "--depfile", | 190 "--depfile", |
193 rebase_path(depfile, root_build_dir), | 191 rebase_path(depfile, root_build_dir), |
194 "--input_file={{source}}", | 192 "--input_file={{source}}", |
195 "--optimize_generation=1", | 193 "--optimize_generation=1", |
196 "--ptr_type=long", | 194 "--ptr_type=long", |
197 "--output_dir", | 195 "--output_dir", |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 jni_actions += [ ":$jni_target_name" ] | 279 jni_actions += [ ":$jni_target_name" ] |
282 action(jni_target_name) { | 280 action(jni_target_name) { |
283 # The sources aren't compiled so don't check their dependencies. | 281 # The sources aren't compiled so don't check their dependencies. |
284 check_includes = false | 282 check_includes = false |
285 depfile = "$target_gen_dir/$target_name.d" | 283 depfile = "$target_gen_dir/$target_name.d" |
286 script = "//base/android/jni_generator/jni_generator.py" | 284 script = "//base/android/jni_generator/jni_generator.py" |
287 sources = [ | 285 sources = [ |
288 jar_file, | 286 jar_file, |
289 ] | 287 ] |
290 outputs = [ | 288 outputs = [ |
291 depfile, | |
292 "${jni_output_dir}/${classname}_jni.h", | 289 "${jni_output_dir}/${classname}_jni.h", |
293 ] | 290 ] |
294 | 291 |
295 args = [ | 292 args = [ |
296 "--depfile", | 293 "--depfile", |
297 rebase_path(depfile, root_build_dir), | 294 rebase_path(depfile, root_build_dir), |
298 "--jar_file", | 295 "--jar_file", |
299 rebase_path(jar_file, root_build_dir), | 296 rebase_path(jar_file, root_build_dir), |
300 "--input_file", | 297 "--input_file", |
301 class, | 298 class, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 script = "//build/android/gyp/gcc_preprocess.py" | 381 script = "//build/android/gyp/gcc_preprocess.py" |
385 if (defined(invoker.inputs)) { | 382 if (defined(invoker.inputs)) { |
386 inputs = invoker.inputs + [] | 383 inputs = invoker.inputs + [] |
387 } | 384 } |
388 depfile = | 385 depfile = |
389 "${target_gen_dir}/${invoker.target_name}_{{source_name_part}}.d" | 386 "${target_gen_dir}/${invoker.target_name}_{{source_name_part}}.d" |
390 | 387 |
391 sources = invoker.sources | 388 sources = invoker.sources |
392 | 389 |
393 outputs = [ | 390 outputs = [ |
394 depfile, | |
395 "$_base_gen_dir/${invoker.package_name}/{{source_name_part}}.java", | 391 "$_base_gen_dir/${invoker.package_name}/{{source_name_part}}.java", |
396 ] | 392 ] |
397 | 393 |
398 args = [ | 394 args = [ |
399 "--depfile", | 395 "--depfile", |
400 rebase_path(depfile, root_build_dir), | 396 rebase_path(depfile, root_build_dir), |
401 "--include-path", | 397 "--include-path", |
402 rebase_path(_include_path, root_build_dir), | 398 rebase_path(_include_path, root_build_dir), |
403 "--output", | 399 "--output", |
404 rebase_path(outputs[1], root_build_dir), | 400 rebase_path(outputs[0], root_build_dir), |
405 "--template={{source}}", | 401 "--template={{source}}", |
406 ] | 402 ] |
407 | 403 |
408 if (defined(invoker.defines)) { | 404 if (defined(invoker.defines)) { |
409 foreach(def, invoker.defines) { | 405 foreach(def, invoker.defines) { |
410 args += [ | 406 args += [ |
411 "--defines", | 407 "--defines", |
412 def, | 408 def, |
413 ] | 409 ] |
414 } | 410 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 _srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 465 _srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
470 _rebased_srcjar_path = rebase_path(_srcjar_path, root_build_dir) | 466 _rebased_srcjar_path = rebase_path(_srcjar_path, root_build_dir) |
471 _rebased_sources = rebase_path(invoker.sources, root_build_dir) | 467 _rebased_sources = rebase_path(invoker.sources, root_build_dir) |
472 | 468 |
473 args = [ | 469 args = [ |
474 "--depfile", | 470 "--depfile", |
475 rebase_path(depfile, root_build_dir), | 471 rebase_path(depfile, root_build_dir), |
476 "--srcjar=$_rebased_srcjar_path", | 472 "--srcjar=$_rebased_srcjar_path", |
477 ] + _rebased_sources | 473 ] + _rebased_sources |
478 outputs = [ | 474 outputs = [ |
479 depfile, | |
480 _srcjar_path, | 475 _srcjar_path, |
481 ] | 476 ] |
482 } | 477 } |
483 } | 478 } |
484 | 479 |
485 # Declare a target for processing a Jinja template. | 480 # Declare a target for processing a Jinja template. |
486 # | 481 # |
487 # Variables | 482 # Variables |
488 # input: The template file to be processed. | 483 # input: The template file to be processed. |
489 # output: Where to save the result. | 484 # output: Where to save the result. |
(...skipping 19 matching lines...) Expand all Loading... |
509 "deps", | 504 "deps", |
510 ]) | 505 ]) |
511 | 506 |
512 sources = [ | 507 sources = [ |
513 invoker.input, | 508 invoker.input, |
514 ] | 509 ] |
515 script = "//build/android/gyp/jinja_template.py" | 510 script = "//build/android/gyp/jinja_template.py" |
516 depfile = "$target_gen_dir/$target_name.d" | 511 depfile = "$target_gen_dir/$target_name.d" |
517 | 512 |
518 outputs = [ | 513 outputs = [ |
519 depfile, | |
520 invoker.output, | 514 invoker.output, |
521 ] | 515 ] |
522 | 516 |
523 args = [ | 517 args = [ |
524 "--loader-base-dir", | 518 "--loader-base-dir", |
525 rebase_path("//", root_build_dir), | 519 rebase_path("//", root_build_dir), |
526 "--inputs", | 520 "--inputs", |
527 rebase_path(invoker.input, root_build_dir), | 521 rebase_path(invoker.input, root_build_dir), |
528 "--output", | 522 "--output", |
529 rebase_path(invoker.output, root_build_dir), | 523 rebase_path(invoker.output, root_build_dir), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 resources_zip = _resources_zip | 568 resources_zip = _resources_zip |
575 type = "android_resources" | 569 type = "android_resources" |
576 } | 570 } |
577 | 571 |
578 action("${target_name}__template") { | 572 action("${target_name}__template") { |
579 sources = invoker.resources | 573 sources = invoker.resources |
580 script = "//build/android/gyp/jinja_template.py" | 574 script = "//build/android/gyp/jinja_template.py" |
581 depfile = "$target_gen_dir/$target_name.d" | 575 depfile = "$target_gen_dir/$target_name.d" |
582 | 576 |
583 outputs = [ | 577 outputs = [ |
584 depfile, | |
585 _resources_zip, | 578 _resources_zip, |
586 ] | 579 ] |
587 | 580 |
588 rebased_resources = rebase_path(invoker.resources, root_build_dir) | 581 rebased_resources = rebase_path(invoker.resources, root_build_dir) |
589 args = [ | 582 args = [ |
590 "--inputs=${rebased_resources}", | 583 "--inputs=${rebased_resources}", |
591 "--inputs-base-dir", | 584 "--inputs-base-dir", |
592 rebase_path(invoker.res_dir, root_build_dir), | 585 rebase_path(invoker.res_dir, root_build_dir), |
593 "--outputs-zip", | 586 "--outputs-zip", |
594 rebase_path(_resources_zip, root_build_dir), | 587 rebase_path(_resources_zip, root_build_dir), |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 action("${target_name}__create_resources_zip") { | 637 action("${target_name}__create_resources_zip") { |
645 forward_variables_from(invoker, | 638 forward_variables_from(invoker, |
646 [ | 639 [ |
647 "deps", | 640 "deps", |
648 "sources", | 641 "sources", |
649 ]) | 642 ]) |
650 script = "//build/android/gyp/locale_pak_resources.py" | 643 script = "//build/android/gyp/locale_pak_resources.py" |
651 depfile = "$target_gen_dir/$target_name.d" | 644 depfile = "$target_gen_dir/$target_name.d" |
652 | 645 |
653 outputs = [ | 646 outputs = [ |
654 depfile, | |
655 _resources_zip, | 647 _resources_zip, |
656 ] | 648 ] |
657 | 649 |
658 _rebased_sources = rebase_path(sources, root_build_dir) | 650 _rebased_sources = rebase_path(sources, root_build_dir) |
659 args = [ | 651 args = [ |
660 "--locale-paks=${_rebased_sources}", | 652 "--locale-paks=${_rebased_sources}", |
661 "--resources-zip", | 653 "--resources-zip", |
662 rebase_path(_resources_zip, root_build_dir), | 654 rebase_path(_resources_zip, root_build_dir), |
663 "--depfile", | 655 "--depfile", |
664 rebase_path(depfile, root_build_dir), | 656 rebase_path(depfile, root_build_dir), |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 if (defined(invoker.create_dist_ijar) && invoker.create_dist_ijar) { | 1807 if (defined(invoker.create_dist_ijar) && invoker.create_dist_ijar) { |
1816 _dist_ijar_path = "$root_build_dir/test.lib.java/" + | 1808 _dist_ijar_path = "$root_build_dir/test.lib.java/" + |
1817 get_path_info(_final_apk_path, "name") + ".jar" | 1809 get_path_info(_final_apk_path, "name") + ".jar" |
1818 action("${_template_name}_dist_ijar") { | 1810 action("${_template_name}_dist_ijar") { |
1819 script = "//build/android/gyp/create_dist_jar.py" | 1811 script = "//build/android/gyp/create_dist_jar.py" |
1820 depfile = "$target_gen_dir/$target_name.d" | 1812 depfile = "$target_gen_dir/$target_name.d" |
1821 inputs = [ | 1813 inputs = [ |
1822 _build_config, | 1814 _build_config, |
1823 ] | 1815 ] |
1824 outputs = [ | 1816 outputs = [ |
1825 depfile, | |
1826 "${_dist_ijar_path}", | 1817 "${_dist_ijar_path}", |
1827 ] | 1818 ] |
1828 data = [ | 1819 data = [ |
1829 _dist_ijar_path, | 1820 _dist_ijar_path, |
1830 ] | 1821 ] |
1831 args = [ | 1822 args = [ |
1832 "--depfile", | 1823 "--depfile", |
1833 rebase_path(depfile, root_build_dir), | 1824 rebase_path(depfile, root_build_dir), |
1834 "--output", | 1825 "--output", |
1835 rebase_path("${_dist_ijar_path}", root_build_dir), | 1826 rebase_path("${_dist_ijar_path}", root_build_dir), |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 | 1936 |
1946 action(_prepare_native_target_name) { | 1937 action(_prepare_native_target_name) { |
1947 forward_variables_from(invoker, | 1938 forward_variables_from(invoker, |
1948 [ | 1939 [ |
1949 "deps", | 1940 "deps", |
1950 "public_deps", | 1941 "public_deps", |
1951 ]) | 1942 ]) |
1952 script = "//build/android/gyp/pack_relocations.py" | 1943 script = "//build/android/gyp/pack_relocations.py" |
1953 depfile = "$target_gen_dir/$target_name.d" | 1944 depfile = "$target_gen_dir/$target_name.d" |
1954 outputs = [ | 1945 outputs = [ |
1955 depfile, | |
1956 _native_libs_json, | 1946 _native_libs_json, |
1957 ] | 1947 ] |
1958 | 1948 |
1959 inputs = [ | 1949 inputs = [ |
1960 _build_config, | 1950 _build_config, |
1961 ] | 1951 ] |
1962 | 1952 |
1963 deps += _native_libs_deps | 1953 deps += _native_libs_deps |
1964 deps += [ | 1954 deps += [ |
1965 ":$build_config_target", | 1955 ":$build_config_target", |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 _create_incremental_script_rule_name = | 2126 _create_incremental_script_rule_name = |
2137 "${_template_name}__incremental_script" | 2127 "${_template_name}__incremental_script" |
2138 action(_create_incremental_script_rule_name) { | 2128 action(_create_incremental_script_rule_name) { |
2139 script = "//build/android/incremental_install/create_install_script.py" | 2129 script = "//build/android/incremental_install/create_install_script.py" |
2140 depfile = "$target_gen_dir/$target_name.d" | 2130 depfile = "$target_gen_dir/$target_name.d" |
2141 deps = [ | 2131 deps = [ |
2142 _native_libs_file_arg_dep, | 2132 _native_libs_file_arg_dep, |
2143 ] | 2133 ] |
2144 | 2134 |
2145 outputs = [ | 2135 outputs = [ |
2146 depfile, | |
2147 _incremental_install_script_path, | 2136 _incremental_install_script_path, |
2148 ] | 2137 ] |
2149 | 2138 |
2150 _rebased_apk_path_no_ext = | 2139 _rebased_apk_path_no_ext = |
2151 rebase_path(_final_apk_path_no_ext, root_build_dir) | 2140 rebase_path(_final_apk_path_no_ext, root_build_dir) |
2152 _rebased_incremental_install_script_path = | 2141 _rebased_incremental_install_script_path = |
2153 rebase_path(_incremental_install_script_path, root_build_dir) | 2142 rebase_path(_incremental_install_script_path, root_build_dir) |
2154 _rebased_depfile = rebase_path(depfile, root_build_dir) | 2143 _rebased_depfile = rebase_path(depfile, root_build_dir) |
2155 _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files" | 2144 _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files" |
2156 args = [ | 2145 args = [ |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 imports = [ framework_aidl ] | 2482 imports = [ framework_aidl ] |
2494 if (defined(invoker.interface_file)) { | 2483 if (defined(invoker.interface_file)) { |
2495 assert(invoker.interface_file != "") | 2484 assert(invoker.interface_file != "") |
2496 imports += [ invoker.interface_file ] | 2485 imports += [ invoker.interface_file ] |
2497 } | 2486 } |
2498 | 2487 |
2499 inputs = [ aidl_path ] + imports | 2488 inputs = [ aidl_path ] + imports |
2500 | 2489 |
2501 depfile = "${target_gen_dir}/${target_name}.d" | 2490 depfile = "${target_gen_dir}/${target_name}.d" |
2502 outputs = [ | 2491 outputs = [ |
2503 depfile, | |
2504 srcjar_path, | 2492 srcjar_path, |
2505 ] | 2493 ] |
2506 rebased_imports = rebase_path(imports, root_build_dir) | 2494 rebased_imports = rebase_path(imports, root_build_dir) |
2507 args = [ | 2495 args = [ |
2508 "--depfile", | 2496 "--depfile", |
2509 rebase_path(depfile, root_build_dir), | 2497 rebase_path(depfile, root_build_dir), |
2510 "--aidl-path", | 2498 "--aidl-path", |
2511 rebase_path(aidl_path, root_build_dir), | 2499 rebase_path(aidl_path, root_build_dir), |
2512 "--imports=$rebased_imports", | 2500 "--imports=$rebased_imports", |
2513 "--srcjar", | 2501 "--srcjar", |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 deps = [ | 2552 deps = [ |
2565 _protoc_dep, | 2553 _protoc_dep, |
2566 ] | 2554 ] |
2567 if (defined(invoker.deps)) { | 2555 if (defined(invoker.deps)) { |
2568 deps += invoker.deps | 2556 deps += invoker.deps |
2569 } | 2557 } |
2570 | 2558 |
2571 sources = invoker.sources | 2559 sources = invoker.sources |
2572 depfile = "$target_gen_dir/$target_name.d" | 2560 depfile = "$target_gen_dir/$target_name.d" |
2573 outputs = [ | 2561 outputs = [ |
2574 depfile, | |
2575 srcjar_path, | 2562 srcjar_path, |
2576 ] | 2563 ] |
2577 args = [ | 2564 args = [ |
2578 "--depfile", | 2565 "--depfile", |
2579 rebase_path(depfile, root_build_dir), | 2566 rebase_path(depfile, root_build_dir), |
2580 "--protoc", | 2567 "--protoc", |
2581 rebase_path(_protoc_bin, root_build_dir), | 2568 rebase_path(_protoc_bin, root_build_dir), |
2582 "--proto-path", | 2569 "--proto-path", |
2583 rebase_path(_proto_path, root_build_dir), | 2570 rebase_path(_proto_path, root_build_dir), |
2584 "--srcjar", | 2571 "--srcjar", |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 supports_android = true | 2693 supports_android = true |
2707 jar_path = "${_output_path}/$jar" | 2694 jar_path = "${_output_path}/$jar" |
2708 } | 2695 } |
2709 } | 2696 } |
2710 | 2697 |
2711 java_group(target_name) { | 2698 java_group(target_name) { |
2712 deps = _resource_targets + _jar_targets | 2699 deps = _resource_targets + _jar_targets |
2713 } | 2700 } |
2714 } | 2701 } |
2715 } | 2702 } |
OLD | NEW |