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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 'additional_src_dirs': [], | 57 'additional_src_dirs': [], |
58 'generated_src_dirs': [], | 58 'generated_src_dirs': [], |
59 'app_manifest_version_name%': '<(android_app_version_name)', | 59 'app_manifest_version_name%': '<(android_app_version_name)', |
60 'app_manifest_version_code%': '<(android_app_version_code)', | 60 'app_manifest_version_code%': '<(android_app_version_code)', |
61 'proguard_enabled%': 'false', | 61 'proguard_enabled%': 'false', |
62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], | 62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], |
63 'native_lib_target%': '', | 63 'native_lib_target%': '', |
64 'jar_name': 'chromium_apk_<(_target_name).jar', | 64 'jar_name': 'chromium_apk_<(_target_name).jar', |
65 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 65 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
66 'R_package%':'', | 66 'R_package%':'', |
| 67 'additional_R_text_files': [], |
67 'additional_res_dirs': [], | 68 'additional_res_dirs': [], |
68 'additional_res_packages': [], | 69 'additional_res_packages': [], |
69 'is_test_apk%': 0, | 70 'is_test_apk%': 0, |
70 'java_strings_grd%': '', | 71 'java_strings_grd%': '', |
71 'library_manifest_paths' : [], | 72 'library_manifest_paths' : [], |
72 'resource_input_paths': [], | 73 'resource_input_paths': [], |
73 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 74 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
74 'asset_location%': '<(intermediate_dir)/assets', | 75 'asset_location%': '<(intermediate_dir)/assets', |
75 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | 76 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
76 'compile_input_paths': [], | 77 'compile_input_paths': [], |
(...skipping 12 matching lines...) Expand all Loading... |
89 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 90 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
90 'jar_stamp': '<(intermediate_dir)/jar.stamp', | 91 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
91 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | 92 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
92 'strip_stamp': '<(intermediate_dir)/strip.stamp', | 93 'strip_stamp': '<(intermediate_dir)/strip.stamp', |
93 'classes_dir': '<(intermediate_dir)/classes', | 94 'classes_dir': '<(intermediate_dir)/classes', |
94 'javac_includes': [], | 95 'javac_includes': [], |
95 'jar_excluded_classes': [], | 96 'jar_excluded_classes': [], |
96 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 97 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
97 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 98 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
98 'dex_path': '<(intermediate_dir)/classes.dex', | 99 'dex_path': '<(intermediate_dir)/classes.dex', |
99 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', | 100 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
100 'push_stamp': '<(intermediate_dir)/push.stamp', | 101 'push_stamp': '<(intermediate_dir)/push.stamp', |
101 'link_stamp': '<(intermediate_dir)/link.stamp', | 102 'link_stamp': '<(intermediate_dir)/link.stamp', |
102 'codegen_input_paths': [], | 103 'codegen_input_paths': [], |
103 'final_apk_path': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 104 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 105 'source_dir': '<(java_in_dir)/src', |
104 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', | 106 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', |
105 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 107 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
106 }, | 108 }, |
107 # Pass the jar path to the apk's "fake" jar target. This would be better as | 109 # Pass the jar path to the apk's "fake" jar target. This would be better as |
108 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 110 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
109 # cannot be lifted in a dependent to all_dependent_settings. | 111 # cannot be lifted in a dependent to all_dependent_settings. |
110 'all_dependent_settings': { | 112 'all_dependent_settings': { |
111 'variables': { | 113 'variables': { |
112 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 114 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
113 }, | 115 }, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 'variables': { | 335 'variables': { |
334 'additional_res_dirs=': [], | 336 'additional_res_dirs=': [], |
335 'additional_res_packages=': [], | 337 'additional_res_packages=': [], |
336 } | 338 } |
337 }], | 339 }], |
338 ], | 340 ], |
339 'inputs': [ | 341 'inputs': [ |
340 '<(DEPTH)/build/android/ant/apk-codegen.xml', | 342 '<(DEPTH)/build/android/ant/apk-codegen.xml', |
341 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 343 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
342 '<(DEPTH)/build/android/gyp/ant.py', | 344 '<(DEPTH)/build/android/gyp/ant.py', |
343 '<(android_manifest)', | 345 '<(android_manifest_path)', |
344 '>@(library_manifest_paths)' | 346 '>@(library_manifest_paths)' |
345 '>@(codegen_input_paths)', | 347 '>@(codegen_input_paths)', |
346 '>@(additional_input_paths)', | 348 '>@(additional_input_paths)', |
347 ], | 349 ], |
348 'outputs': [ | 350 'outputs': [ |
349 '<(codegen_stamp)', | 351 '<(codegen_stamp)', |
350 ], | 352 ], |
351 'action': [ | 353 'action': [ |
352 'python', '<(DEPTH)/build/android/gyp/ant.py', | 354 'python', '<(DEPTH)/build/android/gyp/ant.py', |
353 '-quiet', | 355 '-quiet', |
354 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 356 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
355 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 357 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
356 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 358 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
357 '-DANDROID_MANIFEST=<(android_manifest)', | 359 '-DANDROID_MANIFEST=<(android_manifest_path)', |
358 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 360 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
359 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 361 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
360 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 362 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
361 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', | 363 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', |
362 '-DOUT_DIR=<(intermediate_dir)', | 364 '-DOUT_DIR=<(intermediate_dir)', |
363 '-DRESOURCE_DIR=<(resource_dir)', | 365 '-DRESOURCE_DIR=<(resource_dir)', |
364 | 366 |
365 '-DSTAMP=<(codegen_stamp)', | 367 '-DSTAMP=<(codegen_stamp)', |
366 '-Dbasedir=.', | 368 '-Dbasedir=.', |
367 '-buildfile', | 369 '-buildfile', |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 ], | 545 ], |
544 'action': [ | 546 'action': [ |
545 'python', '<(DEPTH)/build/android/gyp/ant.py', | 547 'python', '<(DEPTH)/build/android/gyp/ant.py', |
546 '-quiet', | 548 '-quiet', |
547 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 549 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
548 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 550 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
549 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 551 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
550 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 552 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
551 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 553 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
552 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 554 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
553 '-DAPKS_DIR=<(PRODUCT_DIR)/apks', | |
554 '-DAPK_NAME=<(apk_name)', | 555 '-DAPK_NAME=<(apk_name)', |
555 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | 556 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
556 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | 557 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
557 '-DASSET_DIR=<(asset_location)', | 558 '-DASSET_DIR=<(asset_location)', |
558 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 559 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| 560 '-DFINAL_APK_PATH=<(final_apk_path)', |
559 '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', | 561 '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', |
560 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', | 562 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', |
561 '-DOUT_DIR=<(intermediate_dir)', | 563 '-DOUT_DIR=<(intermediate_dir)', |
562 '-DRESOURCE_DIR=<(resource_dir)', | 564 '-DRESOURCE_DIR=<(resource_dir)', |
563 '-DSOURCE_DIR=<(java_in_dir)/src', | 565 '-DSOURCE_DIR=<(source_dir)', |
564 | 566 |
565 '-Dbasedir=.', | 567 '-Dbasedir=.', |
566 '-buildfile', | 568 '-buildfile', |
567 '<(DEPTH)/build/android/ant/apk-package.xml', | 569 '<(DEPTH)/build/android/ant/apk-package.xml', |
568 | 570 |
569 # Add list of inputs to the command line, so if inputs change | 571 # Add list of inputs to the command line, so if inputs change |
570 # (e.g. if a Java file is removed), the command will be re-run. | 572 # (e.g. if a Java file is removed), the command will be re-run. |
571 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 573 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
572 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 574 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
573 ] | 575 ] |
574 }, | 576 }, |
575 ], | 577 ], |
576 } | 578 } |
OLD | NEW |