| 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_v14_dir': '<(intermediate_dir)/res_v14', |
| 87 'res_v17_dir': '<(intermediate_dir)/res_v17', |
| 86 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], | 88 'res_input_dirs': ['<(res_dir)', '<@(res_extra_dirs)'], |
| 87 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], | 89 'resource_input_paths': ['<!@(find <(res_dir) -type f)'], |
| 88 'R_dir': '<(intermediate_dir)/java_R', | 90 'R_dir': '<(intermediate_dir)/java_R', |
| 89 'R_text_file': '<(R_dir)/R.txt', | 91 'R_text_file': '<(R_dir)/R.txt', |
| 90 'R_stamp': '<(intermediate_dir)/resources.stamp', | 92 'R_stamp': '<(intermediate_dir)/resources.stamp', |
| 91 'generated_src_dirs': ['<(R_dir)'], | 93 'generated_src_dirs': ['<(R_dir)'], |
| 92 'additional_input_paths': ['<(R_stamp)'], | 94 'additional_input_paths': ['<(R_stamp)'], |
| 93 'additional_res_dirs': [], | 95 'additional_res_dirs': [], |
| 94 'dependencies_res_files': [], | 96 'dependencies_res_files': [], |
| 95 }, | 97 }, |
| 96 'all_dependent_settings': { | 98 'all_dependent_settings': { |
| 97 'variables': { | 99 'variables': { |
| 98 # Dependent jars include this target's R.java file via | 100 # Dependent jars include this target's R.java file via |
| 99 # generated_R_dirs and include its resources via | 101 # generated_R_dirs and include its resources via |
| 100 # dependencies_res_files. | 102 # dependencies_res_files. |
| 101 'generated_R_dirs': ['<(R_dir)'], | 103 'generated_R_dirs': ['<(R_dir)'], |
| 102 'additional_input_paths': ['<(R_stamp)'], | 104 'additional_input_paths': ['<(R_stamp)'], |
| 103 'dependencies_res_files': ['<@(resource_input_paths)'], | 105 'dependencies_res_files': ['<@(resource_input_paths)'], |
| 104 | 106 |
| 105 # Dependent APKs include this target's resources via | 107 # Dependent APKs include this target's resources via |
| 106 # additional_res_dirs, additional_res_packages, and | 108 # additional_res_dirs, additional_res_packages, and |
| 107 # additional_R_text_files. | 109 # additional_R_text_files. |
| 108 'additional_res_dirs': ['<(res_crunched_dir)', '<@(res_input_dirs)'], | 110 'additional_res_dirs': ['<(res_crunched_dir)', |
| 111 '<(res_v17_dir)', |
| 112 '<(res_v14_dir)', |
| 113 '<@(res_input_dirs)'], |
| 109 'additional_res_packages': ['<(R_package)'], | 114 'additional_res_packages': ['<(R_package)'], |
| 110 'additional_R_text_files': ['<(R_text_file)'], | 115 'additional_R_text_files': ['<(R_text_file)'], |
| 111 }, | 116 }, |
| 112 }, | 117 }, |
| 113 'conditions': [ | 118 'conditions': [ |
| 114 ['java_strings_grd != ""', { | 119 ['java_strings_grd != ""', { |
| 115 'variables': { | 120 'variables': { |
| 116 'res_grit_dir': '<(intermediate_dir)/res_grit', | 121 'res_grit_dir': '<(intermediate_dir)/res_grit', |
| 117 'res_input_dirs': ['<(res_grit_dir)'], | 122 'res_input_dirs': ['<(res_grit_dir)'], |
| 118 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', | 123 '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', | 146 'android_manifest': '<(DEPTH)/build/android/AndroidManifest.xml', |
| 142 # Include the dependencies' res dirs so that references to | 147 # Include the dependencies' res dirs so that references to |
| 143 # resources in dependencies can be resolved. | 148 # resources in dependencies can be resolved. |
| 144 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], | 149 'all_res_dirs': ['<@(res_input_dirs)', '>@(additional_res_dirs)'], |
| 145 }, | 150 }, |
| 146 'inputs': [ | 151 'inputs': [ |
| 147 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 152 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 148 '<(DEPTH)/build/android/gyp/process_resources.py', | 153 '<(DEPTH)/build/android/gyp/process_resources.py', |
| 149 '>@(resource_input_paths)', | 154 '>@(resource_input_paths)', |
| 150 '>@(dependencies_res_files)', | 155 '>@(dependencies_res_files)', |
| 156 '<(res_v14_dir)', |
| 157 '<(res_v17_dir)', |
| 151 ], | 158 ], |
| 152 'outputs': [ | 159 'outputs': [ |
| 153 '<(R_stamp)', | 160 '<(R_stamp)', |
| 154 ], | 161 ], |
| 155 'action': [ | 162 'action': [ |
| 156 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | 163 'python', '<(DEPTH)/build/android/gyp/process_resources.py', |
| 157 '--android-sdk', '<(android_sdk)', | 164 '--android-sdk', '<(android_sdk)', |
| 158 '--android-sdk-tools', '<(android_sdk_tools)', | 165 '--android-sdk-tools', '<(android_sdk_tools)', |
| 159 '--R-dir', '<(R_dir)', | 166 '--R-dir', '<(R_dir)', |
| 160 '--res-dirs', '>(all_res_dirs)', | 167 '--res-dirs', '>(all_res_dirs)', |
| 161 '--crunch-input-dir', '>(res_dir)', | 168 '--crunch-input-dir', '>(res_dir)', |
| 162 '--crunch-output-dir', '<(res_crunched_dir)', | 169 '--crunch-output-dir', '<(res_crunched_dir)', |
| 163 '--android-manifest', '<(android_manifest)', | 170 '--android-manifest', '<(android_manifest)', |
| 164 '--non-constant-id', | 171 '--non-constant-id', |
| 165 '--custom-package', '<(R_package)', | 172 '--custom-package', '<(R_package)', |
| 166 '--stamp', '<(R_stamp)', | 173 '--stamp', '<(R_stamp)', |
| 167 | 174 |
| 168 # Add hash of inputs to the command line, so if inputs change | 175 # 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. | 176 # (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. | 177 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 171 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 178 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 172 ], | 179 ], |
| 173 }, | 180 }, |
| 181 # Copy API 17 resources. |
| 182 { |
| 183 'action_name': 'copy_api_17_resources_<(_target_name)', |
| 184 'message': 'Copying Android API 17 resources <(_target_name)', |
| 185 'inputs': [ |
| 186 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 187 '<(DEPTH)/build/android/gyp/copy_resources_v17.py', |
| 188 '>@(resource_input_paths)', |
| 189 ], |
| 190 'outputs': [ |
| 191 '<(res_v17_dir)', |
| 192 ], |
| 193 'action': [ |
| 194 'python', '<(DEPTH)/build/android/gyp/copy_resources_v17.py', |
| 195 '--res-dir=<(res_dir)', |
| 196 '--res-v17-dir=<(res_v17_dir)', |
| 197 ] |
| 198 }, |
| 199 # Generate API 14 resources. |
| 200 { |
| 201 'action_name': 'generate_api_14_resources_<(_target_name)', |
| 202 'message': 'Generating Android API 14 resources <(_target_name)', |
| 203 'inputs': [ |
| 204 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 205 '<(DEPTH)/build/android/gyp/generate_v14_resources.py', |
| 206 '>@(resource_input_paths)', |
| 207 ], |
| 208 'outputs': [ |
| 209 '<(res_v14_dir)', |
| 210 ], |
| 211 'action': [ |
| 212 'python', '<(DEPTH)/build/android/gyp/generate_v14_resources.py', |
| 213 '--res-dir=<(res_dir)', |
| 214 '--res-v14-dir=<(res_v14_dir)', |
| 215 ] |
| 216 }, |
| 174 ], | 217 ], |
| 175 }], | 218 }], |
| 176 ], | 219 ], |
| 177 'actions': [ | 220 'actions': [ |
| 178 { | 221 { |
| 179 'action_name': 'javac_<(_target_name)', | 222 'action_name': 'javac_<(_target_name)', |
| 180 'message': 'Compiling <(_target_name) java sources', | 223 'message': 'Compiling <(_target_name) java sources', |
| 181 'variables': { | 224 'variables': { |
| 182 'all_src_dirs': [ | 225 'all_src_dirs': [ |
| 183 '>(java_in_dir)/src', | 226 '>(java_in_dir)/src', |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 313 |
| 271 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. | 314 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja
. |
| 272 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', | 315 '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| 273 | 316 |
| 274 '<(jar_path)', | 317 '<(jar_path)', |
| 275 ] | 318 ] |
| 276 }, | 319 }, |
| 277 | 320 |
| 278 ], | 321 ], |
| 279 } | 322 } |
| OLD | NEW |