Chromium Code Reviews| Index: build/java_apk.gypi |
| diff --git a/build/java_apk.gypi b/build/java_apk.gypi |
| index e388690f767a9941d92b944f4d09ffba3ce71ac9..39d2df57468f08ac0d9939ed765ae676be55bd58 100644 |
| --- a/build/java_apk.gypi |
| +++ b/build/java_apk.gypi |
| @@ -96,6 +96,7 @@ |
| 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
| 'dex_path': '<(intermediate_dir)/classes.dex', |
| + 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
|
frankf
2013/08/01 19:57:41
This is defined in bunch of places. Is there a way
gkanwar1
2013/08/07 19:24:56
Unfortunately I don't think there's a simple way t
|
| 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
| 'push_stamp': '<(intermediate_dir)/push.stamp', |
| 'link_stamp': '<(intermediate_dir)/link.stamp', |
| @@ -130,6 +131,13 @@ |
| 'native_lib_target%': '', |
| 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
| 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
| + 'conditions': [ |
| + ['emma_instrument != 0', { |
| + 'classes_final_dir': '<(intermediate_dir)/classes_instr', |
| + }, { |
| + 'classes_final_dir': '<(intermediate_dir)/classes', |
| + }] |
| + ] |
| }, |
| # Pass the jar path to the apk's "fake" jar target. This would be better as |
| # direct_dependent_settings, but a variable set by a direct_dependent_settings |
| @@ -372,6 +380,39 @@ |
| }, |
| ], |
| }], |
| + ['emma_instrument != 0', { |
| + 'actions': [ |
| + { |
| + 'action_name': 'emma_instr_<(_target_name)', |
| + 'message': 'Instrumenting <(_target_name) classes', |
| + 'inputs': [ |
| + '<(compile_stamp)', |
| + '<(DEPTH)/build/android/ant/apk-instr.xml', |
| + '<(DEPTH)/build/android/gyp/ant.py', |
| + '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| + ], |
| + 'outputs': [ |
| + '<(intermediate_dir)/coverage.em', |
| + '<(classes_final_dir)', |
| + ], |
| + 'action': [ |
| + 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| + '-DCLASSES_DIR=<(classes_dir)', |
| + '-DCLASSES_FINAL_DIR=<(classes_final_dir)', |
| + '-DEMMA_COVERAGE_FILE=<(intermediate_dir)/coverage.em', |
| + '-DEMMA_SOURCES_FILE=<(intermediate_dir)/emma_sources.txt', |
| + '-DJAVA_SRC=<(java_in_dir)/src', |
| + '-DADDITIONAL_SRC=>(additional_src_dirs)', |
| + '-DGENERATED_SRC=>(generated_src_dirs)', |
| + '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| + '-Dbasedir=.', |
| + '-buildfile', |
| + '<(DEPTH)/build/android/ant/apk-instr.xml', |
| + 'instr-classes', |
| + ] |
| + }, |
| + ], |
| + }], |
| ], |
| 'actions': [ |
| { |
| @@ -463,18 +504,24 @@ |
| { |
| 'action_name': 'jar_<(_target_name)', |
| 'message': 'Creating <(_target_name) jar', |
| + 'conditions': [ |
| + ['emma_instrument != 0', { |
| + 'inputs': [ '<(intermediate_dir)/coverage.em', ] |
| + }, { |
| + 'inputs': [ '<(compile_stamp)' ] |
| + }] |
| + ], |
| 'inputs': [ |
| '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| '<(DEPTH)/build/android/gyp/jar.py', |
| - '<(compile_stamp)', |
| ], |
| 'outputs': [ |
| '<(jar_stamp)', |
| ], |
| 'action': [ |
| 'python', '<(DEPTH)/build/android/gyp/jar.py', |
| - '--classes-dir=<(classes_dir)', |
| + '--classes-dir=<(classes_final_dir)', |
| '--jar-path=<(jar_path)', |
| '--excluded-classes=<(jar_excluded_classes)', |
| '--stamp=<(jar_stamp)', |
| @@ -536,10 +583,15 @@ |
| 'input_paths': [ '<(obfuscate_stamp)' ], |
| 'proguard_enabled_input_path': '<(obfuscated_jar_path)', |
| }], |
| + ['emma_instrument != 0', { |
| + 'dex_input_paths': [ '<(emma_device_jar)' ], |
| + 'input_paths': [ '<(intermediate_dir)/coverage.em' ], |
| + }, { |
| + 'input_paths': [ '<(compile_stamp)' ] |
| + }], |
| ], |
| - 'input_paths': [ '<(compile_stamp)' ], |
| 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ], |
| - 'dex_generated_input_dirs': [ '<(classes_dir)' ], |
| + 'dex_generated_input_dirs': [ '<(classes_final_dir)' ], |
| 'output_path': '<(dex_path)', |
| }, |
| 'includes': [ 'android/dex_action.gypi' ], |
| @@ -622,6 +674,7 @@ |
| '-DOUT_DIR=<(intermediate_dir)', |
| '-DSOURCE_DIR=<(source_dir)', |
| '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', |
| + '-DEMMA_INSTRUMENT=<(emma_instrument)', |
| '-Dbasedir=.', |
| '-buildfile', |