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)', | |
cjhopman
2013/08/10 00:11:47
Extract this action to its own file in build/andro
gkanwar1
2013/08/12 18:19:10
Done.
| |
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 '--src-root=<(DEPTH)', | |
293 '--sdk-root=<(android_sdk_root)', | |
294 ], | |
295 }, { | |
296 'instr_action': 'copy', | |
297 'extra_instr_args': [], | |
298 }] | |
299 ] | |
300 }, | |
301 'inputs': [ | |
302 '<(jar_path)', | |
303 '<(DEPTH)/build/android/gyp/instr.py', | |
304 '<(DEPTH)/build/android/pylib/utils/command_option_parser.py', | |
305 ], | |
306 'outputs': [ | |
307 '<(jar_final_path)', | |
308 ], | |
309 'action': [ | |
310 'python', '<(DEPTH)/build/android/gyp/instr.py', | |
311 '<(instr_action)', | |
312 '--input-path=<(jar_path)', | |
313 '--output-path=<(jar_dir)', | |
314 '<@(extra_instr_args)', | |
315 ] | |
316 }, | |
317 { | |
279 'action_name': 'jar_toc_<(_target_name)', | 318 'action_name': 'jar_toc_<(_target_name)', |
280 'message': 'Creating <(_target_name) jar.TOC', | 319 'message': 'Creating <(_target_name) jar.TOC', |
281 'inputs': [ | 320 'inputs': [ |
282 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 321 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
283 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 322 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
284 '<(DEPTH)/build/android/gyp/jar_toc.py', | 323 '<(DEPTH)/build/android/gyp/jar_toc.py', |
285 '<(jar_path)', | 324 '<(jar_final_path)', |
286 ], | 325 ], |
287 'outputs': [ | 326 'outputs': [ |
288 '<(jar_path).TOC', | 327 '<(jar_final_path).TOC', |
289 ], | 328 ], |
290 'action': [ | 329 'action': [ |
291 'python', '<(DEPTH)/build/android/gyp/jar_toc.py', | 330 'python', '<(DEPTH)/build/android/gyp/jar_toc.py', |
292 '--jar-path=<(jar_path)', | 331 '--jar-path=<(jar_final_path)', |
293 '--toc-path=<(jar_path).TOC', | 332 '--toc-path=<(jar_final_path).TOC', |
294 | 333 |
295 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . | 334 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . |
296 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 335 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
297 ] | 336 ] |
298 }, | 337 }, |
299 { | 338 { |
300 'action_name': 'dex_<(_target_name)', | 339 'action_name': 'dex_<(_target_name)', |
301 'variables': { | 340 'variables': { |
302 'dex_input_paths': [ '<(jar_path)' ], | 341 'conditions': [ |
342 ['emma_instrument != 0', { | |
343 'dex_no_locals': 1, | |
344 }], | |
345 ], | |
346 'dex_input_paths': [ '<(jar_final_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 |