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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 'generated_R_dirs': [], | 63 'generated_R_dirs': [], |
64 'has_java_resources%': 0, | 64 'has_java_resources%': 0, |
65 'java_strings_grd%': '', | 65 'java_strings_grd%': '', |
66 'res_extra_dirs': [], | 66 'res_extra_dirs': [], |
67 'res_extra_files': [], | 67 'res_extra_files': [], |
68 'res_v14_verify_only%': 0, | 68 'res_v14_verify_only%': 0, |
69 'resource_input_paths': ['>@(res_extra_files)'], | 69 'resource_input_paths': ['>@(res_extra_files)'], |
70 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 70 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
71 'classes_dir': '<(intermediate_dir)/classes', | 71 'classes_dir': '<(intermediate_dir)/classes', |
72 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 72 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| 73 'proguard_config%': '', |
| 74 'proguard_preprocess%': '0', |
| 75 'variables': { |
| 76 'variables': { |
| 77 'proguard_preprocess%': 0, |
| 78 }, |
| 79 'conditions': [ |
| 80 ['proguard_preprocess == 1', { |
| 81 'javac_jar_path': '<(intermediate_dir)/<(_target_name).pre.jar' |
| 82 }, { |
| 83 'javac_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)' |
| 84 }], |
| 85 ], |
| 86 }, |
| 87 'javac_jar_path': '<(javac_jar_path)', |
73 }, | 88 }, |
74 # This all_dependent_settings is used for java targets only. This will add the | 89 # This all_dependent_settings is used for java targets only. This will add the |
75 # jar path to the classpath of dependent java targets. | 90 # jar path to the classpath of dependent java targets. |
76 'all_dependent_settings': { | 91 'all_dependent_settings': { |
77 'variables': { | 92 'variables': { |
78 'input_jars_paths': ['<(jar_path)'], | 93 'input_jars_paths': ['<(jar_path)'], |
79 'library_dexed_jars_paths': ['<(dex_path)'], | 94 'library_dexed_jars_paths': ['<(dex_path)'], |
80 }, | 95 }, |
81 }, | 96 }, |
82 'conditions': [ | 97 'conditions': [ |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 'action': [ | 226 'action': [ |
212 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', | 227 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', |
213 '--res-dir=<(res_dir)', | 228 '--res-dir=<(res_dir)', |
214 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', | 229 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', |
215 '--stamp', '<(res_v14_compatibility_stamp)', | 230 '--stamp', '<(res_v14_compatibility_stamp)', |
216 '<@(res_v14_additional_options)', | 231 '<@(res_v14_additional_options)', |
217 ] | 232 ] |
218 }, | 233 }, |
219 ], | 234 ], |
220 }], | 235 }], |
| 236 ['proguard_preprocess == 1', { |
| 237 'actions': [ |
| 238 { |
| 239 'action_name': 'proguard_<(_target_name)', |
| 240 'message': 'Proguard preprocessing <(_target_name) jar', |
| 241 'inputs': [ |
| 242 '<(android_sdk_root)/tools/proguard/bin/proguard.sh', |
| 243 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 244 '<(DEPTH)/build/android/gyp/proguard.py', |
| 245 '<(javac_jar_path)', |
| 246 '<(proguard_config)', |
| 247 ], |
| 248 'outputs': [ |
| 249 '<(jar_path)', |
| 250 ], |
| 251 'action': [ |
| 252 'python', '<(DEPTH)/build/android/gyp/proguard.py', |
| 253 '--proguard-path=<(android_sdk_root)/tools/proguard/bin/proguard.sh'
, |
| 254 '--input-path=<(javac_jar_path)', |
| 255 '--output-path=<(jar_path)', |
| 256 '--proguard-config=<(proguard_config)', |
| 257 '--classpath=<(android_sdk_jar) >(input_jars_paths)', |
| 258 |
| 259 # TODO(newt): remove this once http://crbug.com/177552 is fixed in n
inja. |
| 260 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 261 ] |
| 262 }, |
| 263 ], |
| 264 }], |
221 ], | 265 ], |
222 'actions': [ | 266 'actions': [ |
223 { | 267 { |
224 'action_name': 'javac_<(_target_name)', | 268 'action_name': 'javac_<(_target_name)', |
225 'message': 'Compiling <(_target_name) java sources', | 269 'message': 'Compiling <(_target_name) java sources', |
226 'variables': { | 270 'variables': { |
227 'all_src_dirs': [ | 271 'all_src_dirs': [ |
228 '>(java_in_dir)/src', | 272 '>(java_in_dir)/src', |
229 '>@(additional_src_dirs)', | 273 '>@(additional_src_dirs)', |
230 '>@(generated_src_dirs)', | 274 '>@(generated_src_dirs)', |
(...skipping 25 matching lines...) Expand all Loading... |
256 { | 300 { |
257 'action_name': 'jar_<(_target_name)', | 301 'action_name': 'jar_<(_target_name)', |
258 'message': 'Creating <(_target_name) jar', | 302 'message': 'Creating <(_target_name) jar', |
259 'inputs': [ | 303 'inputs': [ |
260 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 304 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
261 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 305 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
262 '<(DEPTH)/build/android/gyp/jar.py', | 306 '<(DEPTH)/build/android/gyp/jar.py', |
263 '<(compile_stamp)', | 307 '<(compile_stamp)', |
264 ], | 308 ], |
265 'outputs': [ | 309 'outputs': [ |
266 '<(jar_path)', | 310 '<(javac_jar_path)', |
267 ], | 311 ], |
268 'action': [ | 312 'action': [ |
269 'python', '<(DEPTH)/build/android/gyp/jar.py', | 313 'python', '<(DEPTH)/build/android/gyp/jar.py', |
270 '--classes-dir=<(classes_dir)', | 314 '--classes-dir=<(classes_dir)', |
271 '--jar-path=<(jar_path)', | 315 '--jar-path=<(javac_jar_path)', |
272 '--excluded-classes=<(jar_excluded_classes)', | 316 '--excluded-classes=<(jar_excluded_classes)', |
273 | 317 |
274 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 318 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
275 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 319 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
276 ] | 320 ] |
277 }, | 321 }, |
278 { | 322 { |
279 'action_name': 'jar_toc_<(_target_name)', | 323 'action_name': 'jar_toc_<(_target_name)', |
280 'message': 'Creating <(_target_name) jar.TOC', | 324 'message': 'Creating <(_target_name) jar.TOC', |
281 'inputs': [ | 325 'inputs': [ |
(...skipping 17 matching lines...) Expand all Loading... |
299 { | 343 { |
300 'action_name': 'dex_<(_target_name)', | 344 'action_name': 'dex_<(_target_name)', |
301 'variables': { | 345 'variables': { |
302 'dex_input_paths': [ '<(jar_path)' ], | 346 'dex_input_paths': [ '<(jar_path)' ], |
303 'output_path': '<(dex_path)', | 347 'output_path': '<(dex_path)', |
304 }, | 348 }, |
305 'includes': [ 'android/dex_action.gypi' ], | 349 'includes': [ 'android/dex_action.gypi' ], |
306 }, | 350 }, |
307 ], | 351 ], |
308 } | 352 } |
OLD | NEW |