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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_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 'generated_src_dirs': ['>@(generated_R_dirs)'], | 62 'generated_src_dirs': ['>@(generated_R_dirs)'], |
62 'generated_R_dirs': [], | 63 'generated_R_dirs': [], |
63 'has_java_resources%': 0, | 64 'has_java_resources%': 0, |
64 'java_strings_grd%': '', | 65 'java_strings_grd%': '', |
65 'res_extra_dirs': [], | 66 'res_extra_dirs': [], |
66 'res_extra_files': [], | 67 'res_extra_files': [], |
67 'resource_input_paths': ['>@(res_extra_files)'], | 68 'resource_input_paths': ['>@(res_extra_files)'], |
68 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 69 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
69 'classes_dir': '<(intermediate_dir)/classes', | 70 'classes_dir': '<(intermediate_dir)/classes', |
70 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 71 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
71 }, | 72 }, |
72 # This all_dependent_settings is used for java targets only. This will add the | 73 # This all_dependent_settings is used for java targets only. This will add the |
73 # jar path to the classpath of dependent java targets. | 74 # jar path to the classpath of dependent java targets. |
74 'all_dependent_settings': { | 75 'all_dependent_settings': { |
75 'variables': { | 76 'variables': { |
76 'input_jars_paths': ['<(jar_path)'], | 77 'input_jars_paths': ['<(jar_path)'], |
| 78 'library_dexed_jars_paths': ['<(dex_path)'], |
77 }, | 79 }, |
78 }, | 80 }, |
79 'conditions': [ | 81 'conditions': [ |
80 ['has_java_resources == 1', { | 82 ['has_java_resources == 1', { |
81 'variables': { | 83 'variables': { |
82 'res_dir': '<(java_in_dir)/res', | 84 'res_dir': '<(java_in_dir)/res', |
83 'res_crunched_dir': '<(intermediate_dir)/res_crunched', | 85 'res_crunched_dir': '<(intermediate_dir)/res_crunched', |
84 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 86 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
85 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 87 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
86 'R_dir': '<(intermediate_dir)/java_R', | 88 'R_dir': '<(intermediate_dir)/java_R', |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 'action': [ | 221 'action': [ |
220 'python', '<(DEPTH)/build/android/jar.py', | 222 'python', '<(DEPTH)/build/android/jar.py', |
221 '--classes-dir=<(classes_dir)', | 223 '--classes-dir=<(classes_dir)', |
222 '--jar-path=<(jar_path)', | 224 '--jar-path=<(jar_path)', |
223 '--excluded-classes=<(jar_excluded_classes)', | 225 '--excluded-classes=<(jar_excluded_classes)', |
224 | 226 |
225 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 227 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
226 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 228 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
227 ] | 229 ] |
228 }, | 230 }, |
| 231 { |
| 232 'action_name': 'dex_<(_target_name)', |
| 233 'message': 'Dexing <(_target_name) jar', |
| 234 'inputs': [ |
| 235 '<(DEPTH)/build/android/pylib/build_utils.py', |
| 236 '<(DEPTH)/build/android/dex.py', |
| 237 '<(jar_path)', |
| 238 ], |
| 239 'outputs': [ |
| 240 '<(dex_path)', |
| 241 ], |
| 242 'action': [ |
| 243 'python', '<(DEPTH)/build/android/dex.py', |
| 244 '--dex-path=<(dex_path)', |
| 245 '--android-sdk-root=<(android_sdk_root)', |
| 246 |
| 247 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 248 '--ignore=>!(echo >(_inputs) | md5sum)', |
| 249 |
| 250 '<(jar_path)', |
| 251 ] |
| 252 }, |
| 253 |
229 ], | 254 ], |
230 } | 255 } |
OLD | NEW |