| 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', |
| 11 # 'type': 'none', | 11 # 'type': 'none', |
| 12 # 'variables': { | 12 # 'variables': { |
| 13 # 'package_name': 'my_package', | 13 # 'package_name': 'my_package', |
| 14 # 'apk_name': 'MyPackage', | 14 # 'apk_name': 'MyPackage', |
| 15 # 'java_in_dir': 'path/to/package/root', | 15 # 'java_in_dir': 'path/to/package/root', |
| 16 # 'resource_dir': 'res', | 16 # 'resource_dir': 'res', |
| 17 # }, | 17 # }, |
| 18 # 'includes': ['path/to/this/gypi/file'], | 18 # 'includes': ['path/to/this/gypi/file'], |
| 19 # } | 19 # } |
| 20 # | 20 # |
| 21 # If you have package_name="content_shell" and | 21 # Note that this assumes that there's an ant buildfile <package_name>_apk.xml in |
| 22 # java_in_dir. So, if you have package_name="content_shell" and |
| 22 # java_in_dir="content/shell/android/java" you should have a directory structure | 23 # java_in_dir="content/shell/android/java" you should have a directory structure |
| 23 # like: | 24 # like: |
| 24 # | 25 # |
| 26 # content/shell/android/java/content_shell_apk.xml |
| 25 # content/shell/android/java/src/org/chromium/base/Foo.java | 27 # content/shell/android/java/src/org/chromium/base/Foo.java |
| 26 # content/shell/android/java/src/org/chromium/base/Bar.java | 28 # content/shell/android/java/src/org/chromium/base/Bar.java |
| 27 # | 29 # |
| 28 # Required variables: | 30 # Required variables: |
| 29 # package_name - Used to name the intermediate output directory and in the | 31 # package_name - Used to name the intermediate output directory and in the |
| 30 # names of some output files. | 32 # names of some output files. |
| 31 # apk_name - The final apk will be named <apk_name>.apk | 33 # apk_name - The final apk will be named <apk_name>.apk |
| 32 # java_in_dir - The top-level java directory. The src should be in | 34 # java_in_dir - The top-level java directory. The src should be in |
| 33 # <java_in_dir>/src. | 35 # <java_in_dir>/src. |
| 34 # Optional/automatic variables: | 36 # Optional/automatic variables: |
| 35 # additional_input_paths - These paths will be included in the 'inputs' list to | 37 # additional_input_paths - These paths will be included in the 'inputs' list to |
| 36 # ensure that this target is rebuilt when one of these paths changes. | 38 # ensure that this target is rebuilt when one of these paths changes. |
| 37 # additional_res_dirs - Additional directories containing Android resources. | 39 # additional_res_dirs - Additional directories containing Android resources. |
| 38 # additional_res_packages - Package names of the R.java files corresponding to | 40 # additional_res_packages - Package names of the R.java files corresponding to |
| 39 # each directory in additional_res_dirs. | 41 # each directory in additional_res_dirs. |
| 40 # additional_src_dirs - Additional directories with .java files to be compiled | 42 # additional_src_dirs - Additional directories with .java files to be compiled |
| 41 # and included in the output of this target. | 43 # and included in the output of this target. |
| 42 # asset_location - The absolute path to the directory where assets are located | 44 # asset_location - The directory where assets are located (default: |
| 43 # (default: <(ant_build_out)/<(package_name)/assets). | 45 # <PRODUCT_DIR>/<package_name>/assets). |
| 44 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 46 # 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 | 47 # 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 | 48 # target's dependencies. The .java files in these directories are not |
| 47 # included in the 'inputs' list (unlike additional_src_dirs). | 49 # included in the 'inputs' list (unlike additional_src_dirs). |
| 48 # input_jars_paths - The path to jars to be included in the classpath. This | 50 # 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. | 51 # should be filled automatically by depending on the appropriate targets. |
| 50 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 52 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
| 51 # dependencies from being re-included. | 53 # dependencies from being re-included. |
| 52 # native_libs_paths - The path to any native library to be included in this | 54 # native_libs_paths - The path to any native library to be included in this |
| 53 # target. This should be a path in <(SHARED_LIB_DIR). A stripped copy of | 55 # target. This should be a path in <(SHARED_LIB_DIR). A stripped copy of |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 '-buildfile', | 217 '-buildfile', |
| 216 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 218 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| 217 | 219 |
| 218 # Specify CONFIGURATION_NAME as the target for ant to build. The | 220 # Specify CONFIGURATION_NAME as the target for ant to build. The |
| 219 # buildfile will then build the appropriate SDK tools target. | 221 # buildfile will then build the appropriate SDK tools target. |
| 220 '<(CONFIGURATION_NAME)', | 222 '<(CONFIGURATION_NAME)', |
| 221 ] | 223 ] |
| 222 }, | 224 }, |
| 223 ], | 225 ], |
| 224 } | 226 } |
| OLD | NEW |