Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: build/java.gypi

Issue 14476011: [Android] Auto-generate API 14 resources from the existing API 17 resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Excluded v17/v14/crunch resources from process_resources.py and included only at apk resource packa… Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Java in a consistent manner. 6 # to build Java 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_java', 10 # 'target_name': 'my-package_java',
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 'variables': { 76 'variables': {
77 'input_jars_paths': ['<(jar_path)'], 77 'input_jars_paths': ['<(jar_path)'],
78 'library_dexed_jars_paths': ['<(dex_path)'], 78 'library_dexed_jars_paths': ['<(dex_path)'],
79 }, 79 },
80 }, 80 },
81 'conditions': [ 81 'conditions': [
82 ['has_java_resources == 1', { 82 ['has_java_resources == 1', {
83 'variables': { 83 'variables': {
84 'res_dir': '<(java_in_dir)/res', 84 'res_dir': '<(java_in_dir)/res',
85 'res_crunched_dir': '<(intermediate_dir)/res_crunched', 85 'res_crunched_dir': '<(intermediate_dir)/res_crunched',
86 'res_v14_dir': '<(intermediate_dir)/res_v14',
87 'res_v14_stamp': '<(intermediate_dir)/res_v14.stamp',
88 'res_v17_dir': '<(intermediate_dir)/res_v17',
89 'res_v17_stamp': '<(intermediate_dir)/res_v17.stamp',
86 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], 90 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'],
87 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], 91 'resource_input_paths': ['<!@(find <(res_dir) -type f)'],
88 'R_dir': '<(intermediate_dir)/java_R', 92 'R_dir': '<(intermediate_dir)/java_R',
89 'R_text_file': '<(R_dir)/R.txt', 93 'R_text_file': '<(R_dir)/R.txt',
90 'R_stamp': '<(intermediate_dir)/resources.stamp', 94 'R_stamp': '<(intermediate_dir)/resources.stamp',
91 'generated_src_dirs': ['<(R_dir)'], 95 'generated_src_dirs': ['<(R_dir)'],
92 'additional_input_paths': ['<(R_stamp)'], 96 'additional_input_paths': ['<(R_stamp)',
97 '<(res_v14_stamp)',
98 '<(res_v17_stamp)',],
93 'additional_res_dirs': [], 99 'additional_res_dirs': [],
100 'additional_res_input_dirs': [],
94 'dependencies_res_files': [], 101 'dependencies_res_files': [],
95 }, 102 },
96 'all_dependent_settings': { 103 'all_dependent_settings': {
97 'variables': { 104 'variables': {
98 # Dependent jars include this target's R.java file via 105 # Dependent jars include this target's R.java file via
99 # generated_R_dirs and include its resources via 106 # generated_R_dirs and include its resources via
100 # dependencies_res_files. 107 # dependencies_res_files.
101 'generated_R_dirs': ['<(R_dir)'], 108 'generated_R_dirs': ['<(R_dir)'],
102 'additional_input_paths': ['<(R_stamp)'], 109 'additional_input_paths': ['<(R_stamp)',
110 '<(res_v14_stamp)',
111 '<(res_v17_stamp)',],
103 'dependencies_res_files': ['<@(resource_input_paths)'], 112 'dependencies_res_files': ['<@(resource_input_paths)'],
104 113
114 'additional_res_input_dirs': ['<@(res_input_dirs)'],
newt (away) 2013/05/03 20:16:16 this should be "dependencies_res_input_dirs"
Kibeom Kim (inactive) 2013/05/03 20:34:57 Done.
115
105 # Dependent APKs include this target's resources via 116 # Dependent APKs include this target's resources via
106 # additional_res_dirs, additional_res_packages, and 117 # additional_res_dirs, additional_res_packages, and
107 # additional_R_text_files. 118 # additional_R_text_files.
108 'additional_res_dirs': ['<(res_crunched_dir)', '<@(res_input_dirs)'], 119 'additional_res_dirs': ['<(res_crunched_dir)',
120 '<(res_v17_dir)',
newt (away) 2013/05/03 20:16:16 put v14 before v17 for consistency
Kibeom Kim (inactive) 2013/05/03 20:34:57 Done.
121 '<(res_v14_dir)',
122 '<@(res_input_dirs)'],
109 'additional_res_packages': ['<(R_package)'], 123 'additional_res_packages': ['<(R_package)'],
110 'additional_R_text_files': ['<(R_text_file)'], 124 'additional_R_text_files': ['<(R_text_file)'],
111 }, 125 },
112 }, 126 },
113 'conditions': [ 127 'conditions': [
114 ['java_strings_grd != ""', { 128 ['java_strings_grd != ""', {
115 'variables': { 129 'variables': {
116 'res_grit_dir': '<(intermediate_dir)/res_grit', 130 'res_grit_dir': '<(intermediate_dir)/res_grit',
117 'res_input_dirs': ['<(res_grit_dir)'], 131 'res_input_dirs': ['<(res_grit_dir)'],
118 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', 132 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
(...skipping 15 matching lines...) Expand all
134 ], 148 ],
135 'actions': [ 149 'actions': [
136 # Generate R.java and crunch image resources. 150 # Generate R.java and crunch image resources.
137 { 151 {
138 'action_name': 'process_resources', 152 'action_name': 'process_resources',
139 'message': 'processing resources for <(_target_name)', 153 'message': 'processing resources for <(_target_name)',
140 'variables': { 154 'variables': {
141 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', 155 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml',
142 # Include the dependencies' res dirs so that references to 156 # Include the dependencies' res dirs so that references to
143 # resources in dependencies can be resolved. 157 # resources in dependencies can be resolved.
144 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], 158 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_input_dirs )'],
Kibeom Kim (inactive) 2013/05/03 18:46:03 line too long.
newt (away) 2013/05/03 20:16:16 gyp doesn't have strict limits on line length, so
Kibeom Kim (inactive) 2013/05/03 20:34:57 Done.
145 }, 159 },
146 'inputs': [ 160 'inputs': [
147 '<(DEPTH)/build/android/gyp/util/build_utils.py', 161 '<(DEPTH)/build/android/gyp/util/build_utils.py',
148 '<(DEPTH)/build/android/gyp/process_resources.py', 162 '<(DEPTH)/build/android/gyp/process_resources.py',
149 '>@(resource_input_paths)', 163 '>@(resource_input_paths)',
150 '>@(dependencies_res_files)', 164 '>@(dependencies_res_files)',
151 ], 165 ],
152 'outputs': [ 166 'outputs': [
153 '<(R_stamp)', 167 '<(R_stamp)',
154 ], 168 ],
155 'action': [ 169 'action': [
156 'python', '<(DEPTH)/build/android/gyp/process_resources.py', 170 'python', '<(DEPTH)/build/android/gyp/process_resources.py',
157 '--android-sdk', '<(android_sdk)', 171 '--android-sdk', '<(android_sdk)',
158 '--android-sdk-tools', '<(android_sdk_tools)', 172 '--android-sdk-tools', '<(android_sdk_tools)',
159 '--R-dir', '<(R_dir)', 173 '--R-dir', '<(R_dir)',
160 '--res-dirs', '>(all_res_dirs)', 174 '--res-dirs', '>(all_res_dirs)',
161 '--crunch-input-dir', '>(res_dir)', 175 '--crunch-input-dir', '>(res_dir)',
162 '--crunch-output-dir', '<(res_crunched_dir)', 176 '--crunch-output-dir', '<(res_crunched_dir)',
163 '--android-manifest', '<(android_manifest)', 177 '--android-manifest', '<(android_manifest)',
164 '--non-constant-id', 178 '--non-constant-id',
165 '--custom-package', '<(R_package)', 179 '--custom-package', '<(R_package)',
166 '--stamp', '<(R_stamp)', 180 '--stamp', '<(R_stamp)',
167 181
168 # Add hash of inputs to the command line, so if inputs change 182 # Add hash of inputs to the command line, so if inputs change
169 # (e.g. if a resource if removed), the command will be re-run. 183 # (e.g. if a resource if removed), the command will be re-run.
170 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. 184 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
171 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', 185 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
172 ], 186 ],
173 }, 187 },
188 # Copy API 17 resources.
189 {
190 'action_name': 'copy_v17_resources_<(_target_name)',
191 'message': 'Copying Android API 17 resources <(_target_name)',
192 'inputs': [
193 '<(DEPTH)/build/android/gyp/util/build_utils.py',
194 '<(DEPTH)/build/android/gyp/copy_v17_resources.py',
195 '>@(resource_input_paths)',
196 ],
197 'outputs': [
198 '<(res_v17_stamp)',
199 ],
200 'action': [
201 'python', '<(DEPTH)/build/android/gyp/copy_v17_resources.py',
202 '--res-dir=<(res_dir)',
203 '--res-v17-dir=<(res_v17_dir)',
204 '--stamp', '<(res_v17_stamp)',
205 ]
206 },
207 # Generate API 14 resources.
208 {
209 'action_name': 'generate_api_14_resources_<(_target_name)',
210 'message': 'Generating Android API 14 resources <(_target_name)',
211 'inputs': [
212 '<(DEPTH)/build/android/gyp/util/build_utils.py',
213 '<(DEPTH)/build/android/gyp/generate_v14_resources.py',
214 '>@(resource_input_paths)',
215 ],
216 'outputs': [
217 '<(res_v14_stamp)',
218 ],
219 'action': [
220 'python', '<(DEPTH)/build/android/gyp/generate_v14_resources.py',
221 '--res-dir=<(res_dir)',
222 '--res-v14-dir=<(res_v14_dir)',
223 '--stamp', '<(res_v14_stamp)',
224 ]
225 },
174 ], 226 ],
175 }], 227 }],
176 ], 228 ],
177 'actions': [ 229 'actions': [
178 { 230 {
179 'action_name': 'javac_<(_target_name)', 231 'action_name': 'javac_<(_target_name)',
180 'message': 'Compiling <(_target_name) java sources', 232 'message': 'Compiling <(_target_name) java sources',
181 'variables': { 233 'variables': {
182 'all_src_dirs': [ 234 'all_src_dirs': [
183 '>(java_in_dir)/src', 235 '>(java_in_dir)/src',
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 322
271 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . 323 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja .
272 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', 324 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
273 325
274 '<(jar_path)', 326 '<(jar_path)',
275 ] 327 ]
276 }, 328 },
277 329
278 ], 330 ],
279 } 331 }
OLDNEW
« build/android/gyp/generate_v14_resources.py ('K') | « build/android/gyp/generate_v14_resources.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698