| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 ['native_libs_paths != []', { | 134 ['native_libs_paths != []', { |
| 135 'variables': { | 135 'variables': { |
| 136 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], | 136 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], |
| 137 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], | 137 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], |
| 138 }, | 138 }, |
| 139 'actions': [ | 139 'actions': [ |
| 140 { | 140 { |
| 141 'action_name': 'ordered_libraries_<(_target_name)', | 141 'action_name': 'ordered_libraries_<(_target_name)', |
| 142 'message': 'Writing dependency ordered libraries for <(_target_name).'
, | 142 'message': 'Writing dependency ordered libraries for <(_target_name).'
, |
| 143 'inputs': [ | 143 'inputs': [ |
| 144 '<(DEPTH)/build/android/pylib/build_utils.py', | 144 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 145 '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', | 145 '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', |
| 146 '<@(native_libs_paths)', | 146 '<@(native_libs_paths)', |
| 147 ], | 147 ], |
| 148 'outputs': [ | 148 'outputs': [ |
| 149 '<(ordered_libraries_file)', | 149 '<(ordered_libraries_file)', |
| 150 ], | 150 ], |
| 151 'action': [ | 151 'action': [ |
| 152 'python', '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', | 152 'python', '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', |
| 153 '--input-libraries=<(native_libs_paths)', | 153 '--input-libraries=<(native_libs_paths)', |
| 154 '--readelf=<(android_readelf)', | 154 '--readelf=<(android_readelf)', |
| 155 '--output=<(ordered_libraries_file)', | 155 '--output=<(ordered_libraries_file)', |
| 156 ], | 156 ], |
| 157 }, | 157 }, |
| 158 { | 158 { |
| 159 'action_name': 'native_libraries_template_data_<(_target_name)', | 159 'action_name': 'native_libraries_template_data_<(_target_name)', |
| 160 'message': 'Creating native_libraries_list.h for <(_target_name).', | 160 'message': 'Creating native_libraries_list.h for <(_target_name).', |
| 161 'inputs': [ | 161 'inputs': [ |
| 162 '<(DEPTH)/build/android/pylib/build_utils.py', | 162 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 163 '<(DEPTH)/build/android/create_native_libraries_header.py', | 163 '<(DEPTH)/build/android/gyp/create_native_libraries_header.py', |
| 164 '<(ordered_libraries_file)', | 164 '<(ordered_libraries_file)', |
| 165 ], | 165 ], |
| 166 'outputs': [ | 166 'outputs': [ |
| 167 '<(native_libraries_template_data_stamp)', | 167 '<(native_libraries_template_data_stamp)', |
| 168 ], | 168 ], |
| 169 'action': [ | 169 'action': [ |
| 170 'python', '<(DEPTH)/build/android/create_native_libraries_header.py'
, | 170 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header
.py', |
| 171 '--ordered-libraries=<(ordered_libraries_file)', | 171 '--ordered-libraries=<(ordered_libraries_file)', |
| 172 '--output=<(native_libraries_template_data_file)', | 172 '--output=<(native_libraries_template_data_file)', |
| 173 '--stamp=<(native_libraries_template_data_stamp)', | 173 '--stamp=<(native_libraries_template_data_stamp)', |
| 174 ], | 174 ], |
| 175 }, | 175 }, |
| 176 { | 176 { |
| 177 'action_name': 'native_libraries_<(_target_name)', | 177 'action_name': 'native_libraries_<(_target_name)', |
| 178 'message': 'Creating NativeLibraries.java for <(_target_name).', | 178 'message': 'Creating NativeLibraries.java for <(_target_name).', |
| 179 'inputs': [ | 179 'inputs': [ |
| 180 '<(DEPTH)/build/android/pylib/build_utils.py', | 180 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 181 '<(DEPTH)/build/android/gcc_preprocess.py', | 181 '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
| 182 '<(native_libraries_template_data_stamp)', | 182 '<(native_libraries_template_data_stamp)', |
| 183 '<(native_libraries_template)', | 183 '<(native_libraries_template)', |
| 184 ], | 184 ], |
| 185 'outputs': [ | 185 'outputs': [ |
| 186 '<(native_libraries_java_stamp)', | 186 '<(native_libraries_java_stamp)', |
| 187 ], | 187 ], |
| 188 'action': [ | 188 'action': [ |
| 189 'python', '<(DEPTH)/build/android/gcc_preprocess.py', | 189 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
| 190 '--include-path=<(native_libraries_template_data_dir)', | 190 '--include-path=<(native_libraries_template_data_dir)', |
| 191 '--output=<(native_libraries_java_file)', | 191 '--output=<(native_libraries_java_file)', |
| 192 '--template=<(native_libraries_template)', | 192 '--template=<(native_libraries_template)', |
| 193 '--stamp=<(native_libraries_java_stamp)', | 193 '--stamp=<(native_libraries_java_stamp)', |
| 194 ], | 194 ], |
| 195 }, | 195 }, |
| 196 { | 196 { |
| 197 'action_name': 'strip_native_libraries', | 197 'action_name': 'strip_native_libraries', |
| 198 'message': 'Stripping libraries for <(_target_name)', | 198 'message': 'Stripping libraries for <(_target_name)', |
| 199 'inputs': [ | 199 'inputs': [ |
| 200 '<(DEPTH)/build/android/pylib/build_utils.py', | 200 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 201 '<(DEPTH)/build/android/strip_library_for_apk.py', | 201 '<(DEPTH)/build/android/gyp/strip_library_for_apk.py', |
| 202 '<(ordered_libraries_file)' | 202 '<(ordered_libraries_file)' |
| 203 ], | 203 ], |
| 204 'outputs': [ | 204 'outputs': [ |
| 205 '<(strip_stamp)', | 205 '<(strip_stamp)', |
| 206 ], | 206 ], |
| 207 'action': [ | 207 'action': [ |
| 208 'python', '<(DEPTH)/build/android/strip_library_for_apk.py', | 208 'python', '<(DEPTH)/build/android/gyp/strip_library_for_apk.py', |
| 209 '--android-strip=<(android_strip)', | 209 '--android-strip=<(android_strip)', |
| 210 '--android-strip-arg=--strip-unneeded', | 210 '--android-strip-arg=--strip-unneeded', |
| 211 '--stripped-libraries-dir=<(apk_libraries_dir)', | 211 '--stripped-libraries-dir=<(apk_libraries_dir)', |
| 212 '--libraries-dir=<(SHARED_LIB_DIR)', | 212 '--libraries-dir=<(SHARED_LIB_DIR)', |
| 213 '--libraries-file=<(ordered_libraries_file)', | 213 '--libraries-file=<(ordered_libraries_file)', |
| 214 '--stamp=<(strip_stamp)', | 214 '--stamp=<(strip_stamp)', |
| 215 ], | 215 ], |
| 216 }, | 216 }, |
| 217 ], | 217 ], |
| 218 'conditions': [ | 218 'conditions': [ |
| 219 ['gyp_managed_install == 1', { | 219 ['gyp_managed_install == 1', { |
| 220 'variables': { | 220 'variables': { |
| 221 'apk_libraries_dir': '<(intermediate_dir)/lib.stripped/', | 221 'apk_libraries_dir': '<(intermediate_dir)/lib.stripped/', |
| 222 'device_library_dir': '/data/local/tmp/chromium/lib.stripped/<(_targ
et_name)', | 222 'device_library_dir': '/data/local/tmp/chromium/lib.stripped/<(_targ
et_name)', |
| 223 }, | 223 }, |
| 224 'dependencies': [ | 224 'dependencies': [ |
| 225 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', | 225 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', |
| 226 ], | 226 ], |
| 227 'actions': [ | 227 'actions': [ |
| 228 { | 228 { |
| 229 'action_name': 'push_libraries_<(_target_name)', | 229 'action_name': 'push_libraries_<(_target_name)', |
| 230 'message': 'Pushing libraries to device for <(_target_name)', | 230 'message': 'Pushing libraries to device for <(_target_name)', |
| 231 'inputs': [ | 231 'inputs': [ |
| 232 '<(DEPTH)/build/android/pylib/build_utils.py', | 232 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 233 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 233 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| 234 '<(DEPTH)/build/android/gyp/push_libraries.py', | 234 '<(DEPTH)/build/android/gyp/push_libraries.py', |
| 235 '<(strip_stamp)', | 235 '<(strip_stamp)', |
| 236 ], | 236 ], |
| 237 'outputs': [ | 237 'outputs': [ |
| 238 '<(push_stamp)' | 238 '<(push_stamp)' |
| 239 ], | 239 ], |
| 240 'action': [ | 240 'action': [ |
| 241 'python', '<(DEPTH)/build/android/gyp/push_libraries.py', | 241 'python', '<(DEPTH)/build/android/gyp/push_libraries.py', |
| 242 '--libraries-dir=<(apk_libraries_dir)', | 242 '--libraries-dir=<(apk_libraries_dir)', |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 'includes': ['../build/grit_action.gypi'], | 295 'includes': ['../build/grit_action.gypi'], |
| 296 }, | 296 }, |
| 297 ], | 297 ], |
| 298 }], | 298 }], |
| 299 ['gyp_managed_install == 1', { | 299 ['gyp_managed_install == 1', { |
| 300 'actions': [ | 300 'actions': [ |
| 301 { | 301 { |
| 302 'action_name': 'apk_install_<(_target_name)', | 302 'action_name': 'apk_install_<(_target_name)', |
| 303 'message': 'Installing <(apk_name).apk', | 303 'message': 'Installing <(apk_name).apk', |
| 304 'inputs': [ | 304 'inputs': [ |
| 305 '<(DEPTH)/build/android/pylib/build_utils.py', | 305 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 306 '<(DEPTH)/build/android/gyp/apk_install.py', | 306 '<(DEPTH)/build/android/gyp/apk_install.py', |
| 307 '<(final_apk_path)', | 307 '<(final_apk_path)', |
| 308 ], | 308 ], |
| 309 'outputs': [ | 309 'outputs': [ |
| 310 '<(apk_install_stamp)' | 310 '<(apk_install_stamp)' |
| 311 ], | 311 ], |
| 312 'action': [ | 312 'action': [ |
| 313 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | 313 'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
| 314 '--android-sdk-tools=<(android_sdk_tools)', | 314 '--android-sdk-tools=<(android_sdk_tools)', |
| 315 '--apk-path=<(final_apk_path)', | 315 '--apk-path=<(final_apk_path)', |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 'message': 'Compiling java for <(_target_name)', | 370 'message': 'Compiling java for <(_target_name)', |
| 371 'variables': { | 371 'variables': { |
| 372 'all_src_dirs': [ | 372 'all_src_dirs': [ |
| 373 '<(java_in_dir)/src', | 373 '<(java_in_dir)/src', |
| 374 '<(intermediate_dir)/gen', | 374 '<(intermediate_dir)/gen', |
| 375 '>@(additional_src_dirs)', | 375 '>@(additional_src_dirs)', |
| 376 '>@(generated_src_dirs)', | 376 '>@(generated_src_dirs)', |
| 377 ], | 377 ], |
| 378 }, | 378 }, |
| 379 'inputs': [ | 379 'inputs': [ |
| 380 '<(DEPTH)/build/android/pylib/build_utils.py', | 380 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 381 '<(DEPTH)/build/android/gyp/javac.py', | 381 '<(DEPTH)/build/android/gyp/javac.py', |
| 382 # If there is a separate find for additional_src_dirs, it will find the | 382 # If there is a separate find for additional_src_dirs, it will find the |
| 383 # wrong .java files when additional_src_dirs is empty. | 383 # wrong .java files when additional_src_dirs is empty. |
| 384 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 384 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
| 385 '>@(input_jars_paths)', | 385 '>@(input_jars_paths)', |
| 386 '<(codegen_stamp)', | 386 '<(codegen_stamp)', |
| 387 '>@(compile_input_paths)', | 387 '>@(compile_input_paths)', |
| 388 ], | 388 ], |
| 389 'outputs': [ | 389 'outputs': [ |
| 390 '<(compile_stamp)', | 390 '<(compile_stamp)', |
| 391 ], | 391 ], |
| 392 'action': [ | 392 'action': [ |
| 393 'python', '<(DEPTH)/build/android/gyp/javac.py', | 393 'python', '<(DEPTH)/build/android/gyp/javac.py', |
| 394 '--output-dir=<(classes_dir)', | 394 '--output-dir=<(classes_dir)', |
| 395 '--classpath=>(input_jars_paths) <(android_sdk_jar)', | 395 '--classpath=>(input_jars_paths) <(android_sdk_jar)', |
| 396 '--src-dirs=>(all_src_dirs)', | 396 '--src-dirs=>(all_src_dirs)', |
| 397 '--javac-includes=<(javac_includes)', | 397 '--javac-includes=<(javac_includes)', |
| 398 '--chromium-code=<(chromium_code)', | 398 '--chromium-code=<(chromium_code)', |
| 399 '--stamp=<(compile_stamp)', | 399 '--stamp=<(compile_stamp)', |
| 400 | 400 |
| 401 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 401 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 402 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 402 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 403 ], | 403 ], |
| 404 }, | 404 }, |
| 405 { | 405 { |
| 406 'action_name': 'jar_<(_target_name)', | 406 'action_name': 'jar_<(_target_name)', |
| 407 'message': 'Creating <(_target_name) jar', | 407 'message': 'Creating <(_target_name) jar', |
| 408 'inputs': [ | 408 'inputs': [ |
| 409 '<(DEPTH)/build/android/pylib/build_utils.py', | 409 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 410 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 410 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| 411 '<(DEPTH)/build/android/gyp/jar.py', | 411 '<(DEPTH)/build/android/gyp/jar.py', |
| 412 '<(compile_stamp)', | 412 '<(compile_stamp)', |
| 413 ], | 413 ], |
| 414 'outputs': [ | 414 'outputs': [ |
| 415 '<(jar_stamp)', | 415 '<(jar_stamp)', |
| 416 ], | 416 ], |
| 417 'action': [ | 417 'action': [ |
| 418 'python', '<(DEPTH)/build/android/gyp/jar.py', | 418 'python', '<(DEPTH)/build/android/gyp/jar.py', |
| 419 '--classes-dir=<(classes_dir)', | 419 '--classes-dir=<(classes_dir)', |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 'dex_inputs': [ | 479 'dex_inputs': [ |
| 480 '>@(library_dexed_jars_paths)', | 480 '>@(library_dexed_jars_paths)', |
| 481 ], | 481 ], |
| 482 'dex_generated_inputs': [ | 482 'dex_generated_inputs': [ |
| 483 '<(classes_dir)', | 483 '<(classes_dir)', |
| 484 ], | 484 ], |
| 485 }], | 485 }], |
| 486 ], | 486 ], |
| 487 }, | 487 }, |
| 488 'inputs': [ | 488 'inputs': [ |
| 489 '<(DEPTH)/build/android/pylib/build_utils.py', | 489 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 490 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 490 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| 491 '<(DEPTH)/build/android/gyp/dex.py', | 491 '<(DEPTH)/build/android/gyp/dex.py', |
| 492 '<(compile_stamp)', | 492 '<(compile_stamp)', |
| 493 '>@(dex_inputs)', | 493 '>@(dex_inputs)', |
| 494 ], | 494 ], |
| 495 'outputs': [ | 495 'outputs': [ |
| 496 '<(dex_path)', | 496 '<(dex_path)', |
| 497 ], | 497 ], |
| 498 'action': [ | 498 'action': [ |
| 499 'python', '<(DEPTH)/build/android/gyp/dex.py', | 499 'python', '<(DEPTH)/build/android/gyp/dex.py', |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 553 |
| 554 # Add list of inputs to the command line, so if inputs change | 554 # Add list of inputs to the command line, so if inputs change |
| 555 # (e.g. if a Java file is removed), the command will be re-run. | 555 # (e.g. if a Java file is removed), the command will be re-run. |
| 556 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 556 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 557 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 557 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 558 | 558 |
| 559 ] | 559 ] |
| 560 }, | 560 }, |
| 561 ], | 561 ], |
| 562 } | 562 } |
| OLD | NEW |