| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 | 6 |
| 7 assert(is_android) | 7 assert(is_android) |
| 8 | 8 |
| 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
| 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
| 11 rebased_android_sdk_build_tools = | 11 rebased_android_sdk_build_tools = |
| 12 rebase_path(android_sdk_build_tools, root_build_dir) | 12 rebase_path(android_sdk_build_tools, root_build_dir) |
| 13 | 13 |
| 14 android_sdk_jar = "$android_sdk/android.jar" | 14 android_sdk_jar = "$android_sdk/android.jar" |
| 15 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) | 15 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) |
| 16 android_aapt_path = "$rebased_android_sdk_build_tools/aapt" | 16 android_aapt_path = "$rebased_android_sdk_build_tools/aapt" |
| 17 | 17 |
| 18 template("android_lint") { | 18 template("android_lint") { |
| 19 set_sources_assignment_filter([]) | 19 set_sources_assignment_filter([]) |
| 20 if (defined(invoker.testonly)) { | |
| 21 testonly = invoker.testonly | |
| 22 } | |
| 23 | 20 |
| 24 jar_path = invoker.jar_path | 21 jar_path = invoker.jar_path |
| 25 android_manifest = invoker.android_manifest | 22 android_manifest = invoker.android_manifest |
| 26 java_files = invoker.java_files | 23 java_files = invoker.java_files |
| 27 base_path = "$target_gen_dir/$target_name" | 24 base_path = "$target_gen_dir/$target_name" |
| 28 | 25 |
| 29 action(target_name) { | 26 action(target_name) { |
| 27 forward_variables_from(invoker, |
| 28 [ |
| 29 "deps", |
| 30 "data_deps", |
| 31 "public_deps", |
| 32 "testonly", |
| 33 ]) |
| 30 script = "//build/android/gyp/lint.py" | 34 script = "//build/android/gyp/lint.py" |
| 31 result_path = base_path + "/result.xml" | 35 result_path = base_path + "/result.xml" |
| 32 config_path = base_path + "/config.xml" | 36 config_path = base_path + "/config.xml" |
| 33 suppressions_file = "//build/android/lint/suppressions.xml" | 37 suppressions_file = "//build/android/lint/suppressions.xml" |
| 34 inputs = [ | 38 inputs = [ |
| 35 suppressions_file, | 39 suppressions_file, |
| 36 android_manifest, | 40 android_manifest, |
| 37 jar_path, | 41 jar_path, |
| 38 ] + java_files | 42 ] + java_files |
| 39 | 43 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 53 "--product-dir=.", | 57 "--product-dir=.", |
| 54 "--jar-path", | 58 "--jar-path", |
| 55 rebase_path(jar_path, root_build_dir), | 59 rebase_path(jar_path, root_build_dir), |
| 56 "--processed-config-path", | 60 "--processed-config-path", |
| 57 rebase_path(config_path, root_build_dir), | 61 rebase_path(config_path, root_build_dir), |
| 58 "--result-path", | 62 "--result-path", |
| 59 rebase_path(result_path, root_build_dir), | 63 rebase_path(result_path, root_build_dir), |
| 60 "--java-files=$rebased_java_files", | 64 "--java-files=$rebased_java_files", |
| 61 "--enable", | 65 "--enable", |
| 62 ] | 66 ] |
| 63 | |
| 64 if (defined(invoker.deps)) { | |
| 65 deps = invoker.deps | |
| 66 } | |
| 67 if (defined(invoker.public_deps)) { | |
| 68 public_deps = invoker.public_deps | |
| 69 } | |
| 70 if (defined(invoker.data_deps)) { | |
| 71 data_deps = invoker.data_deps | |
| 72 } | |
| 73 } | 67 } |
| 74 } | 68 } |
| 75 | 69 |
| 76 template("findbugs") { | 70 template("findbugs") { |
| 77 jar_path = invoker.jar_path | 71 jar_path = invoker.jar_path |
| 78 | 72 |
| 79 build_config = invoker.build_config | 73 build_config = invoker.build_config |
| 80 | 74 |
| 81 action(target_name) { | 75 action(target_name) { |
| 76 forward_variables_from(invoker, |
| 77 [ |
| 78 "deps", |
| 79 "testonly", |
| 80 ]) |
| 82 script = "//build/android/findbugs_diff.py" | 81 script = "//build/android/findbugs_diff.py" |
| 83 depfile = "$target_gen_dir/$target_name.d" | 82 depfile = "$target_gen_dir/$target_name.d" |
| 84 result_path = "$target_gen_dir/$target_name/result.xml" | 83 result_path = "$target_gen_dir/$target_name/result.xml" |
| 85 exclusions_file = "//build/android/findbugs_filter/findbugs_exclude.xml" | 84 exclusions_file = "//build/android/findbugs_filter/findbugs_exclude.xml" |
| 86 | 85 |
| 87 rebased_build_config = rebase_path(build_config, root_build_dir) | 86 rebased_build_config = rebase_path(build_config, root_build_dir) |
| 88 | 87 |
| 89 if (defined(invoker.deps)) { | |
| 90 deps = invoker.deps | |
| 91 } | |
| 92 | |
| 93 if (defined(invoker.testonly)) { | |
| 94 testonly = invoker.testonly | |
| 95 } | |
| 96 | |
| 97 inputs = [ | 88 inputs = [ |
| 98 "//build/android/pylib/utils/findbugs.py", | 89 "//build/android/pylib/utils/findbugs.py", |
| 99 exclusions_file, | 90 exclusions_file, |
| 100 jar_path, | 91 jar_path, |
| 101 ] | 92 ] |
| 102 | 93 |
| 103 outputs = [ | 94 outputs = [ |
| 104 depfile, | 95 depfile, |
| 105 result_path, | 96 result_path, |
| 106 ] | 97 ] |
| 107 | 98 |
| 108 args = [ | 99 args = [ |
| 109 "--depfile", | 100 "--depfile", |
| 110 rebase_path(depfile, root_build_dir), | 101 rebase_path(depfile, root_build_dir), |
| 111 "--exclude", | 102 "--exclude", |
| 112 rebase_path(exclusions_file, root_build_dir), | 103 rebase_path(exclusions_file, root_build_dir), |
| 113 "--auxclasspath-gyp", | 104 "--auxclasspath-gyp", |
| 114 "@FileArg($rebased_build_config:javac:classpath)", | 105 "@FileArg($rebased_build_config:javac:classpath)", |
| 115 "--output-file", | 106 "--output-file", |
| 116 rebase_path(result_path, root_build_dir), | 107 rebase_path(result_path, root_build_dir), |
| 117 rebase_path(jar_path, root_build_dir), | 108 rebase_path(jar_path, root_build_dir), |
| 118 ] | 109 ] |
| 119 } | 110 } |
| 120 } | 111 } |
| 121 | 112 |
| 122 template("dex") { | 113 template("dex") { |
| 123 set_sources_assignment_filter([]) | 114 set_sources_assignment_filter([]) |
| 124 if (defined(invoker.testonly)) { | |
| 125 testonly = invoker.testonly | |
| 126 } | |
| 127 | 115 |
| 128 assert(defined(invoker.output)) | 116 assert(defined(invoker.output)) |
| 129 action(target_name) { | 117 action(target_name) { |
| 118 forward_variables_from(invoker, |
| 119 [ |
| 120 "deps", |
| 121 "inputs", |
| 122 "sources", |
| 123 "testonly", |
| 124 ]) |
| 130 script = "//build/android/gyp/dex.py" | 125 script = "//build/android/gyp/dex.py" |
| 131 depfile = "$target_gen_dir/$target_name.d" | 126 depfile = "$target_gen_dir/$target_name.d" |
| 132 if (defined(invoker.sources)) { | |
| 133 sources = invoker.sources | |
| 134 } | |
| 135 outputs = [ | 127 outputs = [ |
| 136 depfile, | 128 depfile, |
| 137 invoker.output, | 129 invoker.output, |
| 138 ] | 130 ] |
| 139 if (defined(invoker.inputs)) { | |
| 140 inputs = invoker.inputs | |
| 141 } | |
| 142 | |
| 143 if (defined(invoker.deps)) { | |
| 144 deps = invoker.deps | |
| 145 } | |
| 146 | 131 |
| 147 rebased_output = rebase_path(invoker.output, root_build_dir) | 132 rebased_output = rebase_path(invoker.output, root_build_dir) |
| 148 | 133 |
| 149 args = [ | 134 args = [ |
| 150 "--depfile", | 135 "--depfile", |
| 151 rebase_path(depfile, root_build_dir), | 136 rebase_path(depfile, root_build_dir), |
| 152 "--android-sdk-tools", | 137 "--android-sdk-tools", |
| 153 rebased_android_sdk_build_tools, | 138 rebased_android_sdk_build_tools, |
| 154 "--dex-path", | 139 "--dex-path", |
| 155 rebased_output, | 140 rebased_output, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 166 if (defined(invoker.sources)) { | 151 if (defined(invoker.sources)) { |
| 167 args += rebase_path(invoker.sources, root_build_dir) | 152 args += rebase_path(invoker.sources, root_build_dir) |
| 168 } | 153 } |
| 169 } | 154 } |
| 170 } | 155 } |
| 171 | 156 |
| 172 # Creates a zip archive of the inputs. | 157 # Creates a zip archive of the inputs. |
| 173 # If base_dir is provided, the archive paths will be relative to it. | 158 # If base_dir is provided, the archive paths will be relative to it. |
| 174 template("zip") { | 159 template("zip") { |
| 175 set_sources_assignment_filter([]) | 160 set_sources_assignment_filter([]) |
| 176 if (defined(invoker.testonly)) { | |
| 177 testonly = invoker.testonly | |
| 178 } | |
| 179 | |
| 180 assert(defined(invoker.inputs)) | 161 assert(defined(invoker.inputs)) |
| 181 assert(defined(invoker.output)) | 162 assert(defined(invoker.output)) |
| 182 | 163 |
| 183 rebase_inputs = rebase_path(invoker.inputs, root_build_dir) | 164 rebase_inputs = rebase_path(invoker.inputs, root_build_dir) |
| 184 rebase_output = rebase_path(invoker.output, root_build_dir) | 165 rebase_output = rebase_path(invoker.output, root_build_dir) |
| 185 action(target_name) { | 166 action(target_name) { |
| 167 forward_variables_from(invoker, |
| 168 [ |
| 169 "data_deps", |
| 170 "deps", |
| 171 "public_deps", |
| 172 "inputs", |
| 173 "testonly", |
| 174 "visibility", |
| 175 ]) |
| 186 script = "//build/android/gn/zip.py" | 176 script = "//build/android/gn/zip.py" |
| 187 depfile = "$target_gen_dir/$target_name.d" | 177 depfile = "$target_gen_dir/$target_name.d" |
| 188 inputs = invoker.inputs | |
| 189 outputs = [ | 178 outputs = [ |
| 190 depfile, | 179 depfile, |
| 191 invoker.output, | 180 invoker.output, |
| 192 ] | 181 ] |
| 193 args = [ | 182 args = [ |
| 194 "--depfile", | 183 "--depfile", |
| 195 rebase_path(depfile, root_build_dir), | 184 rebase_path(depfile, root_build_dir), |
| 196 "--inputs=$rebase_inputs", | 185 "--inputs=$rebase_inputs", |
| 197 "--output=$rebase_output", | 186 "--output=$rebase_output", |
| 198 ] | 187 ] |
| 199 if (defined(invoker.base_dir)) { | 188 if (defined(invoker.base_dir)) { |
| 200 args += [ | 189 args += [ |
| 201 "--base-dir", | 190 "--base-dir", |
| 202 rebase_path(invoker.base_dir, root_build_dir), | 191 rebase_path(invoker.base_dir, root_build_dir), |
| 203 ] | 192 ] |
| 204 } | 193 } |
| 205 | |
| 206 if (defined(invoker.deps)) { | |
| 207 deps = invoker.deps | |
| 208 } | |
| 209 if (defined(invoker.public_deps)) { | |
| 210 public_deps = invoker.public_deps | |
| 211 } | |
| 212 if (defined(invoker.data_deps)) { | |
| 213 data_deps = invoker.data_deps | |
| 214 } | |
| 215 | |
| 216 if (defined(invoker.visibility)) { | |
| 217 visibility = invoker.visibility | |
| 218 } | |
| 219 } | 194 } |
| 220 } | 195 } |
| 221 | 196 |
| 222 # Write the target's .build_config file. This is a json file that contains a | 197 # Write the target's .build_config file. This is a json file that contains a |
| 223 # dictionary of information about how to build this target (things that | 198 # dictionary of information about how to build this target (things that |
| 224 # require knowledge about this target's dependencies and cannot be calculated | 199 # require knowledge about this target's dependencies and cannot be calculated |
| 225 # at gn-time). There is a special syntax to add a value in that dictionary to | 200 # at gn-time). There is a special syntax to add a value in that dictionary to |
| 226 # an action/action_foreachs args: | 201 # an action/action_foreachs args: |
| 227 # --python-arg=@FileArg($rebased_build_config_path:key0:key1) | 202 # --python-arg=@FileArg($rebased_build_config_path:key0:key1) |
| 228 # At runtime, such an arg will be replaced by the value in the build_config. | 203 # At runtime, such an arg will be replaced by the value in the build_config. |
| 229 # See build/android/gyp/write_build_config.py and | 204 # See build/android/gyp/write_build_config.py and |
| 230 # build/android/gyp/util/build_utils.py:ExpandFileArgs | 205 # build/android/gyp/util/build_utils.py:ExpandFileArgs |
| 231 template("write_build_config") { | 206 template("write_build_config") { |
| 232 set_sources_assignment_filter([]) | 207 set_sources_assignment_filter([]) |
| 233 if (defined(invoker.testonly)) { | |
| 234 testonly = invoker.testonly | |
| 235 } | |
| 236 | 208 |
| 237 assert(defined(invoker.type)) | 209 assert(defined(invoker.type)) |
| 238 assert(defined(invoker.build_config)) | 210 assert(defined(invoker.build_config)) |
| 239 | 211 |
| 240 type = invoker.type | 212 type = invoker.type |
| 241 build_config = invoker.build_config | 213 build_config = invoker.build_config |
| 242 | 214 |
| 243 assert(type == "android_apk" || type == "java_library" || | 215 assert(type == "android_apk" || type == "java_library" || |
| 244 type == "android_resources" || type == "deps_dex") | 216 type == "android_resources" || type == "deps_dex") |
| 245 | 217 |
| 246 action(target_name) { | 218 action(target_name) { |
| 247 if (defined(invoker.visibility)) { | 219 deps = [] |
| 248 visibility = invoker.visibility | 220 forward_variables_from(invoker, |
| 249 } | 221 [ |
| 222 "deps", |
| 223 "testonly", |
| 224 "visibility", |
| 225 ]) |
| 250 | 226 |
| 251 script = "//build/android/gyp/write_build_config.py" | 227 script = "//build/android/gyp/write_build_config.py" |
| 252 depfile = "$target_gen_dir/$target_name.d" | 228 depfile = "$target_gen_dir/$target_name.d" |
| 253 inputs = [] | 229 inputs = [] |
| 254 | 230 |
| 255 deps = [] | |
| 256 if (defined(invoker.deps)) { | |
| 257 deps += invoker.deps | |
| 258 } | |
| 259 | |
| 260 possible_deps_configs = [] | 231 possible_deps_configs = [] |
| 261 foreach(d, deps) { | 232 foreach(d, deps) { |
| 262 dep_gen_dir = get_label_info(d, "target_gen_dir") | 233 dep_gen_dir = get_label_info(d, "target_gen_dir") |
| 263 dep_name = get_label_info(d, "name") | 234 dep_name = get_label_info(d, "name") |
| 264 possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ] | 235 possible_deps_configs += [ "$dep_gen_dir/$dep_name.build_config" ] |
| 265 } | 236 } |
| 266 rebase_possible_deps_configs = | 237 rebase_possible_deps_configs = |
| 267 rebase_path(possible_deps_configs, root_build_dir) | 238 rebase_path(possible_deps_configs, root_build_dir) |
| 268 | 239 |
| 269 outputs = [ | 240 outputs = [ |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 args += [ | 355 args += [ |
| 385 "--srcjar", | 356 "--srcjar", |
| 386 rebase_path(invoker.srcjar, root_build_dir), | 357 rebase_path(invoker.srcjar, root_build_dir), |
| 387 ] | 358 ] |
| 388 } | 359 } |
| 389 } | 360 } |
| 390 } | 361 } |
| 391 | 362 |
| 392 template("process_java_prebuilt") { | 363 template("process_java_prebuilt") { |
| 393 set_sources_assignment_filter([]) | 364 set_sources_assignment_filter([]) |
| 394 if (defined(invoker.testonly)) { | 365 forward_variables_from(invoker, [ "testonly" ]) |
| 395 testonly = invoker.testonly | |
| 396 } | |
| 397 | 366 |
| 398 _input_jar_path = invoker.input_jar_path | 367 _input_jar_path = invoker.input_jar_path |
| 399 _output_jar_path = invoker.output_jar_path | 368 _output_jar_path = invoker.output_jar_path |
| 400 _jar_toc_path = _output_jar_path + ".TOC" | 369 _jar_toc_path = _output_jar_path + ".TOC" |
| 401 | 370 |
| 402 assert(invoker.build_config != "") | 371 assert(invoker.build_config != "") |
| 403 | 372 |
| 404 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { | 373 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { |
| 405 _proguard_jar_path = "$android_sdk_root/tools/proguard/lib/proguard.jar" | 374 _proguard_jar_path = "$android_sdk_root/tools/proguard/lib/proguard.jar" |
| 406 _proguard_config_path = invoker.proguard_config | 375 _proguard_config_path = invoker.proguard_config |
| 407 _build_config = invoker.build_config | 376 _build_config = invoker.build_config |
| 408 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 377 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
| 409 _output_jar_target = "${target_name}__proguard_process" | 378 _output_jar_target = "${target_name}__proguard_process" |
| 410 action(_output_jar_target) { | 379 action(_output_jar_target) { |
| 380 forward_variables_from(invoker, |
| 381 [ |
| 382 "data_deps", |
| 383 "deps", |
| 384 "public_deps", |
| 385 ]) |
| 411 script = "//build/android/gyp/proguard.py" | 386 script = "//build/android/gyp/proguard.py" |
| 412 inputs = [ | 387 inputs = [ |
| 413 android_sdk_jar, | 388 android_sdk_jar, |
| 414 _proguard_jar_path, | 389 _proguard_jar_path, |
| 415 _build_config, | 390 _build_config, |
| 416 _input_jar_path, | 391 _input_jar_path, |
| 417 _proguard_config_path, | 392 _proguard_config_path, |
| 418 ] | 393 ] |
| 419 depfile = "${target_gen_dir}/${target_name}.d" | 394 depfile = "${target_gen_dir}/${target_name}.d" |
| 420 outputs = [ | 395 outputs = [ |
| 421 depfile, | 396 depfile, |
| 422 _output_jar_path, | 397 _output_jar_path, |
| 423 ] | 398 ] |
| 424 args = [ | 399 args = [ |
| 425 "--depfile", | 400 "--depfile", |
| 426 rebase_path(depfile, root_build_dir), | 401 rebase_path(depfile, root_build_dir), |
| 427 "--proguard-path", | 402 "--proguard-path", |
| 428 rebase_path(_proguard_jar_path, root_build_dir), | 403 rebase_path(_proguard_jar_path, root_build_dir), |
| 429 "--input-path", | 404 "--input-path", |
| 430 rebase_path(_input_jar_path, root_build_dir), | 405 rebase_path(_input_jar_path, root_build_dir), |
| 431 "--output-path", | 406 "--output-path", |
| 432 rebase_path(_output_jar_path, root_build_dir), | 407 rebase_path(_output_jar_path, root_build_dir), |
| 433 "--proguard-config", | 408 "--proguard-config", |
| 434 rebase_path(_proguard_config_path, root_build_dir), | 409 rebase_path(_proguard_config_path, root_build_dir), |
| 435 "--classpath", | 410 "--classpath", |
| 436 rebased_android_sdk_jar, | 411 rebased_android_sdk_jar, |
| 437 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", | 412 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", |
| 438 ] | 413 ] |
| 439 | |
| 440 if (defined(invoker.deps)) { | |
| 441 deps = invoker.deps | |
| 442 } | |
| 443 if (defined(invoker.public_deps)) { | |
| 444 public_deps = invoker.public_deps | |
| 445 } | |
| 446 if (defined(invoker.data_deps)) { | |
| 447 data_deps = invoker.data_deps | |
| 448 } | |
| 449 } | 414 } |
| 450 } else { | 415 } else { |
| 451 _output_jar_target = "${target_name}__copy_jar" | 416 _output_jar_target = "${target_name}__copy_jar" |
| 452 copy(_output_jar_target) { | 417 copy(_output_jar_target) { |
| 418 forward_variables_from(invoker, |
| 419 [ |
| 420 "data_deps", |
| 421 "deps", |
| 422 "public_deps", |
| 423 ]) |
| 453 sources = [ | 424 sources = [ |
| 454 _input_jar_path, | 425 _input_jar_path, |
| 455 ] | 426 ] |
| 456 outputs = [ | 427 outputs = [ |
| 457 _output_jar_path, | 428 _output_jar_path, |
| 458 ] | 429 ] |
| 459 | |
| 460 if (defined(invoker.deps)) { | |
| 461 deps = invoker.deps | |
| 462 } | |
| 463 if (defined(invoker.public_deps)) { | |
| 464 public_deps = invoker.public_deps | |
| 465 } | |
| 466 if (defined(invoker.data_deps)) { | |
| 467 data_deps = invoker.data_deps | |
| 468 } | |
| 469 } | 430 } |
| 470 } | 431 } |
| 471 | 432 |
| 472 action("${target_name}__jar_toc") { | 433 action("${target_name}__jar_toc") { |
| 473 script = "//build/android/gyp/jar_toc.py" | 434 script = "//build/android/gyp/jar_toc.py" |
| 474 depfile = "$target_gen_dir/$target_name.d" | 435 depfile = "$target_gen_dir/$target_name.d" |
| 475 outputs = [ | 436 outputs = [ |
| 476 depfile, | 437 depfile, |
| 477 _jar_toc_path, | 438 _jar_toc_path, |
| 478 _jar_toc_path + ".md5.stamp", | 439 _jar_toc_path + ".md5.stamp", |
| 479 ] | 440 ] |
| 480 inputs = [ | 441 inputs = [ |
| 481 _output_jar_path, | 442 _output_jar_path, |
| 482 ] | 443 ] |
| 483 args = [ | 444 args = [ |
| 484 "--depfile", | 445 "--depfile", |
| 485 rebase_path(depfile, root_build_dir), | 446 rebase_path(depfile, root_build_dir), |
| 486 "--jar-path", | 447 "--jar-path", |
| 487 rebase_path(_output_jar_path, root_build_dir), | 448 rebase_path(_output_jar_path, root_build_dir), |
| 488 "--toc-path", | 449 "--toc-path", |
| 489 rebase_path(_jar_toc_path, root_build_dir), | 450 rebase_path(_jar_toc_path, root_build_dir), |
| 490 ] | 451 ] |
| 491 public_deps = [ | 452 public_deps = [ |
| 492 ":$_output_jar_target", | 453 ":$_output_jar_target", |
| 493 ] | 454 ] |
| 494 } | 455 } |
| 495 | 456 |
| 496 group(target_name) { | 457 group(target_name) { |
| 497 if (defined(invoker.visibility)) { | 458 forward_variables_from(invoker, [ "visibility" ]) |
| 498 visibility = invoker.visibility | |
| 499 } | |
| 500 public_deps = [ | 459 public_deps = [ |
| 501 ":${target_name}__jar_toc", | 460 ":${target_name}__jar_toc", |
| 502 ":$_output_jar_target", | 461 ":$_output_jar_target", |
| 503 ] | 462 ] |
| 504 } | 463 } |
| 505 } | 464 } |
| 506 | 465 |
| 507 template("finalize_apk") { | 466 template("finalize_apk") { |
| 508 action(target_name) { | 467 action(target_name) { |
| 468 forward_variables_from(invoker, |
| 469 [ |
| 470 "data_deps", |
| 471 "deps", |
| 472 "public_deps", |
| 473 "testonly", |
| 474 ]) |
| 509 script = "//build/android/gyp/finalize_apk.py" | 475 script = "//build/android/gyp/finalize_apk.py" |
| 510 depfile = "$target_gen_dir/$target_name.d" | 476 depfile = "$target_gen_dir/$target_name.d" |
| 511 | 477 |
| 512 if (defined(invoker.testonly)) { | |
| 513 testonly = invoker.testonly | |
| 514 } | |
| 515 | |
| 516 sources = [ | 478 sources = [ |
| 517 invoker.input_apk_path, | 479 invoker.input_apk_path, |
| 518 ] | 480 ] |
| 519 inputs = [ | 481 inputs = [ |
| 520 invoker.keystore_path, | 482 invoker.keystore_path, |
| 521 ] | 483 ] |
| 522 outputs = [ | 484 outputs = [ |
| 523 depfile, | 485 depfile, |
| 524 invoker.output_apk_path, | 486 invoker.output_apk_path, |
| 525 ] | 487 ] |
| (...skipping 16 matching lines...) Expand all Loading... |
| 542 ] | 504 ] |
| 543 if (defined(invoker.rezip_apk) && invoker.rezip_apk) { | 505 if (defined(invoker.rezip_apk) && invoker.rezip_apk) { |
| 544 _rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar" | 506 _rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar" |
| 545 inputs += [ _rezip_jar_path ] | 507 inputs += [ _rezip_jar_path ] |
| 546 args += [ | 508 args += [ |
| 547 "--load-library-from-zip=1", | 509 "--load-library-from-zip=1", |
| 548 "--rezip-apk-jar-path", | 510 "--rezip-apk-jar-path", |
| 549 rebase_path(_rezip_jar_path, root_build_dir), | 511 rebase_path(_rezip_jar_path, root_build_dir), |
| 550 ] | 512 ] |
| 551 } | 513 } |
| 552 | |
| 553 if (defined(invoker.deps)) { | |
| 554 deps = invoker.deps | |
| 555 } | |
| 556 if (defined(invoker.public_deps)) { | |
| 557 public_deps = invoker.public_deps | |
| 558 } | |
| 559 if (defined(invoker.data_deps)) { | |
| 560 data_deps = invoker.data_deps | |
| 561 } | |
| 562 } | 514 } |
| 563 } | 515 } |
| 564 | 516 |
| 565 # Packages resources, assets, dex, and native libraries into an apk. Signs and | 517 # Packages resources, assets, dex, and native libraries into an apk. Signs and |
| 566 # zipaligns the apk. | 518 # zipaligns the apk. |
| 567 template("create_apk") { | 519 template("create_apk") { |
| 568 set_sources_assignment_filter([]) | 520 set_sources_assignment_filter([]) |
| 569 if (defined(invoker.testonly)) { | 521 forward_variables_from(invoker, [ "testonly" ]) |
| 570 testonly = invoker.testonly | |
| 571 } | |
| 572 | 522 |
| 573 _android_manifest = invoker.android_manifest | 523 _android_manifest = invoker.android_manifest |
| 574 _base_path = invoker.base_path | 524 _base_path = invoker.base_path |
| 575 _final_apk_path = invoker.apk_path | 525 _final_apk_path = invoker.apk_path |
| 576 | 526 |
| 577 if (defined(invoker.resources_zip)) { | 527 if (defined(invoker.resources_zip)) { |
| 578 _resources_zip = invoker.resources_zip | 528 _resources_zip = invoker.resources_zip |
| 579 } | 529 } |
| 580 if (defined(invoker.dex_path)) { | 530 if (defined(invoker.dex_path)) { |
| 581 _dex_path = invoker.dex_path | 531 _dex_path = invoker.dex_path |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 _final_deps += [ ":$_split_rule" ] | 763 _final_deps += [ ":$_split_rule" ] |
| 814 } | 764 } |
| 815 | 765 |
| 816 group(target_name) { | 766 group(target_name) { |
| 817 public_deps = _final_deps | 767 public_deps = _final_deps |
| 818 } | 768 } |
| 819 } | 769 } |
| 820 | 770 |
| 821 template("java_prebuilt_impl") { | 771 template("java_prebuilt_impl") { |
| 822 set_sources_assignment_filter([]) | 772 set_sources_assignment_filter([]) |
| 823 if (defined(invoker.testonly)) { | 773 forward_variables_from(invoker, [ "testonly" ]) |
| 824 testonly = invoker.testonly | |
| 825 } | |
| 826 _supports_android = | 774 _supports_android = |
| 827 defined(invoker.supports_android) && invoker.supports_android | 775 defined(invoker.supports_android) && invoker.supports_android |
| 828 | 776 |
| 829 assert(defined(invoker.jar_path)) | 777 assert(defined(invoker.jar_path)) |
| 830 _base_path = "${target_gen_dir}/$target_name" | 778 _base_path = "${target_gen_dir}/$target_name" |
| 831 _jar_path = _base_path + ".jar" | 779 _jar_path = _base_path + ".jar" |
| 832 _build_config = _base_path + ".build_config" | 780 _build_config = _base_path + ".build_config" |
| 833 | 781 |
| 834 if (_supports_android) { | 782 if (_supports_android) { |
| 835 _dex_path = _base_path + ".dex.jar" | 783 _dex_path = _base_path + ".dex.jar" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 dex(dex_target_name) { | 835 dex(dex_target_name) { |
| 888 sources = [ | 836 sources = [ |
| 889 _jar_path, | 837 _jar_path, |
| 890 ] | 838 ] |
| 891 output = _dex_path | 839 output = _dex_path |
| 892 deps = [ ":$process_jar_target_name" ] + _deps + _jar_deps | 840 deps = [ ":$process_jar_target_name" ] + _deps + _jar_deps |
| 893 } | 841 } |
| 894 } | 842 } |
| 895 | 843 |
| 896 group(target_name) { | 844 group(target_name) { |
| 845 forward_variables_from(invoker, [ "data_deps" ]) |
| 897 deps = [ | 846 deps = [ |
| 898 ":$process_jar_target_name", | 847 ":$process_jar_target_name", |
| 899 ] | 848 ] |
| 900 if (defined(invoker.data_deps)) { | |
| 901 data_deps = invoker.data_deps | |
| 902 } | |
| 903 if (_supports_android) { | 849 if (_supports_android) { |
| 904 deps += [ ":$dex_target_name" ] | 850 deps += [ ":$dex_target_name" ] |
| 905 } | 851 } |
| 906 } | 852 } |
| 907 } | 853 } |
| 908 | 854 |
| 909 # Compiles and jars a set of java files. | 855 # Compiles and jars a set of java files. |
| 910 # | 856 # |
| 911 # Outputs: | 857 # Outputs: |
| 912 # $jar_path.jar | 858 # $jar_path.jar |
| 913 # $jar_path.jar.TOC | 859 # $jar_path.jar.TOC |
| 914 # | 860 # |
| 915 # Variables | 861 # Variables |
| 916 # java_files: List of .java files to compile. | 862 # java_files: List of .java files to compile. |
| 917 # java_deps: List of java dependencies. These should all have a .jar output | 863 # java_deps: List of java dependencies. These should all have a .jar output |
| 918 # at "${target_gen_dir}/${target_name}.jar. | 864 # at "${target_gen_dir}/${target_name}.jar. |
| 919 # chromium_code: If true, enable extra warnings. | 865 # chromium_code: If true, enable extra warnings. |
| 920 # srcjar_deps: List of srcjar dependencies. The .java files contained in the | 866 # srcjar_deps: List of srcjar dependencies. The .java files contained in the |
| 921 # dependencies srcjar outputs will be compiled and added to the output jar. | 867 # dependencies srcjar outputs will be compiled and added to the output jar. |
| 922 # jar_path: Use this to explicitly set the output jar path. Defaults to | 868 # jar_path: Use this to explicitly set the output jar path. Defaults to |
| 923 # "${target_gen_dir}/${target_name}.jar. | 869 # "${target_gen_dir}/${target_name}.jar. |
| 924 template("compile_java") { | 870 template("compile_java") { |
| 925 set_sources_assignment_filter([]) | 871 set_sources_assignment_filter([]) |
| 926 if (defined(invoker.testonly)) { | 872 forward_variables_from(invoker, [ "testonly" ]) |
| 927 testonly = invoker.testonly | |
| 928 } | |
| 929 | 873 |
| 930 assert(defined(invoker.java_files)) | 874 assert(defined(invoker.java_files)) |
| 931 assert(defined(invoker.build_config)) | 875 assert(defined(invoker.build_config)) |
| 932 assert(defined(invoker.jar_path)) | 876 assert(defined(invoker.jar_path)) |
| 933 | 877 |
| 934 _java_files = invoker.java_files | 878 _java_files = invoker.java_files |
| 935 _final_jar_path = invoker.jar_path | 879 _final_jar_path = invoker.jar_path |
| 936 _intermediate_jar_path = "$target_gen_dir/$target_name.initial.jar" | 880 _intermediate_jar_path = "$target_gen_dir/$target_name.initial.jar" |
| 937 | 881 |
| 938 _build_config = invoker.build_config | 882 _build_config = invoker.build_config |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { | 993 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { |
| 1050 proguard_preprocess = invoker.proguard_preprocess | 994 proguard_preprocess = invoker.proguard_preprocess |
| 1051 proguard_config = invoker.proguard_config | 995 proguard_config = invoker.proguard_config |
| 1052 } | 996 } |
| 1053 deps = [ | 997 deps = [ |
| 1054 ":$javac_target_name", | 998 ":$javac_target_name", |
| 1055 ] | 999 ] |
| 1056 } | 1000 } |
| 1057 | 1001 |
| 1058 group(final_target_name) { | 1002 group(final_target_name) { |
| 1059 if (defined(invoker.visibility)) { | 1003 forward_variables_from(invoker, [ "visibility" ]) |
| 1060 visibility = invoker.visibility | |
| 1061 } | |
| 1062 public_deps = [ | 1004 public_deps = [ |
| 1063 ":$finish_target_name", | 1005 ":$finish_target_name", |
| 1064 ] | 1006 ] |
| 1065 } | 1007 } |
| 1066 } | 1008 } |
| 1067 | 1009 |
| 1068 template("java_library_impl") { | 1010 template("java_library_impl") { |
| 1069 set_sources_assignment_filter([]) | 1011 set_sources_assignment_filter([]) |
| 1070 if (defined(invoker.testonly)) { | 1012 forward_variables_from(invoker, [ "testonly" ]) |
| 1071 testonly = invoker.testonly | |
| 1072 } | |
| 1073 | 1013 |
| 1074 assert( | 1014 assert( |
| 1075 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || | 1015 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || |
| 1076 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) | 1016 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) |
| 1077 _base_path = "$target_gen_dir/$target_name" | 1017 _base_path = "$target_gen_dir/$target_name" |
| 1078 _jar_path = _base_path + ".jar" | 1018 _jar_path = _base_path + ".jar" |
| 1079 if (defined(invoker.jar_path)) { | 1019 if (defined(invoker.jar_path)) { |
| 1080 _jar_path = invoker.jar_path | 1020 _jar_path = invoker.jar_path |
| 1081 } | 1021 } |
| 1082 _template_name = target_name | 1022 _template_name = target_name |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1110 "If you specify a build config file for " + | 1050 "If you specify a build config file for " + |
| 1111 "java_library_impl($target_name), you should " + | 1051 "java_library_impl($target_name), you should " + |
| 1112 "also specify the target that made it in the deps") | 1052 "also specify the target that made it in the deps") |
| 1113 build_config_deps = invoker.deps | 1053 build_config_deps = invoker.deps |
| 1114 } else { | 1054 } else { |
| 1115 _build_config = _base_path + ".build_config" | 1055 _build_config = _base_path + ".build_config" |
| 1116 build_config_target_name = "${_template_name}__build_config" | 1056 build_config_target_name = "${_template_name}__build_config" |
| 1117 build_config_deps = [ ":$build_config_target_name" ] | 1057 build_config_deps = [ ":$build_config_target_name" ] |
| 1118 | 1058 |
| 1119 write_build_config(build_config_target_name) { | 1059 write_build_config(build_config_target_name) { |
| 1060 forward_variables_from(invoker, [ "deps" ]) |
| 1120 type = "java_library" | 1061 type = "java_library" |
| 1121 supports_android = _supports_android | 1062 supports_android = _supports_android |
| 1122 requires_android = _requires_android | 1063 requires_android = _requires_android |
| 1123 bypass_platform_checks = defined(invoker.bypass_platform_checks) && | 1064 bypass_platform_checks = defined(invoker.bypass_platform_checks) && |
| 1124 invoker.bypass_platform_checks | 1065 invoker.bypass_platform_checks |
| 1125 | 1066 |
| 1126 deps = [] | |
| 1127 if (defined(invoker.deps)) { | |
| 1128 deps += invoker.deps | |
| 1129 } | |
| 1130 | |
| 1131 build_config = _build_config | 1067 build_config = _build_config |
| 1132 jar_path = _jar_path | 1068 jar_path = _jar_path |
| 1133 if (_supports_android) { | 1069 if (_supports_android) { |
| 1134 dex_path = _dex_path | 1070 dex_path = _dex_path |
| 1135 } | 1071 } |
| 1136 } | 1072 } |
| 1137 } | 1073 } |
| 1138 | 1074 |
| 1139 _chromium_code = true | 1075 _chromium_code = true |
| 1140 if (defined(invoker.chromium_code)) { | 1076 if (defined(invoker.chromium_code)) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1171 rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir), | 1107 rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir), |
| 1172 ], | 1108 ], |
| 1173 "list lines") | 1109 "list lines") |
| 1174 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) | 1110 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) |
| 1175 } | 1111 } |
| 1176 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) | 1112 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) |
| 1177 | 1113 |
| 1178 _compile_java_target = "${_template_name}__compile_java" | 1114 _compile_java_target = "${_template_name}__compile_java" |
| 1179 _final_deps += [ ":$_compile_java_target" ] | 1115 _final_deps += [ ":$_compile_java_target" ] |
| 1180 compile_java(_compile_java_target) { | 1116 compile_java(_compile_java_target) { |
| 1117 forward_variables_from(invoker, |
| 1118 [ |
| 1119 "dist_jar_path", |
| 1120 "enable_errorprone", |
| 1121 "jar_excluded_patterns", |
| 1122 "manifest_entries", |
| 1123 "proguard_config", |
| 1124 "proguard_preprocess", |
| 1125 ]) |
| 1181 jar_path = _jar_path | 1126 jar_path = _jar_path |
| 1182 build_config = _build_config | 1127 build_config = _build_config |
| 1183 java_files = _java_files | 1128 java_files = _java_files |
| 1184 srcjar_deps = _srcjar_deps | 1129 srcjar_deps = _srcjar_deps |
| 1185 srcjars = _srcjars | 1130 srcjars = _srcjars |
| 1186 chromium_code = _chromium_code | 1131 chromium_code = _chromium_code |
| 1187 android = _requires_android | 1132 android = _requires_android |
| 1188 | 1133 |
| 1189 if (defined(invoker.enable_errorprone)) { | |
| 1190 enable_errorprone = invoker.enable_errorprone | |
| 1191 } | |
| 1192 if (defined(invoker.jar_excluded_patterns)) { | |
| 1193 jar_excluded_patterns = invoker.jar_excluded_patterns | |
| 1194 } | |
| 1195 if (defined(invoker.proguard_preprocess)) { | |
| 1196 proguard_preprocess = invoker.proguard_preprocess | |
| 1197 } | |
| 1198 if (defined(invoker.proguard_config)) { | |
| 1199 proguard_config = invoker.proguard_config | |
| 1200 } | |
| 1201 if (defined(invoker.dist_jar_path)) { | |
| 1202 dist_jar_path = invoker.dist_jar_path | |
| 1203 } | |
| 1204 if (defined(invoker.manifest_entries)) { | |
| 1205 manifest_entries = invoker.manifest_entries | |
| 1206 } | |
| 1207 | |
| 1208 supports_android = _supports_android | 1134 supports_android = _supports_android |
| 1209 deps = build_config_deps | 1135 deps = build_config_deps |
| 1210 } | 1136 } |
| 1211 | 1137 |
| 1212 if (defined(invoker.main_class)) { | 1138 if (defined(invoker.main_class)) { |
| 1213 _final_deps += [ ":${_template_name}__binary_script" ] | 1139 _final_deps += [ ":${_template_name}__binary_script" ] |
| 1214 action("${_template_name}__binary_script") { | 1140 action("${_template_name}__binary_script") { |
| 1215 script = "//build/android/gyp/create_java_binary_script.py" | 1141 script = "//build/android/gyp/create_java_binary_script.py" |
| 1216 depfile = "$target_gen_dir/$target_name.d" | 1142 depfile = "$target_gen_dir/$target_name.d" |
| 1217 java_script = "$root_build_dir/bin/$_template_name" | 1143 java_script = "$root_build_dir/bin/$_template_name" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 _jar_path, | 1201 _jar_path, |
| 1276 ] | 1202 ] |
| 1277 output = _dex_path | 1203 output = _dex_path |
| 1278 deps = [ | 1204 deps = [ |
| 1279 ":$_compile_java_target", | 1205 ":$_compile_java_target", |
| 1280 ] | 1206 ] |
| 1281 } | 1207 } |
| 1282 } | 1208 } |
| 1283 | 1209 |
| 1284 group(target_name) { | 1210 group(target_name) { |
| 1285 if (defined(invoker.visibility)) { | 1211 forward_variables_from(invoker, [ "visibility" ]) |
| 1286 visibility = invoker.visibility | |
| 1287 } | |
| 1288 public_deps = _final_deps | 1212 public_deps = _final_deps |
| 1289 data_deps = _final_datadeps | 1213 data_deps = _final_datadeps |
| 1290 } | 1214 } |
| 1291 } | 1215 } |
| 1292 | 1216 |
| 1293 # Runs process_resources.py | 1217 # Runs process_resources.py |
| 1294 template("process_resources") { | 1218 template("process_resources") { |
| 1295 set_sources_assignment_filter([]) | 1219 set_sources_assignment_filter([]) |
| 1296 if (defined(invoker.testonly)) { | 1220 forward_variables_from(invoker, [ "testonly" ]) |
| 1297 testonly = invoker.testonly | |
| 1298 } | |
| 1299 | 1221 |
| 1300 zip_path = invoker.zip_path | 1222 zip_path = invoker.zip_path |
| 1301 srcjar_path = invoker.srcjar_path | 1223 srcjar_path = invoker.srcjar_path |
| 1302 r_text_path = invoker.r_text_path | 1224 r_text_path = invoker.r_text_path |
| 1303 build_config = invoker.build_config | 1225 build_config = invoker.build_config |
| 1304 resource_dirs = invoker.resource_dirs | 1226 resource_dirs = invoker.resource_dirs |
| 1305 android_manifest = invoker.android_manifest | 1227 android_manifest = invoker.android_manifest |
| 1306 | 1228 |
| 1307 non_constant_id = true | 1229 non_constant_id = true |
| 1308 if (defined(invoker.generate_constant_ids) && invoker.generate_constant_ids) { | 1230 if (defined(invoker.generate_constant_ids) && invoker.generate_constant_ids) { |
| 1309 non_constant_id = false | 1231 non_constant_id = false |
| 1310 } | 1232 } |
| 1311 | 1233 |
| 1312 action(target_name) { | 1234 action(target_name) { |
| 1313 if (defined(invoker.visibility)) { | 1235 forward_variables_from(invoker, |
| 1314 visibility = invoker.visibility | 1236 [ |
| 1315 } | 1237 "deps", |
| 1316 | 1238 "visibility", |
| 1239 ]) |
| 1317 script = "//build/android/gyp/process_resources.py" | 1240 script = "//build/android/gyp/process_resources.py" |
| 1318 | 1241 |
| 1319 depfile = "$target_gen_dir/$target_name.d" | 1242 depfile = "$target_gen_dir/$target_name.d" |
| 1320 outputs = [ | 1243 outputs = [ |
| 1321 depfile, | 1244 depfile, |
| 1322 zip_path, | 1245 zip_path, |
| 1323 srcjar_path, | 1246 srcjar_path, |
| 1324 r_text_path, | 1247 r_text_path, |
| 1325 ] | 1248 ] |
| 1326 | 1249 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 outputs += [ all_resources_zip ] | 1309 outputs += [ all_resources_zip ] |
| 1387 args += [ | 1310 args += [ |
| 1388 "--all-resources-zip-out", | 1311 "--all-resources-zip-out", |
| 1389 rebase_path(all_resources_zip, root_build_dir), | 1312 rebase_path(all_resources_zip, root_build_dir), |
| 1390 ] | 1313 ] |
| 1391 } | 1314 } |
| 1392 | 1315 |
| 1393 if (defined(invoker.args)) { | 1316 if (defined(invoker.args)) { |
| 1394 args += invoker.args | 1317 args += invoker.args |
| 1395 } | 1318 } |
| 1396 if (defined(invoker.deps)) { | |
| 1397 deps = invoker.deps | |
| 1398 } | |
| 1399 } | 1319 } |
| 1400 } | 1320 } |
| 1401 | 1321 |
| 1402 template("copy_ex") { | 1322 template("copy_ex") { |
| 1403 set_sources_assignment_filter([]) | 1323 set_sources_assignment_filter([]) |
| 1404 if (defined(invoker.testonly)) { | |
| 1405 testonly = invoker.testonly | |
| 1406 } | |
| 1407 | |
| 1408 action(target_name) { | 1324 action(target_name) { |
| 1409 if (defined(invoker.visibility)) { | 1325 inputs = [] |
| 1410 visibility = invoker.visibility | 1326 sources = [] |
| 1411 } | 1327 forward_variables_from(invoker, |
| 1412 | 1328 [ |
| 1329 "deps", |
| 1330 "inputs", |
| 1331 "sources", |
| 1332 "testonly", |
| 1333 "visibility", |
| 1334 ]) |
| 1413 script = "//build/android/gyp/copy_ex.py" | 1335 script = "//build/android/gyp/copy_ex.py" |
| 1414 | 1336 |
| 1415 if (defined(invoker.deps)) { | |
| 1416 deps = invoker.deps | |
| 1417 } | |
| 1418 | |
| 1419 sources = [] | |
| 1420 if (defined(invoker.sources)) { | |
| 1421 sources += invoker.sources | |
| 1422 } | |
| 1423 | |
| 1424 inputs = [] | |
| 1425 if (defined(invoker.inputs)) { | |
| 1426 inputs += invoker.inputs | |
| 1427 } | |
| 1428 | |
| 1429 depfile = "$target_gen_dir/$target_name.d" | 1337 depfile = "$target_gen_dir/$target_name.d" |
| 1430 outputs = [ | 1338 outputs = [ |
| 1431 depfile, | 1339 depfile, |
| 1432 ] | 1340 ] |
| 1433 | 1341 |
| 1434 args = [ | 1342 args = [ |
| 1435 "--depfile", | 1343 "--depfile", |
| 1436 rebase_path(depfile, root_build_dir), | 1344 rebase_path(depfile, root_build_dir), |
| 1437 "--dest", | 1345 "--dest", |
| 1438 rebase_path(invoker.dest, root_build_dir), | 1346 rebase_path(invoker.dest, root_build_dir), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1450 } | 1358 } |
| 1451 } | 1359 } |
| 1452 | 1360 |
| 1453 # Produces a single .dex.jar out of a set of Java dependencies. | 1361 # Produces a single .dex.jar out of a set of Java dependencies. |
| 1454 template("deps_dex") { | 1362 template("deps_dex") { |
| 1455 set_sources_assignment_filter([]) | 1363 set_sources_assignment_filter([]) |
| 1456 build_config = "$target_gen_dir/${target_name}.build_config" | 1364 build_config = "$target_gen_dir/${target_name}.build_config" |
| 1457 build_config_target_name = "${target_name}__build_config" | 1365 build_config_target_name = "${target_name}__build_config" |
| 1458 | 1366 |
| 1459 write_build_config(build_config_target_name) { | 1367 write_build_config(build_config_target_name) { |
| 1368 forward_variables_from(invoker, |
| 1369 [ |
| 1370 "deps", |
| 1371 "dex_path", |
| 1372 ]) |
| 1460 type = "deps_dex" | 1373 type = "deps_dex" |
| 1461 deps = invoker.deps | |
| 1462 | |
| 1463 build_config = build_config | 1374 build_config = build_config |
| 1464 dex_path = invoker.dex_path | |
| 1465 } | 1375 } |
| 1466 | 1376 |
| 1467 rebased_build_config = rebase_path(build_config, root_build_dir) | 1377 rebased_build_config = rebase_path(build_config, root_build_dir) |
| 1468 dex(target_name) { | 1378 dex(target_name) { |
| 1469 inputs = [ | 1379 inputs = [ |
| 1470 build_config, | 1380 build_config, |
| 1471 ] | 1381 ] |
| 1472 output = invoker.dex_path | 1382 output = invoker.dex_path |
| 1473 dex_arg_key = "${rebased_build_config}:final_dex:dependency_dex_files" | 1383 dex_arg_key = "${rebased_build_config}:final_dex:dependency_dex_files" |
| 1474 args = [ "--inputs=@FileArg($dex_arg_key)" ] | 1384 args = [ "--inputs=@FileArg($dex_arg_key)" ] |
| 1475 if (defined(invoker.excluded_jars)) { | 1385 if (defined(invoker.excluded_jars)) { |
| 1476 excluded_jars = rebase_path(invoker.excluded_jars, root_build_dir) | 1386 excluded_jars = rebase_path(invoker.excluded_jars, root_build_dir) |
| 1477 args += [ "--excluded-paths=${excluded_jars}" ] | 1387 args += [ "--excluded-paths=${excluded_jars}" ] |
| 1478 } | 1388 } |
| 1479 deps = [ | 1389 deps = [ |
| 1480 ":$build_config_target_name", | 1390 ":$build_config_target_name", |
| 1481 ] | 1391 ] |
| 1482 } | 1392 } |
| 1483 } | 1393 } |
| 1484 | 1394 |
| 1485 # Creates an AndroidManifest.xml for an APK split. | 1395 # Creates an AndroidManifest.xml for an APK split. |
| 1486 template("generate_split_manifest") { | 1396 template("generate_split_manifest") { |
| 1487 assert(defined(invoker.main_manifest)) | 1397 assert(defined(invoker.main_manifest)) |
| 1488 assert(defined(invoker.out_manifest)) | 1398 assert(defined(invoker.out_manifest)) |
| 1489 assert(defined(invoker.split_name)) | 1399 assert(defined(invoker.split_name)) |
| 1490 | 1400 |
| 1491 action(target_name) { | 1401 action(target_name) { |
| 1402 forward_variables_from(invoker, |
| 1403 [ |
| 1404 "deps", |
| 1405 "testonly", |
| 1406 ]) |
| 1492 depfile = "$target_gen_dir/$target_name.d" | 1407 depfile = "$target_gen_dir/$target_name.d" |
| 1493 if (defined(invoker.deps)) { | |
| 1494 deps = invoker.deps | |
| 1495 } | |
| 1496 args = [ | 1408 args = [ |
| 1497 "--main-manifest", | 1409 "--main-manifest", |
| 1498 rebase_path(invoker.main_manifest, root_build_dir), | 1410 rebase_path(invoker.main_manifest, root_build_dir), |
| 1499 "--out-manifest", | 1411 "--out-manifest", |
| 1500 rebase_path(invoker.out_manifest, root_build_dir), | 1412 rebase_path(invoker.out_manifest, root_build_dir), |
| 1501 "--split", | 1413 "--split", |
| 1502 invoker.split_name, | 1414 invoker.split_name, |
| 1503 ] | 1415 ] |
| 1504 if (defined(invoker.version_code)) { | 1416 if (defined(invoker.version_code)) { |
| 1505 args += [ | 1417 args += [ |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 ] | 1493 ] |
| 1582 args = [ | 1494 args = [ |
| 1583 "--depfile", | 1495 "--depfile", |
| 1584 rebase_path(depfile, root_build_dir), | 1496 rebase_path(depfile, root_build_dir), |
| 1585 "--script-output-path", | 1497 "--script-output-path", |
| 1586 rebase_path(generated_script, root_build_dir), | 1498 rebase_path(generated_script, root_build_dir), |
| 1587 ] | 1499 ] |
| 1588 args += test_runner_args | 1500 args += test_runner_args |
| 1589 } | 1501 } |
| 1590 } | 1502 } |
| OLD | NEW |