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

Side by Side Diff: components/cronet/android/BUILD.gn

Issue 2347233002: Add src_files to src_jar GN template (Closed)
Patch Set: Parse '.source' files in Python + set inputs var Created 4 years, 3 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 | « no previous file | components/cronet/tools/jar_src.py » ('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 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/version.gni") 8 import("//build/util/version.gni")
9 import("//chrome/version.gni") 9 import("//chrome/version.gni")
10 import("//testing/test.gni") 10 import("//testing/test.gni")
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 rebase_path(_output_jar, root_build_dir), 804 rebase_path(_output_jar, root_build_dir),
805 ] 805 ]
806 806
807 deps = [ 807 deps = [
808 ":extract_cronet_jars", 808 ":extract_cronet_jars",
809 ] 809 ]
810 } 810 }
811 811
812 template("jar_src") { 812 template("jar_src") {
813 action(target_name) { 813 action(target_name) {
814 _rebased_src_dirs = rebase_path(invoker.src_dirs, root_build_dir) 814 _rebased_src_search_dirs =
815 rebase_path(invoker.src_search_dirs, root_build_dir)
815 816
816 script = "//components/cronet/tools/jar_src.py" 817 script = "//components/cronet/tools/jar_src.py"
817 depfile = "$target_gen_dir/$target_name.d" 818 depfile = "$target_gen_dir/$target_name.d"
818 outputs = [ 819 outputs = [
819 invoker.jar_path, 820 invoker.jar_path,
820 ] 821 ]
821 args = [ 822 args = [
822 "--src-dir=${_rebased_src_dirs}", 823 "--src-search-dirs=${_rebased_src_search_dirs}",
823 "--jar-path", 824 "--jar-path",
824 rebase_path(invoker.jar_path, root_build_dir), 825 rebase_path(invoker.jar_path, root_build_dir),
825 "--depfile", 826 "--depfile",
826 rebase_path(depfile, root_build_dir), 827 rebase_path(depfile, root_build_dir),
827 ] 828 ]
828 829
830 deps = []
831 if (defined(invoker.deps)) {
832 deps += invoker.deps
833 }
834
835 _src_jars = []
836
837 # Add src jar files that explicitly listed in "src_jars".
829 if (defined(invoker.src_jars)) { 838 if (defined(invoker.src_jars)) {
830 inputs = invoker.src_jars
831 _rebased_src_jars = rebase_path(invoker.src_jars, root_build_dir) 839 _rebased_src_jars = rebase_path(invoker.src_jars, root_build_dir)
832 args += [ "--src-jar=${_rebased_src_jars}" ] 840 _src_jars += _rebased_src_jars
833 } 841 }
834 deps = [ 842
835 ":effective_connection_type_java", 843 # Add src jars that are implicitly listed through "srcjar_deps".
agrieve 2016/09/21 18:36:37 nit: implicitly -> explicitly?
kapishnikov 2016/09/21 18:52:33 Done. Changed to: # Add src-jar files that are ge
836 ] 844 if (defined(invoker.srcjar_deps)) {
845 foreach(_srcjar_dep, invoker.srcjar_deps) {
846 _dep_gen_dir = get_label_info(_srcjar_dep, "target_gen_dir")
847 _dep_name = get_label_info(_srcjar_dep, "name")
848 _src_jars += rebase_path([ "$_dep_gen_dir/$_dep_name.srcjar" ])
849 deps += [ _srcjar_dep ]
850 }
851 }
852
853 # Create the list of all source files that are given in "src_files".
854 _src_files = []
855 if (defined(invoker.src_files)) {
856 _src_files += invoker.src_files
857 }
858
859 # Handle "source_deps".
860 _src_list_files = []
861 if (defined(invoker.source_deps)) {
862 foreach(_source_dep, invoker.source_deps) {
863 _dep_gen_dir = get_label_info(_source_dep, "target_gen_dir")
864 _dep_name = get_label_info(_source_dep, "name")
865 _src_list_files += rebase_path([ "$_dep_gen_dir/$_dep_name.sources" ])
866 deps += [ _source_dep ]
867 }
868 }
869 args += [ "--src-jar=${_src_jars}" ]
870 args += [ "--src-files=${_src_files}" ]
871 args += [ "--src-list-files=${_src_list_files}" ]
872
873 inputs = _src_jars
874 inputs += _src_files
875 inputs += _src_list_files
837 } 876 }
838 } 877 }
839 878
840 jar_src("jar_cronet_api_source") { 879 jar_src("jar_cronet_api_source") {
841 src_dirs = [ "api/src" ] 880 src_search_dirs = [ "api/src" ]
842 881
843 # Include generated Java files which should be a part of the API. 882 # Include generated Java files which should be a part of the API.
844 src_jars = [ "$root_gen_dir/components/cronet/android/effective_connection_typ e_java.srcjar" ] 883 srcjar_deps = [ ":effective_connection_type_java" ]
884 source_deps = [ ":cronet_api" ]
845 jar_path = "$_package_dir/cronet_api-src.jar" 885 jar_path = "$_package_dir/cronet_api-src.jar"
846 } 886 }
847 887
848 jar_src("jar_cronet_sample_source") { 888 zip("jar_cronet_sample_source") {
849 src_dirs = [ "sample" ] 889 inputs = [
850 jar_path = "$_package_dir/cronet-sample-src.jar" 890 "sample/AndroidManifest.xml",
891 "sample/javatests/AndroidManifest.xml",
892 "sample/javatests/proguard.cfg",
893 "sample/javatests/src/org/chromium/cronet_sample_apk/Criteria.java",
894 "sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java",
895 "sample/README",
896 "sample/res/layout/activity_main.xml",
897 "sample/res/layout/dialog_url.xml",
898 "sample/res/values/dimens.xml",
899 "sample/res/values/strings.xml",
900 "sample/src/org/chromium/cronet_sample_apk/CronetSampleActivity.java",
901 "sample/src/org/chromium/cronet_sample_apk/CronetSampleApplication.java",
902 ]
903 output = "$_package_dir/cronet-sample-src.jar"
904 base_dir = "sample"
851 } 905 }
852 906
853 jar_src("jar_cronet_other_source") { 907 jar_src("jar_cronet_other_source") {
854 src_dirs = [ 908 src_search_dirs = [
855 "//base/android/java/src", 909 "//base/android/java/src",
856 "//components/cronet/android/java/src", 910 "//components/cronet/android/java/src",
857 "//net/android/java/src", 911 "//net/android/java/src",
858 "//url/android/java/src", 912 "//url/android/java/src",
859 ] 913 ]
914 source_deps = [
915 ":cronet_java",
916 "//base:base_java",
917 "//net/android:net_java",
918 "//url:url_java",
919 ]
860 jar_path = "$_package_dir/cronet-src.jar" 920 jar_path = "$_package_dir/cronet-src.jar"
861 } 921 }
862 922
863 action("generate_licenses") { 923 action("generate_licenses") {
864 _license_path = "$_package_dir/LICENSE" 924 _license_path = "$_package_dir/LICENSE"
865 925
866 script = "//components/cronet/tools/cronet_licenses.py" 926 script = "//components/cronet/tools/cronet_licenses.py"
867 outputs = [ 927 outputs = [
868 _license_path, 928 _license_path,
869 ] 929 ]
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 ":jar_cronet_api_source", 1058 ":jar_cronet_api_source",
999 ":jar_cronet_other_source", 1059 ":jar_cronet_other_source",
1000 ":jar_cronet_sample_source", 1060 ":jar_cronet_sample_source",
1001 ":repackage_extracted_jars", 1061 ":repackage_extracted_jars",
1002 ] 1062 ]
1003 if (current_cpu == "arm" && arm_version == 7) { 1063 if (current_cpu == "arm" && arm_version == 7) {
1004 deps += [ ":enforce_no_neon" ] 1064 deps += [ ":enforce_no_neon" ]
1005 } 1065 }
1006 } 1066 }
1007 } 1067 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/tools/jar_src.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698