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

Side by Side Diff: third_party/robolectric/BUILD.gn

Issue 2200413004: Pass template files explicitly to Robolectric template processor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jbudoricks commnets Created 4 years, 4 months 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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/rules.gni") 5 import("//build/config/android/rules.gni")
6 6
7 java_prebuilt("tagsoup-1.2") { 7 java_prebuilt("tagsoup-1.2") {
8 testonly = true 8 testonly = true
9 jar_path = "lib/tagsoup-1.2.jar" 9 jar_path = "lib/tagsoup-1.2.jar"
10 } 10 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/sh adows/util/package-info.java", 524 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/sh adows/util/package-info.java",
525 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/ut il/concurrent/RoboExecutorService.java", 525 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/ut il/concurrent/RoboExecutorService.java",
526 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/ut il/concurrent/package-info.java", 526 "robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/ut il/concurrent/package-info.java",
527 ] 527 ]
528 528
529 java_binary("robolectric_template_processor") { 529 java_binary("robolectric_template_processor") {
530 testonly = true 530 testonly = true
531 java_files = [ 531 java_files = [
532 "template_processor/src/org/chromium/testing/robolectric/template/ProcessRob olectricTemplate.java", 532 "template_processor/src/org/chromium/testing/robolectric/template/ProcessRob olectricTemplate.java",
533 "template_processor/src/org/chromium/testing/robolectric/template/ProcessTem plateArgParser.java", 533 "template_processor/src/org/chromium/testing/robolectric/template/ProcessTem plateArgParser.java",
534 "template_processor/src/org/chromium/testing/robolectric/template/TemplateFi leInfo.java",
534 ] 535 ]
535 main_class = 536 main_class =
536 "org.chromium.testing.robolectric.template.ProcessRobolectricTemplate" 537 "org.chromium.testing.robolectric.template.ProcessRobolectricTemplate"
537 deps = [ 538 deps = [
538 "//third_party/apache_velocity:apache_velocity_java", 539 "//third_party/apache_velocity:apache_velocity_java",
539 ] 540 ]
540 } 541 }
541 542
542 template("shadows_core") { 543 template("shadows_core") {
543 forward_variables_from(invoker, 544 forward_variables_from(invoker,
544 [ 545 [
545 "api_level", 546 "api_level",
546 "android_sdk_deps", 547 "android_sdk_deps",
547 ]) 548 ])
548 testonly = true 549 testonly = true
549 550
550 _shadows_core_java_files = invoker.shadows_core_java_files 551 _shadows_core_java_files = invoker.shadows_core_java_files
551 _template_files = invoker.template_files 552 _template_files = invoker.template_files
552 _process_templates_target_name = "${target_name}__process_templates" 553 _process_templates_target_name = "${target_name}__process_templates"
553 554
554 _processed_template_files = [] 555 _processed_template_files = []
555 foreach(t, _template_files) { 556 _template_file_args = []
556 _gen_dir = get_path_info(t, "gen_dir") 557 foreach(template_file, _template_files) {
557 _name = get_path_info(t, "name") 558 _gen_dir = get_path_info(template_file, "gen_dir")
558 _processed_template_files += [ "$_gen_dir/$api_level/$_name" ] 559 _name = get_path_info(template_file, "name")
560 _output_file = "$_gen_dir/$api_level/$_name"
561 _template_file_args += [
562 "--process-file",
563 "$template_file",
564 rebase_path(_output_file, root_build_dir),
565 ]
566 _processed_template_files += [ _output_file ]
559 } 567 }
560 568
561 action(_process_templates_target_name) { 569 action(_process_templates_target_name) {
562 _base_template_dir = rebase_path(".", root_build_dir) 570 _base_template_dir = rebase_path(".", root_build_dir)
563 _base_template_output_dir = rebase_path(target_gen_dir, root_build_dir)
564 script = "$root_build_dir/bin/robolectric_template_processor" 571 script = "$root_build_dir/bin/robolectric_template_processor"
565 args = [ 572 args = [
566 "--api-level", 573 "--api-level",
567 "$api_level", 574 "$api_level",
568 "--base-template-dir", 575 "--base-template-dir",
569 _base_template_dir, 576 _base_template_dir,
570 "--output-dir",
571 _base_template_output_dir,
572 ] 577 ]
578 args += _template_file_args
579
573 inputs = _template_files 580 inputs = _template_files
574 outputs = _processed_template_files 581 outputs = _processed_template_files
575 582
576 deps = [ 583 deps = [
577 ":robolectric_template_processor", 584 ":robolectric_template_processor",
578 ] 585 ]
579 } 586 }
580 587
581 java_library(target_name) { 588 java_library(target_name) {
582 testonly = true 589 testonly = true
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 deps = [ 658 deps = [
652 ":android-all-5.0.0_r2-robolectric-1", 659 ":android-all-5.0.0_r2-robolectric-1",
653 ":robolectric_annotations_java", 660 ":robolectric_annotations_java",
654 ":robolectric_processor_java", 661 ":robolectric_processor_java",
655 ":robolectric_utils_java", 662 ":robolectric_utils_java",
656 "//build/android:sun_tools_java", 663 "//build/android:sun_tools_java",
657 "//third_party/android_tools:android_support_multidex_java", 664 "//third_party/android_tools:android_support_multidex_java",
658 "//third_party/guava:guava_java", 665 "//third_party/guava:guava_java",
659 ] 666 ]
660 } 667 }
OLDNEW
« no previous file with comments | « no previous file | third_party/robolectric/template_processor/src/org/chromium/testing/robolectric/template/ProcessRobolectricTemplate.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698