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 22 matching lines...) Expand all Loading... |
141 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', | 144 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', |
142 # Include the dependencies' res dirs so that references to | 145 # Include the dependencies' res dirs so that references to |
143 # resources in dependencies can be resolved. | 146 # resources in dependencies can be resolved. |
144 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], | 147 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], |
145 }, | 148 }, |
146 'inputs': [ | 149 'inputs': [ |
147 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 150 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
148 '<(DEPTH)/build/android/gyp/process_resources.py', | 151 '<(DEPTH)/build/android/gyp/process_resources.py', |
149 '>@(resource_input_paths)', | 152 '>@(resource_input_paths)', |
150 '>@(dependencies_res_files)', | 153 '>@(dependencies_res_files)', |
| 154 '<(res_mirrored_dir)', |
151 ], | 155 ], |
152 'outputs': [ | 156 'outputs': [ |
153 '<(R_stamp)', | 157 '<(R_stamp)', |
154 ], | 158 ], |
155 'action': [ | 159 'action': [ |
156 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | 160 'python', '<(DEPTH)/build/android/gyp/process_resources.py', |
157 '--android-sdk', '<(android_sdk)', | 161 '--android-sdk', '<(android_sdk)', |
158 '--android-sdk-tools', '<(android_sdk_tools)', | 162 '--android-sdk-tools', '<(android_sdk_tools)', |
159 '--R-dir', '<(R_dir)', | 163 '--R-dir', '<(R_dir)', |
160 '--res-dirs', '>(all_res_dirs)', | 164 '--res-dirs', '>(all_res_dirs)', |
161 '--crunch-input-dir', '>(res_dir)', | 165 '--crunch-input-dir', '>(res_dir)', |
162 '--crunch-output-dir', '<(res_crunched_dir)', | 166 '--crunch-output-dir', '<(res_crunched_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 ], |
173 }, | 177 }, |
| 178 # Generate API 14 resources. |
| 179 { |
| 180 'action_name': 'generate_api_14_resources_<(_target_name)', |
| 181 'message': 'Generating Android API 14 resources <(_target_name)', |
| 182 'inputs': [ |
| 183 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 184 '<(DEPTH)/build/android/gyp/mirror_resources.py', |
| 185 '>@(resource_input_paths)', |
| 186 ], |
| 187 'outputs': [ |
| 188 '<(res_mirrored_dir)', |
| 189 ], |
| 190 'action': [ |
| 191 'python', '<(DEPTH)/build/android/gyp/mirror_resources.py', |
| 192 '--res-dir=<(res_dir)', |
| 193 '--res-mirrored-dir=<(res_mirrored_dir)', |
| 194 ] |
| 195 }, |
174 ], | 196 ], |
175 }], | 197 }], |
176 ], | 198 ], |
177 'actions': [ | 199 'actions': [ |
178 { | 200 { |
179 'action_name': 'javac_<(_target_name)', | 201 'action_name': 'javac_<(_target_name)', |
180 'message': 'Compiling <(_target_name) java sources', | 202 'message': 'Compiling <(_target_name) java sources', |
181 'variables': { | 203 'variables': { |
182 'all_src_dirs': [ | 204 'all_src_dirs': [ |
183 '>(java_in_dir)/src', | 205 '>(java_in_dir)/src', |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 292 |
271 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 293 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
272 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 294 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
273 | 295 |
274 '<(jar_path)', | 296 '<(jar_path)', |
275 ] | 297 ] |
276 }, | 298 }, |
277 | 299 |
278 ], | 300 ], |
279 } | 301 } |
OLD | NEW |