Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: build/config/android/internal_rules.gni

Issue 2492123002: [android] Stop using isolate.py for data dependency management. (Closed)
Patch Set: add runtime_deps to data Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 # Do not add any imports to non-//build directories here. 5 # Do not add any imports to non-//build directories here.
6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in.
7 import("//build_overrides/build.gni") 7 import("//build_overrides/build.gni")
8 import("//build/config/android/config.gni") 8 import("//build/config/android/config.gni")
9 import("//build/config/sanitizers/sanitizers.gni") 9 import("//build/config/sanitizers/sanitizers.gni")
10 10
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 rebased_renaming_sources = 402 rebased_renaming_sources =
403 rebase_path(invoker.renaming_sources, root_build_dir) 403 rebase_path(invoker.renaming_sources, root_build_dir)
404 args += [ "--renaming-sources=$rebased_renaming_sources" ] 404 args += [ "--renaming-sources=$rebased_renaming_sources" ]
405 405
406 renaming_destinations = invoker.renaming_destinations 406 renaming_destinations = invoker.renaming_destinations
407 args += [ "--renaming-destinations=$renaming_destinations" ] 407 args += [ "--renaming-destinations=$renaming_destinations" ]
408 } 408 }
409 } 409 }
410 } 410 }
411 411
412 template("device_isolate") {
413 testonly = true
414 _runtime_deps_file = "$target_gen_dir/$target_name.runtime_deps"
415 group("${target_name}__write_deps") {
416 forward_variables_from(invoker,
417 [
418 "data",
419 "data_deps",
420 "deps",
421 "public_deps",
422 ])
423 write_runtime_deps = _runtime_deps_file
424 }
425
426 action(target_name) {
427 script = "//build/android/gn/generate_isolate.py"
428 inputs = [
429 _runtime_deps_file,
430 ]
431 outputs = [
432 invoker.output,
433 ]
434 args = [
435 "--output-directory=.",
436 "--out-file",
437 rebase_path(invoker.output, root_build_dir),
438 "--runtime-deps-file",
439 rebase_path(_runtime_deps_file, root_build_dir),
440 "--apply-android-filters",
441 "--apply-device-filters",
442 ]
443 _assert_no_odd_data =
444 defined(invoker.assert_no_odd_data) && invoker.assert_no_odd_data
445 if (_assert_no_odd_data) {
446 args += [ "--assert-no-odd-data" ]
447 }
448 if (defined(invoker.command)) {
449 _isolate_dir = get_path_info(invoker.output, "dir")
450 args += [
451 "--command",
452 rebase_path(invoker.command, _isolate_dir),
453 ]
454 }
455 deps = [
456 ":${invoker.target_name}__write_deps",
457 ]
458 }
459 }
460
461 # Generates a script in the output bin directory which runs the test 412 # Generates a script in the output bin directory which runs the test
462 # target using the test runner script in build/android/test_runner.py. 413 # target using the test runner script in build/android/test_runner.py.
463 template("test_runner_script") { 414 template("test_runner_script") {
464 testonly = true 415 testonly = true
465 _test_name = invoker.test_name 416 _test_name = invoker.test_name
466 _test_type = invoker.test_type 417 _test_type = invoker.test_type
467 _incremental_install = 418 _incremental_install =
468 defined(invoker.incremental_install) && invoker.incremental_install 419 defined(invoker.incremental_install) && invoker.incremental_install
469 420
421 _runtime_deps =
422 !defined(invoker.ignore_all_data_deps) || !invoker.ignore_all_data_deps
423
424 if (_runtime_deps) {
425 _runtime_deps_file = "$target_gen_dir/$target_name.runtime_deps"
426 _runtime_deps_target = "${target_name}__write_deps"
427 group(_runtime_deps_target) {
428 forward_variables_from(invoker,
429 [
430 "data",
431 "data_deps",
432 "deps",
433 "public_deps",
434 ])
435 write_runtime_deps = _runtime_deps_file
436 }
437 }
438
470 action(target_name) { 439 action(target_name) {
471 forward_variables_from(invoker, 440 forward_variables_from(invoker,
472 [ 441 [
473 "data_deps", 442 "data_deps",
474 "deps", 443 "deps",
475 ]) 444 ])
476 if (!defined(deps)) { 445 if (!defined(deps)) {
477 deps = [] 446 deps = []
478 } 447 }
479 if (!defined(data_deps)) { 448 if (!defined(data_deps)) {
480 data_deps = [] 449 data_deps = []
481 } 450 }
482 451
483 script = "//build/android/gyp/create_test_runner_script.py" 452 script = "//build/android/gyp/create_test_runner_script.py"
484 depfile = "$target_gen_dir/$target_name.d" 453 depfile = "$target_gen_dir/$target_name.d"
485 454
486 data_deps += [ "//build/android:test_runner_py" ] 455 data_deps += [ "//build/android:test_runner_py" ]
487 data = [] 456 data = []
488 457
489 test_runner_args = [ 458 test_runner_args = [
490 _test_type, 459 _test_type,
491 "--output-directory", 460 "--output-directory",
492 rebase_path(root_build_dir, root_build_dir), 461 rebase_path(root_build_dir, root_build_dir),
493 ] 462 ]
494 463
464 if (_runtime_deps) {
465 deps += [ ":$_runtime_deps_target" ]
466 data += [ _runtime_deps_file ]
467 test_runner_args += [
468 "--runtime-deps-path",
469 rebase_path(_runtime_deps_file, root_build_dir),
470 ]
471 }
472
495 # apk_target is not used for native executable tests 473 # apk_target is not used for native executable tests
496 # (e.g. breakpad_unittests). 474 # (e.g. breakpad_unittests).
497 if (defined(invoker.apk_target)) { 475 if (defined(invoker.apk_target)) {
498 assert(!defined(invoker.executable_dist_dir)) 476 assert(!defined(invoker.executable_dist_dir))
499 deps += [ "${invoker.apk_target}__build_config" ] 477 deps += [ "${invoker.apk_target}__build_config" ]
500 _apk_build_config = 478 _apk_build_config =
501 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + 479 get_label_info(invoker.apk_target, "target_gen_dir") + "/" +
502 get_label_info(invoker.apk_target, "name") + ".build_config" 480 get_label_info(invoker.apk_target, "name") + ".build_config"
503 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) 481 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir)
504 assert(_rebased_apk_build_config != "") # Mark as used. 482 assert(_rebased_apk_build_config != "") # Mark as used.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 deps += [ "${additional_apk}__build_config" ] 539 deps += [ "${additional_apk}__build_config" ]
562 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + 540 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" +
563 get_label_info(additional_apk, "name") + ".build_config" 541 get_label_info(additional_apk, "name") + ".build_config"
564 _rebased_build_config = rebase_path(_build_config, root_build_dir) 542 _rebased_build_config = rebase_path(_build_config, root_build_dir)
565 test_runner_args += [ 543 test_runner_args += [
566 "--additional-apk", 544 "--additional-apk",
567 "@FileArg($_rebased_build_config:deps_info:apk_path)", 545 "@FileArg($_rebased_build_config:deps_info:apk_path)",
568 ] 546 ]
569 } 547 }
570 } 548 }
571 if (defined(invoker.isolate_file)) {
572 data += [ invoker.isolate_file ]
573 test_runner_args += [
574 "--isolate-file-path",
575 rebase_path(invoker.isolate_file, root_build_dir),
576 ]
577 }
578 if (defined(invoker.shard_timeout)) { 549 if (defined(invoker.shard_timeout)) {
579 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] 550 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ]
580 } 551 }
581 if (_incremental_install) { 552 if (_incremental_install) {
582 test_runner_args += [ 553 test_runner_args += [
583 "--test-apk-incremental-install-script", 554 "--test-apk-incremental-install-script",
584 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip t_path)", 555 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip t_path)",
585 ] 556 ]
586 if (defined(invoker.apk_under_test)) { 557 if (defined(invoker.apk_under_test)) {
587 test_runner_args += [ 558 test_runner_args += [
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2696 rebase_path(root_build_dir, root_build_dir), 2667 rebase_path(root_build_dir, root_build_dir),
2697 "--packed-libraries-dir", 2668 "--packed-libraries-dir",
2698 rebase_path(_packed_libraries_dir, root_build_dir), 2669 rebase_path(_packed_libraries_dir, root_build_dir),
2699 "--libraries=${invoker.libraries_filearg}", 2670 "--libraries=${invoker.libraries_filearg}",
2700 "--filelistjson", 2671 "--filelistjson",
2701 rebase_path(invoker.file_list_json, root_build_dir), 2672 rebase_path(invoker.file_list_json, root_build_dir),
2702 ] 2673 ]
2703 } 2674 }
2704 } 2675 }
2705 } 2676 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698