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

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

Issue 2862603002: Move Android resource_zip files into own build subdir. (Closed)
Patch Set: Move Android resource_zip files into own build subdir. Created 3 years, 7 months 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/lint/suppressions.xml ('k') | no next file » | 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/config/android/config.gni") 7 import("//build/config/android/config.gni")
8 import("//build/config/android/internal_rules.gni") 8 import("//build/config/android/internal_rules.gni")
9 import("//build/config/compiler/compiler.gni") 9 import("//build/config/compiler/compiler.gni")
10 import("//build/config/dcheck_always_on.gni") 10 import("//build/config/dcheck_always_on.gni")
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 # variables = ["color=red"] 572 # variables = ["color=red"]
573 # } 573 # }
574 template("jinja_template_resources") { 574 template("jinja_template_resources") {
575 set_sources_assignment_filter([]) 575 set_sources_assignment_filter([])
576 forward_variables_from(invoker, [ "testonly" ]) 576 forward_variables_from(invoker, [ "testonly" ])
577 577
578 assert(defined(invoker.resources)) 578 assert(defined(invoker.resources))
579 assert(defined(invoker.res_dir)) 579 assert(defined(invoker.res_dir))
580 580
581 _base_path = "$target_gen_dir/$target_name" 581 _base_path = "$target_gen_dir/$target_name"
582 _resources_zip = _base_path + ".resources.zip" 582
583 # JUnit tests use resource zip files. These must not be put in gen/
584 # directory or they will not be available to tester bots.
585 _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir)
586 _resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_pat h}/${target_name}.resources.zip"
583 _build_config = _base_path + ".build_config" 587 _build_config = _base_path + ".build_config"
584 588
585 write_build_config("${target_name}__build_config") { 589 write_build_config("${target_name}__build_config") {
586 build_config = _build_config 590 build_config = _build_config
587 resources_zip = _resources_zip 591 resources_zip = _resources_zip
588 type = "android_resources" 592 type = "android_resources"
589 if (defined(invoker.deps)) { 593 if (defined(invoker.deps)) {
590 possible_config_deps = invoker.deps 594 possible_config_deps = invoker.deps
591 } 595 }
592 } 596 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 # deps = [":foo_resources"] 673 # deps = [":foo_resources"]
670 # resource_dirs = ["res_overrides"] 674 # resource_dirs = ["res_overrides"]
671 # } 675 # }
672 template("android_resources") { 676 template("android_resources") {
673 set_sources_assignment_filter([]) 677 set_sources_assignment_filter([])
674 forward_variables_from(invoker, [ "testonly" ]) 678 forward_variables_from(invoker, [ "testonly" ])
675 679
676 assert(defined(invoker.resource_dirs)) 680 assert(defined(invoker.resource_dirs))
677 681
678 base_path = "$target_gen_dir/$target_name" 682 base_path = "$target_gen_dir/$target_name"
679 zip_path = base_path + ".resources.zip" 683
684 # JUnit tests use resource zip files. These must not be put in gen/
685 # directory or they will not be available to tester bots.
686 _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir)
687 zip_path = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path}/${t arget_name}.resources.zip"
680 srcjar_path = base_path + ".srcjar" 688 srcjar_path = base_path + ".srcjar"
681 r_text_out_path = base_path + "_R.txt" 689 r_text_out_path = base_path + "_R.txt"
682 build_config = base_path + ".build_config" 690 build_config = base_path + ".build_config"
683 691
684 build_config_target_name = "${target_name}__build_config" 692 build_config_target_name = "${target_name}__build_config"
685 process_resources_target_name = "${target_name}__process_resources" 693 process_resources_target_name = "${target_name}__process_resources"
686 final_target_name = target_name 694 final_target_name = target_name
687 695
688 write_build_config(build_config_target_name) { 696 write_build_config(build_config_target_name) {
689 type = "android_resources" 697 type = "android_resources"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 # 896 #
889 # Example 897 # Example
890 # java_strings_grd("foo_strings_grd") { 898 # java_strings_grd("foo_strings_grd") {
891 # grd_file = "foo_strings.grd" 899 # grd_file = "foo_strings.grd"
892 # } 900 # }
893 template("java_strings_grd") { 901 template("java_strings_grd") {
894 set_sources_assignment_filter([]) 902 set_sources_assignment_filter([])
895 forward_variables_from(invoker, [ "testonly" ]) 903 forward_variables_from(invoker, [ "testonly" ])
896 904
897 base_path = "$target_gen_dir/$target_name" 905 base_path = "$target_gen_dir/$target_name"
898 resources_zip = base_path + ".resources.zip" 906
907 # JUnit tests use resource zip files. These must not be put in gen/
908 # directory or they will not be available to tester bots.
909 _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir)
910 resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path }/${target_name}.resources.zip"
899 build_config = base_path + ".build_config" 911 build_config = base_path + ".build_config"
900 912
901 write_build_config("${target_name}__build_config") { 913 write_build_config("${target_name}__build_config") {
902 type = "android_resources" 914 type = "android_resources"
903 } 915 }
904 916
905 # Put grit files into this subdirectory of target_gen_dir. 917 # Put grit files into this subdirectory of target_gen_dir.
906 extra_output_path = target_name + "_grit_output" 918 extra_output_path = target_name + "_grit_output"
907 919
908 grit_target_name = "${target_name}__grit" 920 grit_target_name = "${target_name}__grit"
909 grit_output_dir = "$target_gen_dir/$extra_output_path" 921 grit_output_dir = "$target_gen_dir/$extra_output_path"
922
910 grit(grit_target_name) { 923 grit(grit_target_name) {
911 forward_variables_from(invoker, [ "deps" ]) 924 forward_variables_from(invoker, [ "deps" ])
912 grit_flags = [ 925 grit_flags = [
913 "-E", 926 "-E",
914 "ANDROID_JAVA_TAGGED_ONLY=false", 927 "ANDROID_JAVA_TAGGED_ONLY=false",
915 ] 928 ]
916 output_dir = grit_output_dir 929 output_dir = grit_output_dir
917 resource_ids = "" 930 resource_ids = ""
918 source = invoker.grd_file 931 source = invoker.grd_file
919 outputs = invoker.outputs 932 outputs = invoker.outputs
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 # grit_output_dir = "$root_gen_dir/foo/grit" 967 # grit_output_dir = "$root_gen_dir/foo/grit"
955 # generated_files = [ 968 # generated_files = [
956 # "values/strings.xml" 969 # "values/strings.xml"
957 # ] 970 # ]
958 # } 971 # }
959 template("java_strings_grd_prebuilt") { 972 template("java_strings_grd_prebuilt") {
960 set_sources_assignment_filter([]) 973 set_sources_assignment_filter([])
961 forward_variables_from(invoker, [ "testonly" ]) 974 forward_variables_from(invoker, [ "testonly" ])
962 975
963 base_path = "$target_gen_dir/$target_name" 976 base_path = "$target_gen_dir/$target_name"
964 resources_zip = base_path + ".resources.zip" 977
978 # JUnit tests use resource zip files. These must not be put in gen/
979 # directory or they will not be available to tester bots.
980 _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir)
981 resources_zip = "${root_out_dir}/resource_zips/${_resources_zip_rebased_path }/${target_name}.resources.zip"
965 build_config = base_path + ".build_config" 982 build_config = base_path + ".build_config"
966 983
967 build_config_target_name = "${target_name}__build_config" 984 build_config_target_name = "${target_name}__build_config"
968 zip_target_name = "${target_name}__zip" 985 zip_target_name = "${target_name}__zip"
969 final_target_name = target_name 986 final_target_name = target_name
970 987
971 write_build_config(build_config_target_name) { 988 write_build_config(build_config_target_name) {
972 type = "android_resources" 989 type = "android_resources"
973 } 990 }
974 991
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 # } 1526 # }
1510 template("android_apk") { 1527 template("android_apk") {
1511 set_sources_assignment_filter([]) 1528 set_sources_assignment_filter([])
1512 forward_variables_from(invoker, [ "testonly" ]) 1529 forward_variables_from(invoker, [ "testonly" ])
1513 1530
1514 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) 1531 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name))
1515 assert(defined(invoker.android_manifest)) 1532 assert(defined(invoker.android_manifest))
1516 gen_dir = "$target_gen_dir/$target_name" 1533 gen_dir = "$target_gen_dir/$target_name"
1517 base_path = "$gen_dir/$target_name" 1534 base_path = "$gen_dir/$target_name"
1518 _build_config = "$target_gen_dir/$target_name.build_config" 1535 _build_config = "$target_gen_dir/$target_name.build_config"
1519 resources_zip_path = "$base_path.resources.zip" 1536
1537 # JUnit tests use resource zip files. These must not be put in gen/
1538 # directory or they will not be available to tester bots.
1539 _resources_zip_rebased_path = rebase_path(target_gen_dir, root_gen_dir)
1540 resources_zip_path = "${root_out_dir}/resource_zips/${_resources_zip_rebased _path}/${target_name}.resources.zip"
1520 _all_resources_zip_path = "$base_path.resources.all.zip" 1541 _all_resources_zip_path = "$base_path.resources.all.zip"
1521 _jar_path = "$base_path.jar" 1542 _jar_path = "$base_path.jar"
1522 _lib_dex_path = "$base_path.dex.jar" 1543 _lib_dex_path = "$base_path.dex.jar"
1523 _rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir) 1544 _rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir)
1524 _template_name = target_name 1545 _template_name = target_name
1525 if (defined(invoker.java_files)) { 1546 if (defined(invoker.java_files)) {
1526 _java_sources_file = "$base_path.sources" 1547 _java_sources_file = "$base_path.sources"
1527 } 1548 }
1528 1549
1529 enable_multidex = 1550 enable_multidex =
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 # because in practice they seem to contain classes required to be in the 2937 # because in practice they seem to contain classes required to be in the
2917 # classpath. 2938 # classpath.
2918 deps += _subjar_targets 2939 deps += _subjar_targets
2919 } 2940 }
2920 if (defined(_res_target_name)) { 2941 if (defined(_res_target_name)) {
2921 deps += [ ":$_res_target_name" ] 2942 deps += [ ":$_res_target_name" ]
2922 } 2943 }
2923 } 2944 }
2924 } 2945 }
2925 } 2946 }
OLDNEW
« no previous file with comments | « build/android/lint/suppressions.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698