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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 'proguard_enabled%': 'false', | 62 'proguard_enabled%': 'false', |
63 'proguard_flags%': '', | 63 'proguard_flags%': '', |
64 'native_libs_paths': [], | 64 'native_libs_paths': [], |
65 'jar_name%': 'chromium_apk_<(_target_name).jar', | 65 'jar_name%': 'chromium_apk_<(_target_name).jar', |
66 'resource_dir%':'', | 66 'resource_dir%':'', |
67 'R_package%':'', | 67 'R_package%':'', |
68 'additional_res_dirs': [], | 68 'additional_res_dirs': [], |
69 'additional_res_packages': [], | 69 'additional_res_packages': [], |
70 'is_test_apk%': 0, | 70 'is_test_apk%': 0, |
71 'java_strings_grd%': '', | 71 'java_strings_grd%': '', |
72 'grit_grd_file%': '', | 72 'res_grit_files': [], |
73 'library_manifest_paths%' : [], | 73 'library_manifest_paths%' : [], |
74 }, | 74 }, |
75 'sources': [ | 75 'sources': [ |
76 '<@(native_libs_paths)' | 76 '<@(native_libs_paths)' |
77 ], | 77 ], |
78 # Pass the jar path to the apk's "fake" jar target. This would be better as | 78 # Pass the jar path to the apk's "fake" jar target. This would be better as |
79 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 79 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
80 # cannot be lifted in a dependent to all_dependent_settings. | 80 # cannot be lifted in a dependent to all_dependent_settings. |
81 'all_dependent_settings': { | 81 'all_dependent_settings': { |
82 'variables': { | 82 'variables': { |
(...skipping 28 matching lines...) Expand all Loading... |
111 'variables': { | 111 'variables': { |
112 # We generate R.java in package R_package (in addition to the package | 112 # We generate R.java in package R_package (in addition to the package |
113 # listed in the AndroidManifest.xml, which is unavoidable). | 113 # listed in the AndroidManifest.xml, which is unavoidable). |
114 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], | 114 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], |
115 'additional_res_packages': ['<(R_package)'], | 115 'additional_res_packages': ['<(R_package)'], |
116 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], | 116 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], |
117 }, | 117 }, |
118 }], | 118 }], |
119 ['java_strings_grd != ""', { | 119 ['java_strings_grd != ""', { |
120 'variables': { | 120 'variables': { |
121 'out_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res', | 121 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit
', |
122 'additional_res_dirs': ['<(out_res_dir)'], | 122 'additional_res_dirs': ['<(res_grit_dir)'], |
123 # grit_grd_file is used by grit_action.gypi, included below. | 123 # grit_grd_file is used by grit_action.gypi, included below. |
124 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', | 124 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', |
| 125 'res_grit_files': ['<!@pymod_do_main(grit_info <@(grit_defines) --output
s "<(res_grit_dir)" <(grit_grd_file))'], |
125 }, | 126 }, |
126 'actions': [ | 127 'actions': [ |
127 { | 128 { |
128 'action_name': 'generate_localized_strings_xml', | 129 'action_name': 'generate_localized_strings_xml', |
129 'variables': { | 130 'variables': { |
130 'grit_out_dir': '<(out_res_dir)', | 131 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'], |
| 132 'grit_out_dir': '<(res_grit_dir)', |
131 # resource_ids is unneeded since we don't generate .h headers. | 133 # resource_ids is unneeded since we don't generate .h headers. |
132 'grit_resource_ids': '', | 134 'grit_resource_ids': '', |
133 }, | 135 }, |
134 'includes': ['../build/grit_action.gypi'], | 136 'includes': ['../build/grit_action.gypi'], |
135 }, | 137 }, |
136 ], | 138 ], |
137 }], | 139 }], |
138 ], | 140 ], |
139 'actions': [ | 141 'actions': [ |
140 { | 142 { |
141 'action_name': 'ant_<(_target_name)', | 143 'action_name': 'ant_<(_target_name)', |
142 'message': 'Building <(_target_name).', | 144 'message': 'Building <(_target_name).', |
143 'inputs': [ | 145 'inputs': [ |
144 '<(java_in_dir)/AndroidManifest.xml', | 146 '<(java_in_dir)/AndroidManifest.xml', |
145 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 147 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
146 '<(DEPTH)/build/android/ant/common.xml', | 148 '<(DEPTH)/build/android/ant/common.xml', |
147 '<(DEPTH)/build/android/ant/apk-build.xml', | 149 '<(DEPTH)/build/android/ant/apk-build.xml', |
148 # If there is a separate find for additional_src_dirs, it will find the | 150 # If there is a separate find for additional_src_dirs, it will find the |
149 # wrong .java files when additional_src_dirs is empty. | 151 # wrong .java files when additional_src_dirs is empty. |
150 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 152 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
151 '>@(input_jars_paths)', | 153 '>@(input_jars_paths)', |
152 '>@(native_libs_paths)', | 154 '>@(native_libs_paths)', |
153 '>@(additional_input_paths)', | 155 '>@(additional_input_paths)', |
154 '>@(library_manifest_paths)', | 156 '>@(library_manifest_paths)', |
| 157 '<@(res_grit_files)', |
155 ], | 158 ], |
156 'conditions': [ | 159 'conditions': [ |
157 ['resource_dir!=""', { | 160 ['resource_dir!=""', { |
158 'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")'] | 161 'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")'] |
159 }], | 162 }], |
160 ['java_strings_grd != ""', { | |
161 'inputs': [ | |
162 # TODO(newt): replace this with .../values/strings.xml once | |
163 # the English strings.xml is generated as well? That would be | |
164 # simpler and faster and should be equivalent. | |
165 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_res_di
r)" <(grit_grd_file))', | |
166 ], | |
167 }], | |
168 ['is_test_apk == 1', { | 163 ['is_test_apk == 1', { |
169 'variables': { | 164 'variables': { |
170 'additional_res_dirs=': [], | 165 'additional_res_dirs=': [], |
171 'additional_res_packages=': [], | 166 'additional_res_packages=': [], |
172 } | 167 } |
173 }], | 168 }], |
174 ['proguard_enabled == "true" and proguard_flags != ""', { | 169 ['proguard_enabled == "true" and proguard_flags != ""', { |
175 'inputs': ['<(java_in_dir)/<(proguard_flags)'] | 170 'inputs': ['<(java_in_dir)/<(proguard_flags)'] |
176 }], | 171 }], |
177 ], | 172 ], |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 '-buildfile', | 212 '-buildfile', |
218 '<(DEPTH)/build/android/ant/chromium-apk.xml', | 213 '<(DEPTH)/build/android/ant/chromium-apk.xml', |
219 | 214 |
220 # Specify CONFIGURATION_NAME as the target for ant to build. The | 215 # Specify CONFIGURATION_NAME as the target for ant to build. The |
221 # buildfile will then build the appropriate SDK tools target. | 216 # buildfile will then build the appropriate SDK tools target. |
222 '<(CONFIGURATION_NAME)', | 217 '<(CONFIGURATION_NAME)', |
223 ] | 218 ] |
224 }, | 219 }, |
225 ], | 220 ], |
226 } | 221 } |
OLD | NEW |