| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
| 6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
| 7 # | 7 # |
| 8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
| 9 # { | 9 # { |
| 10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 # and included in the output of this target. | 41 # and included in the output of this target. |
| 42 # asset_location - The directory where assets are located (default: | 42 # asset_location - The directory where assets are located (default: |
| 43 # <PRODUCT_DIR>/<package_name>/assets). | 43 # <PRODUCT_DIR>/<package_name>/assets). |
| 44 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 44 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
| 45 # that are generated at build time. This should be set automatically by a | 45 # that are generated at build time. This should be set automatically by a |
| 46 # target's dependencies. The .java files in these directories are not | 46 # target's dependencies. The .java files in these directories are not |
| 47 # included in the 'inputs' list (unlike additional_src_dirs). | 47 # included in the 'inputs' list (unlike additional_src_dirs). |
| 48 # input_jars_paths - The path to jars to be included in the classpath. This | 48 # input_jars_paths - The path to jars to be included in the classpath. This |
| 49 # should be filled automatically by depending on the appropriate targets. | 49 # should be filled automatically by depending on the appropriate targets. |
| 50 # native_libs_paths - The path to any native library to be included in this | 50 # native_libs_paths - The path to any native library to be included in this |
| 51 # target. | 51 # target. This should be a path in <(SHARED_LIB_DIR). A stripped copy of |
| 52 # the library will be included in the apk and symbolic links to the |
| 53 # unstripped copy will be added to <(android_product_out) to enable native |
| 54 # debugging. |
| 52 | 55 |
| 53 { | 56 { |
| 54 'variables': { | 57 'variables': { |
| 55 'asset_location': '', | 58 'asset_location': '', |
| 56 'additional_input_paths': [], | 59 'additional_input_paths': [], |
| 57 'input_jars_paths': [], | 60 'input_jars_paths': [], |
| 58 'native_libs_paths': [], | |
| 59 'additional_src_dirs': [], | 61 'additional_src_dirs': [], |
| 60 'generated_src_dirs': [], | 62 'generated_src_dirs': [], |
| 63 'native_libs_paths': [], |
| 64 'manifest_package_name%': 'unknown.package.name', |
| 61 }, | 65 }, |
| 66 'sources': [ |
| 67 '<@(native_libs_paths)' |
| 68 ], |
| 69 'rules': [ |
| 70 { |
| 71 'rule_name': 'copy_and_strip_native_libraries', |
| 72 'extension': 'so', |
| 73 'variables': { |
| 74 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_
app_abi)/<(RULE_INPUT_NAME)', |
| 75 'link_dir': '<(android_product_out)/symbols/data/data/<(manifest_package
_name)/lib/', |
| 76 }, |
| 77 'outputs': [ |
| 78 '<(stripped_library_path)', |
| 79 '<(link_dir)/<(RULE_INPUT_NAME)', |
| 80 ], |
| 81 # There is no way to do 2 actions for each source library in gyp. So to |
| 82 # both strip the library and create the link in <(link_dir) a separate |
| 83 # script is required. |
| 84 'action': [ |
| 85 '<(DEPTH)/build/android/prepare_library_for_apk', |
| 86 '<(android_strip)', |
| 87 '<(RULE_INPUT_PATH)', |
| 88 '<(stripped_library_path)', |
| 89 '<(link_dir)', |
| 90 ], |
| 91 }, |
| 92 ], |
| 62 'actions': [ | 93 'actions': [ |
| 63 { | 94 { |
| 64 'action_name': 'ant_<(package_name)_apk', | 95 'action_name': 'ant_<(package_name)_apk', |
| 65 'message': 'Building <(package_name) apk.', | 96 'message': 'Building <(package_name) apk.', |
| 66 'inputs': [ | 97 'inputs': [ |
| 67 '<(java_in_dir)/AndroidManifest.xml', | 98 '<(java_in_dir)/AndroidManifest.xml', |
| 68 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 99 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| 69 '<(DEPTH)/build/android/ant/common.xml', | 100 '<(DEPTH)/build/android/ant/common.xml', |
| 70 '<(DEPTH)/build/android/ant/sdk-targets.xml', | 101 '<(DEPTH)/build/android/ant/sdk-targets.xml', |
| 71 # If there is a separate find for additonal_src_dirs, it will find the | 102 # If there is a separate find for additional_src_dirs, it will find the |
| 72 # wrong .java files when additional_src_dirs is empty. | 103 # wrong .java files when additional_src_dirs is empty. |
| 73 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 104 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
| 74 '<!@(find <(java_in_dir)/<(resource_dir) -name "*")', | 105 '<!@(find <(java_in_dir)/<(resource_dir) -name "*")', |
| 75 '>@(input_jars_paths)', | 106 '>@(input_jars_paths)', |
| 76 '>@(native_libs_paths)', | 107 '>@(native_libs_paths)', |
| 77 '>@(additional_input_paths)', | 108 '>@(additional_input_paths)', |
| 78 ], | 109 ], |
| 79 'outputs': [ | 110 'outputs': [ |
| 80 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', | 111 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', |
| 81 ], | 112 ], |
| (...skipping 18 matching lines...) Expand all Loading... |
| 100 '-DPACKAGE_NAME=<(package_name)', | 131 '-DPACKAGE_NAME=<(package_name)', |
| 101 '-DRESOURCE_DIR=<(resource_dir)', | 132 '-DRESOURCE_DIR=<(resource_dir)', |
| 102 | 133 |
| 103 '-Dbasedir=<(java_in_dir)', | 134 '-Dbasedir=<(java_in_dir)', |
| 104 '-buildfile', | 135 '-buildfile', |
| 105 '<(DEPTH)/build/android/ant/chromium-apk.xml' | 136 '<(DEPTH)/build/android/ant/chromium-apk.xml' |
| 106 ] | 137 ] |
| 107 }, | 138 }, |
| 108 ], | 139 ], |
| 109 } | 140 } |
| OLD | NEW |