Chromium Code Reviews| 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 # Note that this assumes that there's an ant buildfile <package_name>_apk.xml in | 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. So, if you have package_name="content_shell" and |
| 23 # 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 |
| 24 # like: | 24 # like: |
| 25 # | 25 # |
| 26 # content/shell/android/java/content_shell_apk.xml | 26 # content/shell/android/java/content_shell_apk.xml |
| 27 # content/shell/android/java/src/chromium/base/Foo.java | 27 # content/shell/android/java/src/org/chromium/base/Foo.java |
| 28 # content/shell/android/java/src/chromium/base/Bar.java | 28 # content/shell/android/java/src/org/chromium/base/Bar.java |
| 29 # | 29 # |
| 30 # Required variables: | 30 # Required variables: |
| 31 # 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 |
| 32 # names of some output files. | 32 # names of some output files. |
| 33 # apk_name - The final apk will be named <apk_name>.apk | 33 # apk_name - The final apk will be named <apk_name>.apk |
| 34 # 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 |
| 35 # <java_in_dir>/src. | 35 # <java_in_dir>/src. |
| 36 # Optional/automatic variables: | 36 # Optional/automatic variables: |
| 37 # 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 |
| 38 # 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. |
| 39 # additional_res_dirs - Additional directories containing Android resources. | |
| 40 # additional_res_packages - Package names of the R.java files corresponding to | |
| 41 # each directory in additional_res_dirs, as a semicolon-separated list. | |
|
cjhopman
2012/11/09 22:21:30
This is a list now, not semicolon-separated
newt (away)
2012/11/09 23:05:35
Done.
| |
| 39 # additional_src_dirs - Additional directories with .java files to be compiled | 42 # additional_src_dirs - Additional directories with .java files to be compiled |
| 40 # and included in the output of this target. | 43 # and included in the output of this target. |
| 41 # asset_location - The directory where assets are located (default: | 44 # asset_location - The directory where assets are located (default: |
| 42 # <PRODUCT_DIR>/<package_name>/assets). | 45 # <PRODUCT_DIR>/<package_name>/assets). |
| 43 # 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 |
| 44 # 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 |
| 45 # target's dependencies. The .java files in these directories are not | 48 # target's dependencies. The .java files in these directories are not |
| 46 # included in the 'inputs' list (unlike additional_src_dirs). | 49 # included in the 'inputs' list (unlike additional_src_dirs). |
| 47 # 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 |
| 48 # should be filled automatically by depending on the appropriate targets. | 51 # should be filled automatically by depending on the appropriate targets. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 59 'additional_input_paths': [], | 62 'additional_input_paths': [], |
| 60 'input_jars_paths': [], | 63 'input_jars_paths': [], |
| 61 'additional_src_dirs': [], | 64 'additional_src_dirs': [], |
| 62 'generated_src_dirs': [], | 65 'generated_src_dirs': [], |
| 63 'app_manifest_version_name%': '<(android_app_version_name)', | 66 'app_manifest_version_name%': '<(android_app_version_name)', |
| 64 'app_manifest_version_code%': '<(android_app_version_code)', | 67 'app_manifest_version_code%': '<(android_app_version_code)', |
| 65 'proguard_enabled%': 'false', | 68 'proguard_enabled%': 'false', |
| 66 'proguard_flags%': '', | 69 'proguard_flags%': '', |
| 67 'native_libs_paths': [], | 70 'native_libs_paths': [], |
| 68 'manifest_package_name%': 'unknown.package.name', | 71 'manifest_package_name%': 'unknown.package.name', |
| 69 'resource_dir%':'', | 72 'resource_dir%': '', |
| 73 'additional_res_dirs': [], | |
| 74 'additional_res_packages': [], | |
| 70 }, | 75 }, |
| 71 'sources': [ | 76 'sources': [ |
| 72 '<@(native_libs_paths)' | 77 '<@(native_libs_paths)' |
| 73 ], | 78 ], |
| 74 'rules': [ | 79 'rules': [ |
| 75 { | 80 { |
| 76 'rule_name': 'copy_and_strip_native_libraries', | 81 'rule_name': 'copy_and_strip_native_libraries', |
| 77 'extension': 'so', | 82 'extension': 'so', |
| 78 'variables': { | 83 'variables': { |
| 79 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_ app_abi)/<(RULE_INPUT_ROOT).so', | 84 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_ app_abi)/<(RULE_INPUT_ROOT).so', |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 137 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| 133 '-DPRODUCT_DIR=<(ant_build_out)', | 138 '-DPRODUCT_DIR=<(ant_build_out)', |
| 134 | 139 |
| 135 '-DAPK_NAME=<(apk_name)', | 140 '-DAPK_NAME=<(apk_name)', |
| 136 '-DASSET_DIR=<(asset_location)', | 141 '-DASSET_DIR=<(asset_location)', |
| 137 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', | 142 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
| 138 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', | 143 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
| 139 '-DINPUT_JARS_PATHS=>(input_jars_paths)', | 144 '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| 140 '-DPACKAGE_NAME=<(package_name)', | 145 '-DPACKAGE_NAME=<(package_name)', |
| 141 '-DRESOURCE_DIR=<(resource_dir)', | 146 '-DRESOURCE_DIR=<(resource_dir)', |
| 147 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | |
| 148 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | |
| 142 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 149 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
| 143 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 150 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
| 144 '-DPROGUARD_FLAGS=>(proguard_flags)', | 151 '-DPROGUARD_FLAGS=>(proguard_flags)', |
| 145 '-DPROGUARD_ENABLED=>(proguard_enabled)', | 152 '-DPROGUARD_ENABLED=>(proguard_enabled)', |
| 146 | 153 |
| 147 '-Dbasedir=<(java_in_dir)', | 154 '-Dbasedir=<(java_in_dir)', |
| 148 '-buildfile', | 155 '-buildfile', |
| 149 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 156 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| 150 | 157 |
| 151 # Specify CONFIGURATION_NAME as the target for ant to build. The | 158 # Specify CONFIGURATION_NAME as the target for ant to build. The |
| 152 # buildfile will then build the appropriate SDK tools target. | 159 # buildfile will then build the appropriate SDK tools target. |
| 153 '<(CONFIGURATION_NAME)', | 160 '<(CONFIGURATION_NAME)', |
| 154 ] | 161 ] |
| 155 }, | 162 }, |
| 156 ], | 163 ], |
| 157 } | 164 } |
| OLD | NEW |