| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 59 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], | 59 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], |
| 60 'additional_input_paths': [], | 60 'additional_input_paths': [], |
| 61 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', | 61 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', |
| 62 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
| 62 'generated_src_dirs': ['>@(generated_R_dirs)'], | 63 'generated_src_dirs': ['>@(generated_R_dirs)'], |
| 63 'generated_R_dirs': [], | 64 'generated_R_dirs': [], |
| 64 'has_java_resources%': 0, | 65 'has_java_resources%': 0, |
| 65 'java_strings_grd%': '', | 66 'java_strings_grd%': '', |
| 66 'res_extra_dirs': [], | 67 'res_extra_dirs': [], |
| 67 'res_extra_files': [], | 68 'res_extra_files': [], |
| 68 'res_v14_verify_only%': 0, | 69 'res_v14_verify_only%': 0, |
| 69 'resource_input_paths': ['>@(res_extra_files)'], | 70 'resource_input_paths': ['>@(res_extra_files)'], |
| 70 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 71 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
| 71 'classes_dir': '<(intermediate_dir)/classes', | 72 'classes_dir': '<(intermediate_dir)/classes', |
| 72 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 73 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| 74 'conditions': [ |
| 75 ['coverage == 1', { |
| 76 'classes_final_dir': '<(intermediate_dir)/classes_instr', |
| 77 }, { |
| 78 'classes_final_dir': '<(intermediate_dir)/classes', |
| 79 }] |
| 80 ] |
| 73 }, | 81 }, |
| 74 # This all_dependent_settings is used for java targets only. This will add the | 82 # This all_dependent_settings is used for java targets only. This will add the |
| 75 # jar path to the classpath of dependent java targets. | 83 # jar path to the classpath of dependent java targets. |
| 76 'all_dependent_settings': { | 84 'all_dependent_settings': { |
| 77 'variables': { | 85 'variables': { |
| 78 'input_jars_paths': ['<(jar_path)'], | 86 'input_jars_paths': ['<(jar_path)'], |
| 79 'library_dexed_jars_paths': ['<(dex_path)'], | 87 'library_dexed_jars_paths': ['<(dex_path)'], |
| 80 }, | 88 }, |
| 81 }, | 89 }, |
| 82 'conditions': [ | 90 'conditions': [ |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 'action': [ | 215 'action': [ |
| 208 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', | 216 'python', '<(DEPTH)/build/android/gyp/generate_v14_compatible_resour
ces.py', |
| 209 '--res-dir=<(res_dir)', | 217 '--res-dir=<(res_dir)', |
| 210 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', | 218 '--res-v14-compatibility-dir=<(res_v14_compatibility_dir)', |
| 211 '--stamp', '<(res_v14_compatibility_stamp)', | 219 '--stamp', '<(res_v14_compatibility_stamp)', |
| 212 '<@(res_v14_additional_options)', | 220 '<@(res_v14_additional_options)', |
| 213 ] | 221 ] |
| 214 }, | 222 }, |
| 215 ], | 223 ], |
| 216 }], | 224 }], |
| 225 ['coverage == 1', { |
| 226 'actions': [ |
| 227 { |
| 228 'action_name': 'emma_instr_<(_target_name)', |
| 229 'message': 'Instrumenting <(_target_name) classes', |
| 230 'inputs': [ |
| 231 '<(compile_stamp)', |
| 232 '<(DEPTH)/build/android/ant/apk-instr.xml', |
| 233 '<(DEPTH)/build/android/gyp/ant.py', |
| 234 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 235 ], |
| 236 'outputs': [ |
| 237 '<(intermediate_dir)/coverage.em', |
| 238 '<(classes_final_dir)', |
| 239 ], |
| 240 'action': [ |
| 241 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 242 '-DCLASSES_DIR=<(classes_dir)', |
| 243 '-DCLASSES_INSTR_DIR=<(classes_final_dir)', |
| 244 '-DEMMA_COVERAGE_FILE=<(intermediate_dir)/coverage.em', |
| 245 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 246 '-Dbasedir=.', |
| 247 '-buildfile', |
| 248 '<(DEPTH)/build/android/ant/apk-instr.xml', |
| 249 ] |
| 250 }, |
| 251 ], |
| 252 }], |
| 217 ], | 253 ], |
| 218 'actions': [ | 254 'actions': [ |
| 219 { | 255 { |
| 220 'action_name': 'javac_<(_target_name)', | 256 'action_name': 'javac_<(_target_name)', |
| 221 'message': 'Compiling <(_target_name) java sources', | 257 'message': 'Compiling <(_target_name) java sources', |
| 222 'variables': { | 258 'variables': { |
| 223 'all_src_dirs': [ | 259 'all_src_dirs': [ |
| 224 '>(java_in_dir)/src', | 260 '>(java_in_dir)/src', |
| 225 '>@(additional_src_dirs)', | 261 '>@(additional_src_dirs)', |
| 226 '>@(generated_src_dirs)', | 262 '>@(generated_src_dirs)', |
| (...skipping 18 matching lines...) Expand all Loading... |
| 245 '--chromium-code=<(chromium_code)', | 281 '--chromium-code=<(chromium_code)', |
| 246 '--stamp=<(compile_stamp)', | 282 '--stamp=<(compile_stamp)', |
| 247 | 283 |
| 248 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 284 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 249 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 285 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 250 ] | 286 ] |
| 251 }, | 287 }, |
| 252 { | 288 { |
| 253 'action_name': 'jar_<(_target_name)', | 289 'action_name': 'jar_<(_target_name)', |
| 254 'message': 'Creating <(_target_name) jar', | 290 'message': 'Creating <(_target_name) jar', |
| 291 'conditions': [ |
| 292 ['coverage == 1', { |
| 293 'inputs': [ '<(intermediate_dir)/coverage.em', ] |
| 294 }, { |
| 295 'inputs': [ '<(compile_stamp)' ] |
| 296 }] |
| 297 ], |
| 255 'inputs': [ | 298 'inputs': [ |
| 256 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 299 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 257 '<(DEPTH)/build/android/gyp/util/md5_check.py', | 300 '<(DEPTH)/build/android/gyp/util/md5_check.py', |
| 258 '<(DEPTH)/build/android/gyp/jar.py', | 301 '<(DEPTH)/build/android/gyp/jar.py', |
| 259 '<(compile_stamp)', | |
| 260 ], | 302 ], |
| 261 'outputs': [ | 303 'outputs': [ |
| 262 '<(jar_path)', | 304 '<(jar_path)', |
| 263 ], | 305 ], |
| 264 'action': [ | 306 'action': [ |
| 265 'python', '<(DEPTH)/build/android/gyp/jar.py', | 307 'python', '<(DEPTH)/build/android/gyp/jar.py', |
| 266 '--classes-dir=<(classes_dir)', | 308 '--classes-dir=<(classes_dir)', |
| 267 '--jar-path=<(jar_path)', | 309 '--jar-path=<(jar_path)', |
| 268 '--excluded-classes=<(jar_excluded_classes)', | 310 '--excluded-classes=<(jar_excluded_classes)', |
| 269 | 311 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 295 { | 337 { |
| 296 'action_name': 'dex_<(_target_name)', | 338 'action_name': 'dex_<(_target_name)', |
| 297 'variables': { | 339 'variables': { |
| 298 'dex_input_paths': [ '<(jar_path)' ], | 340 'dex_input_paths': [ '<(jar_path)' ], |
| 299 'output_path': '<(dex_path)', | 341 'output_path': '<(dex_path)', |
| 300 }, | 342 }, |
| 301 'includes': [ 'android/dex_action.gypi' ], | 343 'includes': [ 'android/dex_action.gypi' ], |
| 302 }, | 344 }, |
| 303 ], | 345 ], |
| 304 } | 346 } |
| OLD | NEW |