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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 'dependencies': [ | 46 'dependencies': [ |
47 '<(DEPTH)/build/build_output_dirs_android.gyp:build_output_dirs' | 47 '<(DEPTH)/build/build_output_dirs_android.gyp:build_output_dirs' |
48 ], | 48 ], |
49 'variables': { | 49 'variables': { |
50 'input_jars_paths': [ '<(android_sdk_jar)' ], | 50 'input_jars_paths': [ '<(android_sdk_jar)' ], |
51 'additional_src_dirs': [], | 51 'additional_src_dirs': [], |
52 'javac_includes': [], | 52 'javac_includes': [], |
53 'jar_name': '<(_target_name).jar', | 53 'jar_name': '<(_target_name).jar', |
54 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 54 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
55 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], | 55 'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ], |
56 'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar', | |
shashi
2013/03/23 01:07:41
nit: it may be cleaner to have a separate folder:
| |
56 'additional_input_paths': ['>@(additional_R_files)'], | 57 'additional_input_paths': ['>@(additional_R_files)'], |
57 'generated_src_dirs': ['>@(generated_R_dirs)'], | 58 'generated_src_dirs': ['>@(generated_R_dirs)'], |
58 'generated_R_dirs': [], | 59 'generated_R_dirs': [], |
59 'additional_R_files': [], | 60 'additional_R_files': [], |
60 'has_java_resources%': 0, | 61 'has_java_resources%': 0, |
61 'java_strings_grd%': '', | 62 'java_strings_grd%': '', |
62 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | 63 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', |
63 'classes_dir': '<(intermediate_dir)/classes', | 64 'classes_dir': '<(intermediate_dir)/classes', |
64 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 65 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
65 }, | 66 }, |
66 # This all_dependent_settings is used for java targets only. This will add the | 67 # This all_dependent_settings is used for java targets only. This will add the |
67 # jar path to the classpath of dependent java targets. | 68 # jar path to the classpath of dependent java targets. |
Yaron
2013/03/23 00:33:05
Nit: update
| |
68 'all_dependent_settings': { | 69 'all_dependent_settings': { |
69 'variables': { | 70 'variables': { |
70 'input_jars_paths': ['<(jar_path)'], | 71 'input_jars_paths': ['<(jar_path)'], |
72 'library_dexed_jars_paths': ['<(dex_path)'], | |
71 }, | 73 }, |
72 }, | 74 }, |
73 'conditions': [ | 75 'conditions': [ |
74 ['has_java_resources == 1', { | 76 ['has_java_resources == 1', { |
75 'variables': { | 77 'variables': { |
76 'res_dir': '<(java_in_dir)/res', | 78 'res_dir': '<(java_in_dir)/res', |
77 'out_res_dir': '<(intermediate_dir)/res', | 79 'out_res_dir': '<(intermediate_dir)/res', |
78 'R_dir': '<(intermediate_dir)/java_R', | 80 'R_dir': '<(intermediate_dir)/java_R', |
79 'R_file': '<(R_dir)/<(R_package_relpath)/R.java', | 81 'R_file': '<(R_dir)/<(R_package_relpath)/R.java', |
80 'R_text_file': '<(R_dir)/R.txt', | 82 'R_text_file': '<(R_dir)/R.txt', |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 'action': [ | 201 'action': [ |
200 'python', '<(DEPTH)/build/android/jar.py', | 202 'python', '<(DEPTH)/build/android/jar.py', |
201 '--classes-dir=<(classes_dir)', | 203 '--classes-dir=<(classes_dir)', |
202 '--jar-path=<(jar_path)', | 204 '--jar-path=<(jar_path)', |
203 '--excluded-classes=<(jar_excluded_classes)', | 205 '--excluded-classes=<(jar_excluded_classes)', |
204 | 206 |
205 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . | 207 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . |
206 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 208 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
207 ] | 209 ] |
208 }, | 210 }, |
211 { | |
212 'action_name': 'dex_<(_target_name)', | |
213 'message': 'Dexing <(_target_name) jar', | |
214 'inputs': [ | |
215 '<(DEPTH)/build/android/pylib/build_utils.py', | |
216 '<(DEPTH)/build/android/dex.py', | |
217 '<(jar_path)', | |
218 ], | |
219 'outputs': [ | |
220 '<(dex_path)', | |
221 ], | |
222 'action': [ | |
223 'python', '<(DEPTH)/build/android/dex.py', | |
224 '--dex-path=<(dex_path)', | |
225 '--android-sdk-root=<(android_sdk_root)', | |
226 | |
227 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja . | |
228 '--ignore=>!(echo >(_inputs) | md5sum)', | |
229 | |
230 '<(jar_path)', | |
231 ] | |
232 }, | |
233 | |
209 ], | 234 ], |
210 } | 235 } |
OLD | NEW |