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("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
8 import("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
10 | 10 |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 # chromium_code: If true, extra analysis warning/errors will be enabled. | 915 # chromium_code: If true, extra analysis warning/errors will be enabled. |
916 # jar_excluded_patterns: List of patterns of .class files to exclude from the | 916 # jar_excluded_patterns: List of patterns of .class files to exclude from the |
917 # final jar. | 917 # final jar. |
918 # | 918 # |
919 # proguard_preprocess: If true, proguard preprocessing will be run. This can | 919 # proguard_preprocess: If true, proguard preprocessing will be run. This can |
920 # be used to remove unwanted parts of the library. | 920 # be used to remove unwanted parts of the library. |
921 # proguard_config: Path to the proguard config for preprocessing. | 921 # proguard_config: Path to the proguard config for preprocessing. |
922 # | 922 # |
923 # dex_path: If set, the resulting .dex.jar file will be placed under this | 923 # dex_path: If set, the resulting .dex.jar file will be placed under this |
924 # path. | 924 # path. |
925 # standalone_dex_path: If set, a standalone .dex.jar containing the code from | |
926 # the library and all dependencies will be placed under this path. | |
927 # | 925 # |
928 # | 926 # |
929 # Example | 927 # Example |
930 # android_library("foo_java") { | 928 # android_library("foo_java") { |
931 # java_files = [ | 929 # java_files = [ |
932 # "android/org/chromium/foo/Foo.java", | 930 # "android/org/chromium/foo/Foo.java", |
933 # "android/org/chromium/foo/FooInterface.java", | 931 # "android/org/chromium/foo/FooInterface.java", |
934 # "android/org/chromium/foo/FooService.java", | 932 # "android/org/chromium/foo/FooService.java", |
935 # ] | 933 # ] |
936 # deps = [ | 934 # deps = [ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 } | 977 } |
980 if (defined(invoker.testonly)) { | 978 if (defined(invoker.testonly)) { |
981 testonly = invoker.testonly | 979 testonly = invoker.testonly |
982 } | 980 } |
983 if (defined(invoker.visibility)) { | 981 if (defined(invoker.visibility)) { |
984 visibility = invoker.visibility | 982 visibility = invoker.visibility |
985 } | 983 } |
986 if (defined(invoker.dex_path)) { | 984 if (defined(invoker.dex_path)) { |
987 dex_path = invoker.dex_path | 985 dex_path = invoker.dex_path |
988 } | 986 } |
989 if (defined(invoker.standalone_dex_path)) { | |
990 standalone_dex_path = invoker.standalone_dex_path | |
991 } | |
992 | 987 |
993 supports_android = true | 988 supports_android = true |
994 requires_android = true | 989 requires_android = true |
995 | 990 |
996 if (!defined(jar_excluded_patterns)) { | 991 if (!defined(jar_excluded_patterns)) { |
997 jar_excluded_patterns = [] | 992 jar_excluded_patterns = [] |
998 } | 993 } |
999 jar_excluded_patterns += [ | 994 jar_excluded_patterns += [ |
1000 "*/R.class", | 995 "*/R.class", |
1001 "*/R##*.class", | 996 "*/R##*.class", |
1002 "*/Manifest.class", | 997 "*/Manifest.class", |
1003 "*/Manifest##*.class", | 998 "*/Manifest##*.class", |
1004 ] | 999 ] |
1005 } | 1000 } |
1006 } | 1001 } |
1007 | 1002 |
| 1003 # Declare a target that packages a set of Java dependencies into a standalone |
| 1004 # .dex.jar. |
| 1005 # |
| 1006 # Variables |
| 1007 # deps: specifies the dependencies of this target. Android libraries in deps |
| 1008 # will be packaged into the resulting .dex.jar file. |
| 1009 # dex_path: location at which the output file will be put |
| 1010 template("android_standalone_library") { |
| 1011 deps_dex(target_name) { |
| 1012 deps = invoker.deps |
| 1013 dex_path = invoker.dex_path |
| 1014 } |
| 1015 } |
| 1016 |
1008 # Declare an Android library target for a prebuilt jar | 1017 # Declare an Android library target for a prebuilt jar |
1009 # | 1018 # |
1010 # This target creates an Android library containing java code and Android | 1019 # This target creates an Android library containing java code and Android |
1011 # resources. | 1020 # resources. |
1012 # | 1021 # |
1013 # Variables | 1022 # Variables |
1014 # deps: Specifies the dependencies of this target. Java targets in this list | 1023 # deps: Specifies the dependencies of this target. Java targets in this list |
1015 # will be added to the javac classpath. Android resources in dependencies | 1024 # will be added to the javac classpath. Android resources in dependencies |
1016 # will be used when building this library. | 1025 # will be used when building this library. |
1017 # jar_path: Path to the prebuilt jar. | 1026 # jar_path: Path to the prebuilt jar. |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 | 1401 |
1393 if (_native_libs != []) { | 1402 if (_native_libs != []) { |
1394 native_libs_dir = _native_libs_dir | 1403 native_libs_dir = _native_libs_dir |
1395 deps += [ ":${_template_name}__prepare_native" ] | 1404 deps += [ ":${_template_name}__prepare_native" ] |
1396 } | 1405 } |
1397 } | 1406 } |
1398 | 1407 |
1399 group(target_name) { | 1408 group(target_name) { |
1400 deps = final_deps | 1409 deps = final_deps |
1401 if (defined(invoker.datadeps)) { | 1410 if (defined(invoker.datadeps)) { |
1402 # TODO(cjhopman): Fix this when group datadeps works. | 1411 datadeps = invoker.datadeps |
1403 deps += invoker.datadeps | |
1404 } | 1412 } |
1405 } | 1413 } |
1406 } | 1414 } |
1407 | 1415 |
1408 # Declare an Android gtest apk | 1416 # Declare an Android gtest apk |
1409 # | 1417 # |
1410 # This target creates an Android apk for running gtest-based unittests. | 1418 # This target creates an Android apk for running gtest-based unittests. |
1411 # | 1419 # |
1412 # Variables | 1420 # Variables |
1413 # deps: Specifies the dependencies of this target. These will be passed to | 1421 # deps: Specifies the dependencies of this target. These will be passed to |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 deps = [ | 1456 deps = [ |
1449 "//base:base_java", | 1457 "//base:base_java", |
1450 ] | 1458 ] |
1451 if (defined(invoker.deps)) { | 1459 if (defined(invoker.deps)) { |
1452 deps += invoker.deps | 1460 deps += invoker.deps |
1453 } | 1461 } |
1454 datadeps = [ | 1462 datadeps = [ |
1455 "//tools/android/forwarder2", | 1463 "//tools/android/forwarder2", |
1456 "//tools/android/md5sum", | 1464 "//tools/android/md5sum", |
1457 ] | 1465 ] |
| 1466 if (defined(invoker.datadeps)) { |
| 1467 datadeps += invoker.datadeps |
| 1468 } |
1458 } | 1469 } |
1459 } | 1470 } |
1460 | 1471 |
1461 # Generate .java files from .aidl files. | 1472 # Generate .java files from .aidl files. |
1462 # | 1473 # |
1463 # This target will store the .java files in a srcjar and should be included in | 1474 # This target will store the .java files in a srcjar and should be included in |
1464 # an android_library or android_apk's srcjar_deps. | 1475 # an android_library or android_apk's srcjar_deps. |
1465 # | 1476 # |
1466 # Variables | 1477 # Variables |
1467 # sources: Paths to .aidl files to compile. | 1478 # sources: Paths to .aidl files to compile. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 # TODO(GYP): implement this. | 1687 # TODO(GYP): implement this. |
1677 template("uiautomator_test") { | 1688 template("uiautomator_test") { |
1678 if (defined(invoker.testonly)) { | 1689 if (defined(invoker.testonly)) { |
1679 testonly = invoker.testonly | 1690 testonly = invoker.testonly |
1680 } | 1691 } |
1681 assert(target_name != "") | 1692 assert(target_name != "") |
1682 assert(invoker.deps != [] || true) | 1693 assert(invoker.deps != [] || true) |
1683 group(target_name) { | 1694 group(target_name) { |
1684 } | 1695 } |
1685 } | 1696 } |
OLD | NEW |