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', |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 'R_package%':'', | 66 'R_package%':'', |
| 67 'additional_res_dirs': [], | 67 'additional_res_dirs': [], |
| 68 'additional_res_packages': [], | 68 'additional_res_packages': [], |
| 69 'is_test_apk%': 0, | 69 'is_test_apk%': 0, |
| 70 'java_strings_grd%': '', | 70 'java_strings_grd%': '', |
| 71 'library_manifest_paths' : [], | 71 'library_manifest_paths' : [], |
| 72 'resource_input_paths': [], | 72 'resource_input_paths': [], |
| 73 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 73 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
| 74 'asset_location%': '<(intermediate_dir)/assets', | 74 'asset_location%': '<(intermediate_dir)/assets', |
| 75 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | 75 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
| 76 'compile_input_paths': [ ], | |
| 77 'ordered_libraries_path': '<(intermediate_dir)/native_libraries.json', | |
|
Yaron
2013/03/29 20:37:32
Nit: how bout ordered_libraries_file? This is a pa
cjhopman
2013/03/29 22:29:31
Done.
| |
| 78 'native_libraries_template': '<(DEPTH)/content/public/android/java/templates /NativeLibraries.template', | |
|
Yaron
2013/03/29 20:37:32
build/ shouldn't refer to content. Also, we'll pro
cjhopman
2013/03/29 22:29:31
Done.
| |
| 79 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', | |
| 80 'native_libraries_java_path': '<(intermediate_dir)/native_libraries_java/Nat iveLibraries.java', | |
|
Yaron
2013/03/29 20:37:32
use |naive_libraries_java_dir|
cjhopman
2013/03/29 22:29:31
Done.
| |
| 81 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st amp', | |
| 82 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/ ', | |
| 83 'native_libraries_template_data_path': '<(native_libraries_template_data_dir )/native_libraries_array.h', | |
| 84 'native_libraries_template_data_stamp': '<(intermediate_dir)/native_librarie s_template_data.stamp', | |
| 76 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 85 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| 77 'jar_stamp': '<(intermediate_dir)/jar.stamp', | 86 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
| 78 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | 87 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
| 79 'classes_dir': '<(intermediate_dir)/classes', | 88 'classes_dir': '<(intermediate_dir)/classes', |
| 80 'javac_includes': [], | 89 'javac_includes': [], |
| 81 'jar_excluded_classes': [], | 90 'jar_excluded_classes': [], |
| 82 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 91 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 83 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 92 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
| 84 'dex_path': '<(intermediate_dir)/classes.dex', | 93 'dex_path': '<(intermediate_dir)/classes.dex', |
| 85 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', | 94 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 }], | 136 }], |
| 128 ['R_package != ""', { | 137 ['R_package != ""', { |
| 129 'variables': { | 138 'variables': { |
| 130 # We generate R.java in package R_package (in addition to the package | 139 # We generate R.java in package R_package (in addition to the package |
| 131 # listed in the AndroidManifest.xml, which is unavoidable). | 140 # listed in the AndroidManifest.xml, which is unavoidable). |
| 132 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], | 141 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], |
| 133 'additional_res_packages': ['<(R_package)'], | 142 'additional_res_packages': ['<(R_package)'], |
| 134 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], | 143 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], |
| 135 }, | 144 }, |
| 136 }], | 145 }], |
| 146 ['native_libs_paths != []', { | |
| 147 'variables': { | |
| 148 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], | |
| 149 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], | |
| 150 }, | |
| 151 'actions': [ | |
| 152 { | |
| 153 'action_name': 'ordered_libraries_<(_target_name)', | |
| 154 'message': 'Writing dependency ordered libraries for <(_target_name).' , | |
| 155 'inputs': [ | |
| 156 '<(DEPTH)/build/android/pylib/build_utils.py', | |
| 157 '<(DEPTH)/build/android/write_ordered_libraries.py', | |
| 158 '<@(native_libs_paths)', | |
| 159 ], | |
| 160 'outputs': [ | |
| 161 '<(ordered_libraries_path)', | |
| 162 ], | |
| 163 'action': [ | |
| 164 'python', '<(DEPTH)/build/android/write_ordered_libraries.py', | |
| 165 '--input-libraries=<(native_libs_paths)', | |
| 166 '--output=<(ordered_libraries_path)', | |
| 167 ], | |
| 168 }, | |
| 169 { | |
| 170 'action_name': 'native_libraries_template_data_<(_target_name)', | |
| 171 'message': 'Creating native_libraries_list.h for <(_target_name).', | |
| 172 'inputs': [ | |
| 173 '<(DEPTH)/build/android/pylib/build_utils.py', | |
| 174 '<(DEPTH)/build/android/create_native_libraries_header.py', | |
| 175 '<(ordered_libraries_path)', | |
| 176 ], | |
| 177 'outputs': [ | |
| 178 '<(native_libraries_template_data_stamp)', | |
| 179 ], | |
| 180 'action': [ | |
| 181 'python', '<(DEPTH)/build/android/create_native_libraries_header.py' , | |
| 182 '--ordered-libraries=<(ordered_libraries_path)', | |
| 183 '--output=<(native_libraries_template_data_path)', | |
| 184 '--stamp=<(native_libraries_template_data_stamp)', | |
| 185 ], | |
| 186 }, | |
| 187 { | |
| 188 'action_name': 'native_libraries_<(_target_name)', | |
| 189 'message': 'Creating NativeLibraries.java for <(_target_name).', | |
| 190 'inputs': [ | |
| 191 '<(DEPTH)/build/android/pylib/build_utils.py', | |
| 192 '<(DEPTH)/build/android/gcc_preprocess.py', | |
| 193 '<(native_libraries_template_data_stamp)', | |
| 194 '<(native_libraries_template)', | |
| 195 ], | |
| 196 'outputs': [ | |
| 197 '<(native_libraries_java_stamp)', | |
| 198 ], | |
| 199 'action': [ | |
| 200 'python', '<(DEPTH)/build/android/gcc_preprocess.py', | |
| 201 '--include-path=<(native_libraries_template_data_dir)', | |
| 202 '--output=<(native_libraries_java_path)', | |
| 203 '--template=<(native_libraries_template)', | |
| 204 '--stamp=<(native_libraries_java_stamp)', | |
| 205 ], | |
| 206 }, | |
| 207 ], | |
| 208 }], # native_libs_paths != [] | |
| 137 ['java_strings_grd != ""', { | 209 ['java_strings_grd != ""', { |
| 138 'variables': { | 210 'variables': { |
| 139 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit ', | 211 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit ', |
| 140 'additional_res_dirs': ['<(res_grit_dir)'], | 212 'additional_res_dirs': ['<(res_grit_dir)'], |
| 141 # grit_grd_file is used by grit_action.gypi, included below. | 213 # grit_grd_file is used by grit_action.gypi, included below. |
| 142 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', | 214 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', |
| 143 'resource_input_paths': [ | 215 'resource_input_paths': [ |
| 144 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir )" <(grit_grd_file))' | 216 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir )" <(grit_grd_file))' |
| 145 ], | 217 ], |
| 146 }, | 218 }, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 ], | 288 ], |
| 217 }, | 289 }, |
| 218 'inputs': [ | 290 'inputs': [ |
| 219 '<(DEPTH)/build/android/pylib/build_utils.py', | 291 '<(DEPTH)/build/android/pylib/build_utils.py', |
| 220 '<(DEPTH)/build/android/javac.py', | 292 '<(DEPTH)/build/android/javac.py', |
| 221 # If there is a separate find for additional_src_dirs, it will find the | 293 # If there is a separate find for additional_src_dirs, it will find the |
| 222 # wrong .java files when additional_src_dirs is empty. | 294 # wrong .java files when additional_src_dirs is empty. |
| 223 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 295 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
| 224 '>@(input_jars_paths)', | 296 '>@(input_jars_paths)', |
| 225 '<(codegen_stamp)', | 297 '<(codegen_stamp)', |
| 298 '>@(compile_input_paths)', | |
| 226 ], | 299 ], |
| 227 'outputs': [ | 300 'outputs': [ |
| 228 '<(compile_stamp)', | 301 '<(compile_stamp)', |
| 229 ], | 302 ], |
| 230 'action': [ | 303 'action': [ |
| 231 'python', '<(DEPTH)/build/android/javac.py', | 304 'python', '<(DEPTH)/build/android/javac.py', |
| 232 '--output-dir=<(classes_dir)', | 305 '--output-dir=<(classes_dir)', |
| 233 '--classpath=>(input_jars_paths) <(android_sdk_jar)', | 306 '--classpath=>(input_jars_paths) <(android_sdk_jar)', |
| 234 '--src-dirs=>(all_src_dirs)', | 307 '--src-dirs=>(all_src_dirs)', |
| 235 '--javac-includes=<(javac_includes)', | 308 '--javac-includes=<(javac_includes)', |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 | 462 |
| 390 # Add list of inputs to the command line, so if inputs change | 463 # Add list of inputs to the command line, so if inputs change |
| 391 # (e.g. if a Java file is removed), the command will be re-run. | 464 # (e.g. if a Java file is removed), the command will be re-run. |
| 392 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 465 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 393 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 466 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 394 | 467 |
| 395 ] | 468 ] |
| 396 }, | 469 }, |
| 397 ], | 470 ], |
| 398 } | 471 } |
| OLD | NEW |