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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 'additional_input_paths': [], | 59 'additional_input_paths': [], |
60 'input_jars_paths': [], | 60 'input_jars_paths': [], |
61 'additional_src_dirs': [], | 61 'additional_src_dirs': [], |
62 'generated_src_dirs': [], | 62 'generated_src_dirs': [], |
63 'app_manifest_version_name%': '<(android_app_version_name)', | 63 'app_manifest_version_name%': '<(android_app_version_name)', |
64 'app_manifest_version_code%': '<(android_app_version_code)', | 64 'app_manifest_version_code%': '<(android_app_version_code)', |
65 'proguard_enabled%': 'false', | 65 'proguard_enabled%': 'false', |
66 'proguard_flags%': '', | 66 'proguard_flags%': '', |
67 'native_libs_paths': [], | 67 'native_libs_paths': [], |
68 'manifest_package_name%': 'unknown.package.name', | 68 'manifest_package_name%': 'unknown.package.name', |
69 'resource_dir%':'', | |
69 }, | 70 }, |
70 'sources': [ | 71 'sources': [ |
71 '<@(native_libs_paths)' | 72 '<@(native_libs_paths)' |
72 ], | 73 ], |
73 'rules': [ | 74 'rules': [ |
74 { | 75 { |
75 'rule_name': 'copy_and_strip_native_libraries', | 76 'rule_name': 'copy_and_strip_native_libraries', |
76 'extension': 'so', | 77 'extension': 'so', |
77 'variables': { | 78 'variables': { |
78 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_ app_abi)/<(RULE_INPUT_ROOT).so', | 79 'stripped_library_path': '<(PRODUCT_DIR)/<(package_name)/libs/<(android_ app_abi)/<(RULE_INPUT_ROOT).so', |
(...skipping 20 matching lines...) Expand all Loading... | |
99 'action_name': 'ant_<(package_name)_apk', | 100 'action_name': 'ant_<(package_name)_apk', |
100 'message': 'Building <(package_name) apk.', | 101 'message': 'Building <(package_name) apk.', |
101 'inputs': [ | 102 'inputs': [ |
102 '<(java_in_dir)/AndroidManifest.xml', | 103 '<(java_in_dir)/AndroidManifest.xml', |
103 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 104 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
104 '<(DEPTH)/build/android/ant/common.xml', | 105 '<(DEPTH)/build/android/ant/common.xml', |
105 '<(DEPTH)/build/android/ant/sdk-targets.xml', | 106 '<(DEPTH)/build/android/ant/sdk-targets.xml', |
106 # If there is a separate find for additional_src_dirs, it will find the | 107 # If there is a separate find for additional_src_dirs, it will find the |
107 # wrong .java files when additional_src_dirs is empty. | 108 # wrong .java files when additional_src_dirs is empty. |
108 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 109 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
109 '<!@(find <(java_in_dir)/<(resource_dir) -name "*")', | |
110 '>@(input_jars_paths)', | 110 '>@(input_jars_paths)', |
111 '>@(native_libs_paths)', | 111 '>@(native_libs_paths)', |
112 '>@(additional_input_paths)', | 112 '>@(additional_input_paths)', |
113 ], | 113 ], |
114 'conditions': [ | |
115 ['"<(resource_dir)"!=""', { | |
cjhopman
2012/10/16 22:31:12
I think this can be changed to:
['resource_dir!="
shashi
2012/10/16 22:38:51
Thanks, much better.
On 2012/10/16 22:31:12, cjhop
| |
116 'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")'] | |
117 }], | |
118 ], | |
114 'outputs': [ | 119 'outputs': [ |
115 # TODO(cjhopman): Apks are built with a -debug suffix even when they are | 120 # TODO(cjhopman): Apks are built with a -debug suffix even when they are |
116 # built in release. This should be fixed. | 121 # built in release. This should be fixed. |
117 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', | 122 '<(PRODUCT_DIR)/apks/<(apk_name)-debug.apk', |
118 ], | 123 ], |
119 'action': [ | 124 'action': [ |
120 'ant', | 125 'ant', |
121 '-DAPP_ABI=<(android_app_abi)', | 126 '-DAPP_ABI=<(android_app_abi)', |
122 '-DANDROID_GDBSERVER=<(android_gdbserver)', | 127 '-DANDROID_GDBSERVER=<(android_gdbserver)', |
123 '-DANDROID_SDK=<(android_sdk)', | 128 '-DANDROID_SDK=<(android_sdk)', |
(...skipping 21 matching lines...) Expand all Loading... | |
145 '-buildfile', | 150 '-buildfile', |
146 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 151 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
147 | 152 |
148 # Specify CONFIGURATION_NAME as the target for ant to build. The | 153 # Specify CONFIGURATION_NAME as the target for ant to build. The |
149 # buildfile will then build the appropriate SDK tools target. | 154 # buildfile will then build the appropriate SDK tools target. |
150 '<(CONFIGURATION_NAME)', | 155 '<(CONFIGURATION_NAME)', |
151 ] | 156 ] |
152 }, | 157 }, |
153 ], | 158 ], |
154 } | 159 } |
OLD | NEW |