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 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 Loading... |
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', | 86 'res_v14_compatibility_stamp': '<(intermediate_dir)/res_v14_compatibilit
y.stamp', |
87 'res_v14_stamp': '<(intermediate_dir)/res_v14.stamp', | 87 'res_v14_compatibility_dir': '<(intermediate_dir)/res_v14_compatibility'
, |
88 'res_v17_dir': '<(intermediate_dir)/res_v17', | |
89 'res_v17_stamp': '<(intermediate_dir)/res_v17.stamp', | |
90 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 88 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
91 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 89 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
92 'R_dir': '<(intermediate_dir)/java_R', | 90 'R_dir': '<(intermediate_dir)/java_R', |
93 'R_text_file': '<(R_dir)/R.txt', | 91 'R_text_file': '<(R_dir)/R.txt', |
94 'R_stamp': '<(intermediate_dir)/resources.stamp', | 92 'R_stamp': '<(intermediate_dir)/resources.stamp', |
95 'generated_src_dirs': ['<(R_dir)'], | 93 'generated_src_dirs': ['<(R_dir)'], |
96 'additional_input_paths': ['<(R_stamp)', | 94 'additional_input_paths': ['<(R_stamp)', |
97 '<(res_v14_stamp)', | 95 '<(res_v14_compatibility_stamp)',], |
98 '<(res_v17_stamp)',], | |
99 'additional_res_dirs': [], | 96 'additional_res_dirs': [], |
100 'dependencies_res_input_dirs': [], | 97 'dependencies_res_input_dirs': [], |
101 'dependencies_res_files': [], | 98 'dependencies_res_files': [], |
102 }, | 99 }, |
103 'all_dependent_settings': { | 100 'all_dependent_settings': { |
104 'variables': { | 101 'variables': { |
105 # Dependent jars include this target's R.java file via | 102 # Dependent jars include this target's R.java file via |
106 # generated_R_dirs and include its resources via | 103 # generated_R_dirs and include its resources via |
107 # dependencies_res_files. | 104 # dependencies_res_files. |
108 'generated_R_dirs': ['<(R_dir)'], | 105 'generated_R_dirs': ['<(R_dir)'], |
109 'additional_input_paths': ['<(R_stamp)', | 106 'additional_input_paths': ['<(R_stamp)', |
110 '<(res_v14_stamp)', | 107 '<(res_v14_compatibility_stamp)',], |
111 '<(res_v17_stamp)',], | |
112 'dependencies_res_files': ['<@(resource_input_paths)'], | 108 'dependencies_res_files': ['<@(resource_input_paths)'], |
113 | 109 |
114 'dependencies_res_input_dirs': ['<@(res_input_dirs)'], | 110 'dependencies_res_input_dirs': ['<@(res_input_dirs)'], |
115 | 111 |
116 # Dependent APKs include this target's resources via | 112 # Dependent APKs include this target's resources via |
117 # additional_res_dirs, additional_res_packages, and | 113 # additional_res_dirs, additional_res_packages, and |
118 # additional_R_text_files. | 114 # additional_R_text_files. |
119 'additional_res_dirs': ['<(res_crunched_dir)', | 115 'additional_res_dirs': ['<(res_crunched_dir)', |
120 '<(res_v14_dir)', | 116 '<(res_v14_compatibility_dir)', |
121 '<(res_v17_dir)', | |
122 '<@(res_input_dirs)'], | 117 '<@(res_input_dirs)'], |
123 'additional_res_packages': ['<(R_package)'], | 118 'additional_res_packages': ['<(R_package)'], |
124 'additional_R_text_files': ['<(R_text_file)'], | 119 'additional_R_text_files': ['<(R_text_file)'], |
125 }, | 120 }, |
126 }, | 121 }, |
127 'conditions': [ | 122 'conditions': [ |
128 ['java_strings_grd != ""', { | 123 ['java_strings_grd != ""', { |
129 'variables': { | 124 'variables': { |
130 'res_grit_dir': '<(intermediate_dir)/res_grit', | 125 'res_grit_dir': '<(intermediate_dir)/res_grit', |
131 'res_input_dirs': ['<(res_grit_dir)'], | 126 'res_input_dirs': ['<(res_grit_dir)'], |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 '--non-constant-id', | 174 '--non-constant-id', |
180 '--custom-package', '<(R_package)', | 175 '--custom-package', '<(R_package)', |
181 '--stamp', '<(R_stamp)', | 176 '--stamp', '<(R_stamp)', |
182 | 177 |
183 # Add hash of inputs to the command line, so if inputs change | 178 # Add hash of inputs to the command line, so if inputs change |
184 # (e.g. if a resource if removed), the command will be re-run. | 179 # (e.g. if a resource if removed), the command will be re-run. |
185 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 180 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
186 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 181 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
187 ], | 182 ], |
188 }, | 183 }, |
189 # Copy API 17 resources. | |
190 { | |
191 'action_name': 'copy_v17_resources_<(_target_name)', | |
192 'message': 'Copying Android API 17 resources <(_target_name)', | |
193 'inputs': [ | |
194 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
195 '<(DEPTH)/build/android/gyp/copy_v17_resources.py', | |
196 '>@(resource_input_paths)', | |
197 ], | |
198 'outputs': [ | |
199 '<(res_v17_stamp)', | |
200 ], | |
201 'action': [ | |
202 'python', '<(DEPTH)/build/android/gyp/copy_v17_resources.py', | |
203 '--res-dir=<(res_dir)', | |
204 '--res-v17-dir=<(res_v17_dir)', | |
205 '--stamp', '<(res_v17_stamp)', | |
206 ] | |
207 }, | |
208 # Generate API 14 resources. | 184 # Generate API 14 resources. |
209 { | 185 { |
210 'action_name': 'generate_api_14_resources_<(_target_name)', | 186 'action_name': 'generate_api_14_resources_<(_target_name)', |
211 'message': 'Generating Android API 14 resources <(_target_name)', | 187 'message': 'Generating Android API 14 resources <(_target_name)', |
212 'inputs': [ | 188 'inputs': [ |
213 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 189 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
214 '<(DEPTH)/build/android/gyp/generate_v14_resources.py', | 190 '<(DEPTH)/build/android/gyp/generate_v14_compatible_resources.py', |
215 '>@(resource_input_paths)', | 191 '>@(resource_input_paths)', |
216 ], | 192 ], |
217 'outputs': [ | 193 'outputs': [ |
218 '<(res_v14_stamp)', | 194 '<(res_v14_compatibility_stamp)', |
219 ], | 195 ], |
220 'action': [ | 196 'action': [ |
221 'python', '<(DEPTH)/build/android/gyp/generate_v14_resources.py', | 197 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', |
222 '--res-dir=<(res_dir)', | 198 '--res-dir=<(res_dir)', |
223 '--res-v14-dir=<(res_v14_dir)', | 199 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', |
224 '--stamp', '<(res_v14_stamp)', | 200 '--stamp', '<(res_v14_compatibility_stamp)', |
225 ] | 201 ] |
226 }, | 202 }, |
227 ], | 203 ], |
228 }], | 204 }], |
229 ], | 205 ], |
230 'actions': [ | 206 'actions': [ |
231 { | 207 { |
232 'action_name': 'javac_<(_target_name)', | 208 'action_name': 'javac_<(_target_name)', |
233 'message': 'Compiling <(_target_name) java sources', | 209 'message': 'Compiling <(_target_name) java sources', |
234 'variables': { | 210 'variables': { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 299 |
324 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 300 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
325 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 301 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
326 | 302 |
327 '<(jar_path)', | 303 '<(jar_path)', |
328 ] | 304 ] |
329 }, | 305 }, |
330 | 306 |
331 ], | 307 ], |
332 } | 308 } |
OLD | NEW |