Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1851)

Side by Side Diff: build/config/android/internal_rules.gni

Issue 2570313002: Use R.txt from AAR to generate R.java for it when building APK. (Closed)
Patch Set: Added workaround for aars with empty R.txt and no resources. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # Do not add any imports to non-//build directories here. 5 # Do not add any imports to non-//build directories here.
6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in.
7 import("//build_overrides/build.gni") 7 import("//build_overrides/build.gni")
8 import("//build/config/android/config.gni") 8 import("//build/config/android/config.gni")
9 import("//build/config/dcheck_always_on.gni") 9 import("//build/config/dcheck_always_on.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 10 import("//build/config/sanitizers/sanitizers.gni")
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2523 } 2523 }
2524 } 2524 }
2525 2525
2526 # Runs process_resources.py 2526 # Runs process_resources.py
2527 template("process_resources") { 2527 template("process_resources") {
2528 set_sources_assignment_filter([]) 2528 set_sources_assignment_filter([])
2529 forward_variables_from(invoker, [ "testonly" ]) 2529 forward_variables_from(invoker, [ "testonly" ])
2530 2530
2531 zip_path = invoker.zip_path 2531 zip_path = invoker.zip_path
2532 srcjar_path = invoker.srcjar_path 2532 srcjar_path = invoker.srcjar_path
2533 r_text_path = invoker.r_text_path 2533 r_text_out_path = invoker.r_text_out_path
2534 build_config = invoker.build_config 2534 build_config = invoker.build_config
2535 android_manifest = invoker.android_manifest 2535 android_manifest = invoker.android_manifest
2536 2536
2537 non_constant_id = true 2537 non_constant_id = true
2538 if (defined(invoker.generate_constant_ids) && 2538 if (defined(invoker.generate_constant_ids) &&
2539 invoker.generate_constant_ids) { 2539 invoker.generate_constant_ids) {
2540 non_constant_id = false 2540 non_constant_id = false
2541 } 2541 }
2542 2542
2543 action(target_name) { 2543 action(target_name) {
2544 forward_variables_from(invoker, 2544 forward_variables_from(invoker,
2545 [ 2545 [
2546 "deps", 2546 "deps",
2547 "visibility", 2547 "visibility",
2548 ]) 2548 ])
2549 script = "//build/android/gyp/process_resources.py" 2549 script = "//build/android/gyp/process_resources.py"
2550 2550
2551 depfile = "$target_gen_dir/$target_name.d" 2551 depfile = "$target_gen_dir/$target_name.d"
2552 outputs = [ 2552 outputs = [
2553 zip_path, 2553 zip_path,
2554 srcjar_path, 2554 srcjar_path,
2555 r_text_path, 2555 r_text_out_path,
2556 ] 2556 ]
2557 2557
2558 _all_resource_dirs = [] 2558 _all_resource_dirs = []
2559 sources = [] 2559 sources = []
2560 2560
2561 if (defined(invoker.resource_dirs)) { 2561 if (defined(invoker.resource_dirs)) {
2562 _all_resource_dirs += invoker.resource_dirs 2562 _all_resource_dirs += invoker.resource_dirs
2563 2563
2564 # Speed up "gn gen" by short-circuiting the empty directory. 2564 # Speed up "gn gen" by short-circuiting the empty directory.
2565 if (invoker.resource_dirs != [ "//build/android/ant/empty/res" ] && 2565 if (invoker.resource_dirs != [ "//build/android/ant/empty/res" ] &&
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 "--aapt-path", 2608 "--aapt-path",
2609 _android_aapt_path, 2609 _android_aapt_path,
2610 "--android-manifest", 2610 "--android-manifest",
2611 rebase_path(android_manifest, root_build_dir), 2611 rebase_path(android_manifest, root_build_dir),
2612 "--resource-dirs=$_rebased_all_resource_dirs", 2612 "--resource-dirs=$_rebased_all_resource_dirs",
2613 "--srcjar-out", 2613 "--srcjar-out",
2614 rebase_path(srcjar_path, root_build_dir), 2614 rebase_path(srcjar_path, root_build_dir),
2615 "--resource-zip-out", 2615 "--resource-zip-out",
2616 rebase_path(zip_path, root_build_dir), 2616 rebase_path(zip_path, root_build_dir),
2617 "--r-text-out", 2617 "--r-text-out",
2618 rebase_path(r_text_path, root_build_dir), 2618 rebase_path(r_text_out_path, root_build_dir),
2619 "--dependencies-res-zips=@FileArg($rebase_build_config:resources:depende ncy_zips)", 2619 "--dependencies-res-zips=@FileArg($rebase_build_config:resources:depende ncy_zips)",
2620 "--extra-res-packages=@FileArg($rebase_build_config:resources:extra_pack age_names)", 2620 "--extra-res-packages=@FileArg($rebase_build_config:resources:extra_pack age_names)",
2621 "--extra-r-text-files=@FileArg($rebase_build_config:resources:extra_r_te xt_files)", 2621 "--extra-r-text-files=@FileArg($rebase_build_config:resources:extra_r_te xt_files)",
2622 ] 2622 ]
2623 2623
2624 if (defined(invoker.r_text_in_path)) {
2625 _r_text_in_path = invoker.r_text_in_path
2626 inputs += [ _r_text_in_path ]
2627 args += [
2628 "--r-text-in",
2629 rebase_path(_r_text_in_path, root_build_dir),
2630 ]
2631 }
2632
2624 if (non_constant_id) { 2633 if (non_constant_id) {
2625 args += [ "--non-constant-id" ] 2634 args += [ "--non-constant-id" ]
2626 } 2635 }
2627 2636
2628 if (defined(invoker.custom_package)) { 2637 if (defined(invoker.custom_package)) {
2629 args += [ 2638 args += [
2630 "--custom-package", 2639 "--custom-package",
2631 invoker.custom_package, 2640 invoker.custom_package,
2632 ] 2641 ]
2633 } 2642 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 rebase_path(root_build_dir, root_build_dir), 2797 rebase_path(root_build_dir, root_build_dir),
2789 "--packed-libraries-dir", 2798 "--packed-libraries-dir",
2790 rebase_path(_packed_libraries_dir, root_build_dir), 2799 rebase_path(_packed_libraries_dir, root_build_dir),
2791 "--libraries=${invoker.libraries_filearg}", 2800 "--libraries=${invoker.libraries_filearg}",
2792 "--filelistjson", 2801 "--filelistjson",
2793 rebase_path(invoker.file_list_json, root_build_dir), 2802 rebase_path(invoker.file_list_json, root_build_dir),
2794 ] 2803 ]
2795 } 2804 }
2796 } 2805 }
2797 } 2806 }
OLDNEW
« no previous file with comments | « build/android/gyp/process_resources.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698