| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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/buildflag_header.gni") | 5 import("//build/buildflag_header.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/android/rules.gni") | 7 import("//build/config/android/rules.gni") |
| 8 import("//build/util/process_version.gni") | 8 import("//build/util/process_version.gni") |
| 9 import("//build/util/version.gni") | 9 import("//build/util/version.gni") |
| 10 import("//testing/test.gni") | 10 import("//testing/test.gni") |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 rebase_path(_output_jar, root_build_dir), | 813 rebase_path(_output_jar, root_build_dir), |
| 814 ] | 814 ] |
| 815 | 815 |
| 816 deps = [ | 816 deps = [ |
| 817 ":extract_cronet_jars", | 817 ":extract_cronet_jars", |
| 818 ] | 818 ] |
| 819 } | 819 } |
| 820 | 820 |
| 821 template("jar_src") { | 821 template("jar_src") { |
| 822 action(target_name) { | 822 action(target_name) { |
| 823 _rebased_src_dirs = rebase_path(invoker.src_dirs, root_build_dir) | 823 _rebased_src_search_dirs = |
| 824 rebase_path(invoker.src_search_dirs, root_build_dir) |
| 824 | 825 |
| 825 script = "//components/cronet/tools/jar_src.py" | 826 script = "//components/cronet/tools/jar_src.py" |
| 826 depfile = "$target_gen_dir/$target_name.d" | 827 depfile = "$target_gen_dir/$target_name.d" |
| 827 outputs = [ | 828 outputs = [ |
| 828 invoker.jar_path, | 829 invoker.jar_path, |
| 829 ] | 830 ] |
| 830 args = [ | 831 args = [ |
| 831 "--src-dir=${_rebased_src_dirs}", | 832 "--src-search-dirs=${_rebased_src_search_dirs}", |
| 832 "--jar-path", | 833 "--jar-path", |
| 833 rebase_path(invoker.jar_path, root_build_dir), | 834 rebase_path(invoker.jar_path, root_build_dir), |
| 834 "--depfile", | 835 "--depfile", |
| 835 rebase_path(depfile, root_build_dir), | 836 rebase_path(depfile, root_build_dir), |
| 836 ] | 837 ] |
| 837 | 838 |
| 839 deps = [] |
| 840 if (defined(invoker.deps)) { |
| 841 deps += invoker.deps |
| 842 } |
| 843 |
| 844 _src_jars = [] |
| 845 |
| 846 # Add src-jar files that are listed in "src_jars". |
| 838 if (defined(invoker.src_jars)) { | 847 if (defined(invoker.src_jars)) { |
| 839 inputs = invoker.src_jars | |
| 840 _rebased_src_jars = rebase_path(invoker.src_jars, root_build_dir) | 848 _rebased_src_jars = rebase_path(invoker.src_jars, root_build_dir) |
| 841 args += [ "--src-jar=${_rebased_src_jars}" ] | 849 _src_jars += _rebased_src_jars |
| 842 } | 850 } |
| 843 deps = [ | 851 |
| 844 ":effective_connection_type_java", | 852 # Add src-jar files that are generated by dependencies in "srcjar_deps". |
| 845 ] | 853 if (defined(invoker.srcjar_deps)) { |
| 854 foreach(_srcjar_dep, invoker.srcjar_deps) { |
| 855 _dep_gen_dir = get_label_info(_srcjar_dep, "target_gen_dir") |
| 856 _dep_name = get_label_info(_srcjar_dep, "name") |
| 857 _src_jars += rebase_path([ "$_dep_gen_dir/$_dep_name.srcjar" ]) |
| 858 deps += [ _srcjar_dep ] |
| 859 } |
| 860 } |
| 861 |
| 862 # Create the list of all source files that are given in "src_files". |
| 863 _src_files = [] |
| 864 if (defined(invoker.src_files)) { |
| 865 _src_files += invoker.src_files |
| 866 } |
| 867 |
| 868 # Handle "source_deps". |
| 869 _src_list_files = [] |
| 870 if (defined(invoker.source_deps)) { |
| 871 foreach(_source_dep, invoker.source_deps) { |
| 872 _dep_gen_dir = get_label_info(_source_dep, "target_gen_dir") |
| 873 _dep_name = get_label_info(_source_dep, "name") |
| 874 _src_list_files += rebase_path([ "$_dep_gen_dir/$_dep_name.sources" ]) |
| 875 deps += [ _source_dep ] |
| 876 } |
| 877 } |
| 878 args += [ "--src-jar=${_src_jars}" ] |
| 879 args += [ "--src-files=${_src_files}" ] |
| 880 args += [ "--src-list-files=${_src_list_files}" ] |
| 881 |
| 882 inputs = _src_jars |
| 883 inputs += _src_files |
| 884 inputs += _src_list_files |
| 846 } | 885 } |
| 847 } | 886 } |
| 848 | 887 |
| 849 jar_src("jar_cronet_api_source") { | 888 jar_src("jar_cronet_api_source") { |
| 850 src_dirs = [ "api/src" ] | 889 src_search_dirs = [ "api/src" ] |
| 851 | 890 |
| 852 # Include generated Java files which should be a part of the API. | 891 # Include generated Java files which should be a part of the API. |
| 853 src_jars = [ "$root_gen_dir/components/cronet/android/effective_connection_typ
e_java.srcjar" ] | 892 srcjar_deps = [ ":effective_connection_type_java" ] |
| 893 source_deps = [ ":cronet_api" ] |
| 854 jar_path = "$_package_dir/cronet_api-src.jar" | 894 jar_path = "$_package_dir/cronet_api-src.jar" |
| 855 } | 895 } |
| 856 | 896 |
| 857 jar_src("jar_cronet_sample_source") { | 897 zip("jar_cronet_sample_source") { |
| 858 src_dirs = [ "sample" ] | 898 inputs = [ |
| 859 jar_path = "$_package_dir/cronet-sample-src.jar" | 899 "sample/AndroidManifest.xml", |
| 900 "sample/javatests/AndroidManifest.xml", |
| 901 "sample/javatests/proguard.cfg", |
| 902 "sample/javatests/src/org/chromium/cronet_sample_apk/Criteria.java", |
| 903 "sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java", |
| 904 "sample/README", |
| 905 "sample/res/layout/activity_main.xml", |
| 906 "sample/res/layout/dialog_url.xml", |
| 907 "sample/res/values/dimens.xml", |
| 908 "sample/res/values/strings.xml", |
| 909 "sample/src/org/chromium/cronet_sample_apk/CronetSampleActivity.java", |
| 910 "sample/src/org/chromium/cronet_sample_apk/CronetSampleApplication.java", |
| 911 ] |
| 912 output = "$_package_dir/cronet-sample-src.jar" |
| 913 base_dir = "sample" |
| 860 } | 914 } |
| 861 | 915 |
| 862 jar_src("jar_cronet_other_source") { | 916 jar_src("jar_cronet_other_source") { |
| 863 src_dirs = [ | 917 src_search_dirs = [ |
| 864 "//base/android/java/src", | 918 "//base/android/java/src", |
| 865 "//components/cronet/android/java/src", | 919 "//components/cronet/android/java/src", |
| 866 "//net/android/java/src", | 920 "//net/android/java/src", |
| 867 "//url/android/java/src", | 921 "//url/android/java/src", |
| 868 ] | 922 ] |
| 923 source_deps = [ |
| 924 ":cronet_java", |
| 925 "//base:base_java", |
| 926 "//net/android:net_java", |
| 927 "//url:url_java", |
| 928 ] |
| 869 jar_path = "$_package_dir/cronet-src.jar" | 929 jar_path = "$_package_dir/cronet-src.jar" |
| 870 } | 930 } |
| 871 | 931 |
| 872 action("generate_licenses") { | 932 action("generate_licenses") { |
| 873 _license_path = "$_package_dir/LICENSE" | 933 _license_path = "$_package_dir/LICENSE" |
| 874 | 934 |
| 875 script = "//components/cronet/tools/cronet_licenses.py" | 935 script = "//components/cronet/tools/cronet_licenses.py" |
| 876 outputs = [ | 936 outputs = [ |
| 877 _license_path, | 937 _license_path, |
| 878 ] | 938 ] |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 ":jar_cronet_api_source", | 1067 ":jar_cronet_api_source", |
| 1008 ":jar_cronet_other_source", | 1068 ":jar_cronet_other_source", |
| 1009 ":jar_cronet_sample_source", | 1069 ":jar_cronet_sample_source", |
| 1010 ":repackage_extracted_jars", | 1070 ":repackage_extracted_jars", |
| 1011 ] | 1071 ] |
| 1012 if (current_cpu == "arm" && arm_version == 7) { | 1072 if (current_cpu == "arm" && arm_version == 7) { |
| 1013 deps += [ ":enforce_no_neon" ] | 1073 deps += [ ":enforce_no_neon" ] |
| 1014 } | 1074 } |
| 1015 } | 1075 } |
| 1016 } | 1076 } |
| OLD | NEW |