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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 'variables': { | 76 'variables': { |
77 'input_jars_paths': ['<(jar_path)'], | 77 'input_jars_paths': ['<(jar_path)'], |
78 'library_dexed_jars_paths': ['<(dex_path)'], | 78 'library_dexed_jars_paths': ['<(dex_path)'], |
79 }, | 79 }, |
80 }, | 80 }, |
81 'conditions': [ | 81 'conditions': [ |
82 ['has_java_resources == 1', { | 82 ['has_java_resources == 1', { |
83 'variables': { | 83 'variables': { |
84 'res_dir': '<(java_in_dir)/res', | 84 'res_dir': '<(java_in_dir)/res', |
85 'res_crunched_dir': '<(intermediate_dir)/res_crunched', | 85 'res_crunched_dir': '<(intermediate_dir)/res_crunched', |
| 86 'res_mirrored_dir': '<(intermediate_dir)/res_mirrored', |
86 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 87 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
87 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 88 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
88 'R_dir': '<(intermediate_dir)/java_R', | 89 'R_dir': '<(intermediate_dir)/java_R', |
89 'R_text_file': '<(R_dir)/R.txt', | 90 'R_text_file': '<(R_dir)/R.txt', |
90 'R_stamp': '<(intermediate_dir)/resources.stamp', | 91 'R_stamp': '<(intermediate_dir)/resources.stamp', |
91 'generated_src_dirs': ['<(R_dir)'], | 92 'generated_src_dirs': ['<(R_dir)'], |
92 'additional_input_paths': ['<(R_stamp)'], | 93 'additional_input_paths': ['<(R_stamp)'], |
93 'additional_res_dirs': [], | 94 'additional_res_dirs': [], |
94 'dependencies_res_files': [], | 95 'dependencies_res_files': [], |
95 }, | 96 }, |
96 'all_dependent_settings': { | 97 'all_dependent_settings': { |
97 'variables': { | 98 'variables': { |
98 # Dependent jars include this target's R.java file via | 99 # Dependent jars include this target's R.java file via |
99 # generated_R_dirs and include its resources via | 100 # generated_R_dirs and include its resources via |
100 # dependencies_res_files. | 101 # dependencies_res_files. |
101 'generated_R_dirs': ['<(R_dir)'], | 102 'generated_R_dirs': ['<(R_dir)'], |
102 'additional_input_paths': ['<(R_stamp)'], | 103 'additional_input_paths': ['<(R_stamp)'], |
103 'dependencies_res_files': ['<@(resource_input_paths)'], | 104 'dependencies_res_files': ['<@(resource_input_paths)'], |
104 | 105 |
105 # Dependent APKs include this target's resources via | 106 # Dependent APKs include this target's resources via |
106 # additional_res_dirs, additional_res_packages, and | 107 # additional_res_dirs, additional_res_packages, and |
107 # additional_R_text_files. | 108 # additional_R_text_files. |
108 'additional_res_dirs': ['<(res_crunched_dir)', '<@(res_input_dirs)'], | 109 'additional_res_dirs': ['<(res_crunched_dir)', |
| 110 '<(res_mirrored_dir)', |
| 111 '<@(res_input_dirs)'], |
109 'additional_res_packages': ['<(R_package)'], | 112 'additional_res_packages': ['<(R_package)'], |
110 'additional_R_text_files': ['<(R_text_file)'], | 113 'additional_R_text_files': ['<(R_text_file)'], |
111 }, | 114 }, |
112 }, | 115 }, |
113 'conditions': [ | 116 'conditions': [ |
114 ['java_strings_grd != ""', { | 117 ['java_strings_grd != ""', { |
115 'variables': { | 118 'variables': { |
116 'res_grit_dir': '<(intermediate_dir)/res_grit', | 119 'res_grit_dir': '<(intermediate_dir)/res_grit', |
117 'res_input_dirs': ['<(res_grit_dir)'], | 120 'res_input_dirs': ['<(res_grit_dir)'], |
118 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', | 121 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ], | 154 ], |
152 'outputs': [ | 155 'outputs': [ |
153 '<(R_stamp)', | 156 '<(R_stamp)', |
154 ], | 157 ], |
155 'action': [ | 158 'action': [ |
156 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | 159 'python', '<(DEPTH)/build/android/gyp/process_resources.py', |
157 '--android-sdk', '<(android_sdk)', | 160 '--android-sdk', '<(android_sdk)', |
158 '--android-sdk-tools', '<(android_sdk_tools)', | 161 '--android-sdk-tools', '<(android_sdk_tools)', |
159 '--R-dir', '<(R_dir)', | 162 '--R-dir', '<(R_dir)', |
160 '--res-dirs', '>(all_res_dirs)', | 163 '--res-dirs', '>(all_res_dirs)', |
161 '--crunch-input-dir', '>(res_dir)', | 164 '--crunch-and-mirror-input-dir', '>(res_dir)', |
162 '--crunch-output-dir', '<(res_crunched_dir)', | 165 '--crunch-output-dir', '<(res_crunched_dir)', |
| 166 '--mirror-output-dir', '<(res_mirrored_dir)', |
163 '--android-manifest', '<(android_manifest)', | 167 '--android-manifest', '<(android_manifest)', |
164 '--non-constant-id', | 168 '--non-constant-id', |
165 '--custom-package', '<(R_package)', | 169 '--custom-package', '<(R_package)', |
166 '--stamp', '<(R_stamp)', | 170 '--stamp', '<(R_stamp)', |
167 | 171 |
168 # Add hash of inputs to the command line, so if inputs change | 172 # Add hash of inputs to the command line, so if inputs change |
169 # (e.g. if a resource if removed), the command will be re-run. | 173 # (e.g. if a resource if removed), the command will be re-run. |
170 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 174 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
171 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 175 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
172 ], | 176 ], |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 274 |
271 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 275 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
272 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 276 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
273 | 277 |
274 '<(jar_path)', | 278 '<(jar_path)', |
275 ] | 279 ] |
276 }, | 280 }, |
277 | 281 |
278 ], | 282 ], |
279 } | 283 } |
OLD | NEW |