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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 { | 48 { |
49 'dependencies': [ | 49 'dependencies': [ |
50 '<(DEPTH)/build/android/setup.gyp:build_output_dirs' | 50 '<(DEPTH)/build/android/setup.gyp:build_output_dirs' |
51 ], | 51 ], |
52 'variables': { | 52 'variables': { |
53 'android_jar': '<(android_sdk)/android.jar', | 53 'android_jar': '<(android_sdk)/android.jar', |
54 'input_jars_paths': [ '<(android_jar)' ], | 54 'input_jars_paths': [ '<(android_jar)' ], |
55 'additional_src_dirs': [], | 55 'additional_src_dirs': [], |
56 'javac_includes': [], | 56 'javac_includes': [], |
57 'jar_name': '<(_target_name).jar', | 57 'jar_name': '<(_target_name).jar', |
58 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 58 'jar_dir': '<(PRODUCT_DIR)/lib.java', |
| 59 'jar_path': '<(intermediate_dir)/<(jar_name)', |
| 60 'jar_final_path': '<(jar_dir)/<(jar_name)', |
59 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], | 61 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], |
60 'additional_input_paths': [], | 62 'additional_input_paths': [], |
61 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', | 63 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', |
62 'generated_src_dirs': ['>@(generated_R_dirs)'], | 64 'generated_src_dirs': ['>@(generated_R_dirs)'], |
63 'generated_R_dirs': [], | 65 'generated_R_dirs': [], |
64 'has_java_resources%': 0, | 66 'has_java_resources%': 0, |
65 'java_strings_grd%': '', | 67 'java_strings_grd%': '', |
66 'res_extra_dirs': [], | 68 'res_extra_dirs': [], |
67 'res_extra_files': [], | 69 'res_extra_files': [], |
68 'res_v14_verify_only%': 0, | 70 'res_v14_verify_only%': 0, |
69 'resource_input_paths': ['>@(res_extra_files)'], | 71 'resource_input_paths': ['>@(res_extra_files)'], |
70 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 72 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
71 'classes_dir': '<(intermediate_dir)/classes', | 73 'classes_dir': '<(intermediate_dir)/classes', |
72 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 74 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
73 }, | 75 }, |
74 # This all_dependent_settings is used for java targets only. This will add the | 76 # This all_dependent_settings is used for java targets only. This will add the |
75 # jar path to the classpath of dependent java targets. | 77 # jar path to the classpath of dependent java targets. |
76 'all_dependent_settings': { | 78 'all_dependent_settings': { |
77 'variables': { | 79 'variables': { |
78 'input_jars_paths': ['<(jar_path)'], | 80 'input_jars_paths': ['<(jar_final_path)'], |
79 'library_dexed_jars_paths': ['<(dex_path)'], | 81 'library_dexed_jars_paths': ['<(dex_path)'], |
80 }, | 82 }, |
81 }, | 83 }, |
82 'conditions': [ | 84 'conditions': [ |
83 ['has_java_resources == 1', { | 85 ['has_java_resources == 1', { |
84 'variables': { | 86 'variables': { |
85 'res_dir': '<(java_in_dir)/res', | 87 'res_dir': '<(java_in_dir)/res', |
86 'res_crunched_dir': '<(intermediate_dir)/res_crunched', | 88 'res_crunched_dir': '<(intermediate_dir)/res_crunched', |
87 'res_v14_compatibility_stamp': '<(intermediate_dir)/res_v14_compatibilit
y.stamp', | 89 'res_v14_compatibility_stamp': '<(intermediate_dir)/res_v14_compatibilit
y.stamp', |
88 'res_v14_compatibility_dir': '<(intermediate_dir)/res_v14_compatibility'
, | 90 'res_v14_compatibility_dir': '<(intermediate_dir)/res_v14_compatibility'
, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 'python', '<(DEPTH)/build/android/gyp/jar.py', | 271 'python', '<(DEPTH)/build/android/gyp/jar.py', |
270 '--classes-dir=<(classes_dir)', | 272 '--classes-dir=<(classes_dir)', |
271 '--jar-path=<(jar_path)', | 273 '--jar-path=<(jar_path)', |
272 '--excluded-classes=<(jar_excluded_classes)', | 274 '--excluded-classes=<(jar_excluded_classes)', |
273 | 275 |
274 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 276 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
275 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 277 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
276 ] | 278 ] |
277 }, | 279 }, |
278 { | 280 { |
| 281 'action_name': 'instr_jar_<(_target_name)', |
| 282 'message': 'Instrumenting <(_target_name) jar', |
| 283 'variables': { |
| 284 'conditions': [ |
| 285 ['emma_instrument != 0', { |
| 286 'instr_action': 'instrument_jar', |
| 287 'extra_instr_args': [ |
| 288 '--intermediate-dir=<(intermediate_dir)', |
| 289 '--coverage-file=<(intermediate_dir)/coverage.em', |
| 290 '--sources-file=<(intermediate_dir)/emma_sources.txt', |
| 291 '--sources=<(java_in_dir)/src >(additional_src_dirs) >(generated_s
rc_dirs)', |
| 292 ], |
| 293 }, { |
| 294 'instr_action': 'copy', |
| 295 'extra_instr_args': [], |
| 296 }] |
| 297 ] |
| 298 }, |
| 299 'inputs': [ |
| 300 '<(jar_path)', |
| 301 '<(DEPTH)/build/android/gyp/instr.py', |
| 302 ], |
| 303 'outputs': [ |
| 304 '<(jar_final_path)', |
| 305 ], |
| 306 'action': [ |
| 307 'python', '<(DEPTH)/build/android/gyp/instr.py', |
| 308 '<(instr_action)', |
| 309 '--input-path=<(jar_path)', |
| 310 '--output-path=<(jar_dir)', |
| 311 '<@(extra_instr_args)', |
| 312 ] |
| 313 }, |
| 314 { |
279 'action_name': 'jar_toc_<(_target_name)', | 315 'action_name': 'jar_toc_<(_target_name)', |
280 'message': 'Creating <(_target_name) jar.TOC', | 316 'message': 'Creating <(_target_name) jar.TOC', |
281 'inputs': [ | 317 'inputs': [ |
282 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 318 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
283 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 319 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
284 '<(DEPTH)/build/android/gyp/jar_toc.py', | 320 '<(DEPTH)/build/android/gyp/jar_toc.py', |
285 '<(jar_path)', | 321 '<(jar_final_path)', |
286 ], | 322 ], |
287 'outputs': [ | 323 'outputs': [ |
288 '<(jar_path).TOC', | 324 '<(jar_final_path).TOC', |
289 ], | 325 ], |
290 'action': [ | 326 'action': [ |
291 'python', '<(DEPTH)/build/android/gyp/jar_toc.py', | 327 'python', '<(DEPTH)/build/android/gyp/jar_toc.py', |
292 '--jar-path=<(jar_path)', | 328 '--jar-path=<(jar_final_path)', |
293 '--toc-path=<(jar_path).TOC', | 329 '--toc-path=<(jar_final_path).TOC', |
294 | 330 |
295 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 331 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
296 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 332 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
297 ] | 333 ] |
298 }, | 334 }, |
299 { | 335 { |
300 'action_name': 'dex_<(_target_name)', | 336 'action_name': 'dex_<(_target_name)', |
301 'variables': { | 337 'variables': { |
302 'dex_input_paths': [ '<(jar_path)' ], | 338 'conditions': [ |
| 339 ['emma_instrument != 0', { |
| 340 'dex_no_locals': [ '--no-locals' ], |
| 341 }], |
| 342 ], |
| 343 'dex_input_paths': [ '<(jar_final_path)' ], |
303 'output_path': '<(dex_path)', | 344 'output_path': '<(dex_path)', |
304 }, | 345 }, |
305 'includes': [ 'android/dex_action.gypi' ], | 346 'includes': [ 'android/dex_action.gypi' ], |
306 }, | 347 }, |
307 ], | 348 ], |
308 } | 349 } |
OLD | NEW |