Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 }, | 58 }, |
| 59 'variables': { | 59 'variables': { |
| 60 'input_jars_paths': [], | 60 'input_jars_paths': [], |
| 61 'additional_src_dirs': [], | 61 'additional_src_dirs': [], |
| 62 'javac_includes': [], | 62 'javac_includes': [], |
| 63 'additional_input_paths': ['>@(additional_R_files)'], | 63 'additional_input_paths': ['>@(additional_R_files)'], |
| 64 'generated_src_dirs': ['>@(generated_R_dirs)'], | 64 'generated_src_dirs': ['>@(generated_R_dirs)'], |
| 65 'generated_R_dirs': [], | 65 'generated_R_dirs': [], |
| 66 'additional_R_files': [], | 66 'additional_R_files': [], |
| 67 'has_java_resources%': 0, | 67 'has_java_resources%': 0, |
| 68 'grit_grd_file%': '', | |
| 68 }, | 69 }, |
| 69 'conditions': [ | 70 'conditions': [ |
| 70 ['has_java_resources == 1', { | 71 ['has_java_resources == 1', { |
| 71 'variables': { | 72 'variables': { |
| 72 'res_dir': '<(java_in_dir)/res', | 73 'res_dir': '<(java_in_dir)/res', |
| 73 'crunched_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/res', | 74 'out_res_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/res', |
| 74 'R_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/java_R', | 75 'R_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/java_R', |
| 75 'R_file': '<(R_dir)/<(R_package_relpath)/R.java', | 76 'R_file': '<(R_dir)/<(R_package_relpath)/R.java', |
| 76 'generated_src_dirs': ['<(R_dir)'], | 77 'generated_src_dirs': ['<(R_dir)'], |
| 77 'additional_input_paths': ['<(R_file)'], | 78 'additional_input_paths': ['<(R_file)'], |
| 78 }, | 79 }, |
| 79 'all_dependent_settings': { | 80 'all_dependent_settings': { |
| 80 'variables': { | 81 'variables': { |
| 81 # Dependent jars include this target's R.java file via | 82 # Dependent jars include this target's R.java file via |
| 82 # generated_R_dirs and additional_R_files. | 83 # generated_R_dirs and additional_R_files. |
| 83 'generated_R_dirs': ['<(R_dir)'], | 84 'generated_R_dirs': ['<(R_dir)'], |
| 84 'additional_R_files': ['<(R_file)'], | 85 'additional_R_files': ['<(R_file)'], |
| 85 | 86 |
| 86 # Dependent APKs include this target's resources via | 87 # Dependent APKs include this target's resources via |
| 87 # additional_res_dirs and additional_res_packages. | 88 # additional_res_dirs and additional_res_packages. |
| 88 'additional_res_dirs': ['<(crunched_res_dir)', '<(res_dir)'], | 89 'additional_res_dirs': ['<(out_res_dir)', '<(res_dir)'], |
| 89 'additional_res_packages': ['<(R_package)'], | 90 'additional_res_packages': ['<(R_package)'], |
| 90 }, | 91 }, |
| 91 }, | 92 }, |
| 92 'actions': [ | 93 'actions': [ |
| 93 # Generate R.java and crunch image resources. | 94 # Generate R.java and crunch image resources. |
| 94 { | 95 { |
| 95 'action_name': 'process_resources', | 96 'action_name': 'process_resources', |
| 96 'message': 'processing resources for <(package_name)', | 97 'message': 'processing resources for <(package_name)', |
| 98 'conditions': [ | |
| 99 ['grit_grd_file != ""', { | |
| 100 'inputs': [ | |
| 101 # TODO(newt): replace this with .../values/strings.xml once | |
| 102 # the English strings.xml is generated as well? That would be | |
| 103 # simpler and faster and should be equivalent. | |
| 104 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_re s_dir)" <(grit_grd_file))', | |
|
newt (away)
2012/12/21 08:12:41
It would be nice if this duplication could be elim
| |
| 105 ], | |
| 106 }], | |
| 107 ], | |
| 97 'inputs': [ | 108 'inputs': [ |
| 98 '<(DEPTH)/build/android/process_resources.py', | 109 '<(DEPTH)/build/android/process_resources.py', |
| 99 '<!@(find <(res_dir) -type f)', | 110 '<!@(find <(res_dir) -type f)', |
| 100 ], | 111 ], |
| 101 'outputs': [ | 112 'outputs': [ |
| 102 '<(R_file)', | 113 '<(R_file)', |
| 103 ], | 114 ], |
| 104 'action': [ | 115 'action': [ |
| 105 '<(DEPTH)/build/android/process_resources.py', | 116 '<(DEPTH)/build/android/process_resources.py', |
| 106 '--android-sdk', '<(android_sdk)', | 117 '--android-sdk', '<(android_sdk)', |
| 107 '--android-sdk-tools', '<(android_sdk_tools)', | 118 '--android-sdk-tools', '<(android_sdk_tools)', |
| 108 '--R-package', '<(R_package)', | 119 '--R-package', '<(R_package)', |
| 109 '--R-dir', '<(R_dir)', | 120 '--R-dir', '<(R_dir)', |
| 110 '--res-dir', '<(res_dir)', | 121 '--res-dir', '<(res_dir)', |
| 111 '--crunched-res-dir', '<(crunched_res_dir)', | 122 '--crunched-res-dir', '<(out_res_dir)', |
| 112 ], | 123 ], |
| 113 }, | 124 }, |
| 114 ], | 125 ], |
| 126 'conditions': [ | |
| 127 ['grit_grd_file != ""', { | |
| 128 'actions': [ | |
| 129 { | |
| 130 'action_name': 'generate_localized_strings_xml', | |
| 131 'variables': { | |
| 132 'grit_out_dir': '<(out_res_dir)', | |
| 133 # resource_ids is unneeded since we don't generate .h headers. | |
| 134 'grit_resource_ids': '', | |
| 135 }, | |
| 136 'includes': ['../build/grit_action.gypi'], | |
| 137 }, | |
| 138 ], | |
| 139 }], | |
| 140 ], | |
| 115 }], | 141 }], |
| 116 ], | 142 ], |
| 117 'actions': [ | 143 'actions': [ |
| 118 { | 144 { |
| 119 'action_name': 'ant_<(package_name)', | 145 'action_name': 'ant_<(package_name)', |
| 120 'message': 'Building <(package_name) java sources.', | 146 'message': 'Building <(package_name) java sources.', |
| 121 'inputs': [ | 147 'inputs': [ |
| 122 'android/ant/common.xml', | 148 'android/ant/common.xml', |
| 123 'android/ant/chromium-jars.xml', | 149 'android/ant/chromium-jars.xml', |
| 124 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', | 150 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 144 '-DPACKAGE_NAME=<(package_name)', | 170 '-DPACKAGE_NAME=<(package_name)', |
| 145 '-DJAVAC_INCLUDES=>(javac_includes)', | 171 '-DJAVAC_INCLUDES=>(javac_includes)', |
| 146 | 172 |
| 147 '-Dbasedir=<(java_in_dir)', | 173 '-Dbasedir=<(java_in_dir)', |
| 148 '-buildfile', | 174 '-buildfile', |
| 149 '<(DEPTH)/build/android/ant/chromium-jars.xml' | 175 '<(DEPTH)/build/android/ant/chromium-jars.xml' |
| 150 ] | 176 ] |
| 151 }, | 177 }, |
| 152 ], | 178 ], |
| 153 } | 179 } |
| OLD | NEW |