OLD | NEW |
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_group("robolectric_all_java") { | 7 java_group("robolectric_all_java") { |
8 testonly = true | 8 testonly = true |
9 deps = [ | 9 deps = [ |
10 ":android-all-5.0.0_r2-robolectric-1", | 10 ":android-all-5.0.0_r2-robolectric-1_java", |
11 ":robolectric_annotations_java", | 11 ":robolectric_annotations_java", |
12 ":robolectric_java", | 12 ":robolectric_java", |
13 ":robolectric_resources_java", | 13 ":robolectric_resources_java", |
14 ":robolectric_utils_java", | 14 ":robolectric_utils_java", |
15 ":shadows-core-3.0-21", | 15 ":shadows-core-3.0-21_java", |
16 ":shadows-multidex-3.0", | 16 ":shadows-multidex-3.0_java", |
17 ] | 17 ] |
18 } | 18 } |
19 | 19 |
20 java_prebuilt("tagsoup-1.2") { | 20 java_prebuilt("tagsoup-1.2_java") { |
21 testonly = true | 21 testonly = true |
22 jar_path = "lib/tagsoup-1.2.jar" | 22 jar_path = "lib/tagsoup-1.2.jar" |
23 } | 23 } |
24 | 24 |
25 java_prebuilt("json-20080701") { | 25 java_prebuilt("json-20080701_java") { |
26 testonly = true | 26 testonly = true |
27 jar_path = "lib/json-20080701.jar" | 27 jar_path = "lib/json-20080701.jar" |
28 } | 28 } |
29 | 29 |
30 java_prebuilt("android-all-4.3_r2-robolectric-0") { | 30 java_prebuilt("android-all-4.3_r2-robolectric-0_java") { |
31 testonly = true | 31 testonly = true |
32 jar_path = "lib/android-all-4.3_r2-robolectric-0.jar" | 32 jar_path = "lib/android-all-4.3_r2-robolectric-0.jar" |
33 } | 33 } |
34 | 34 |
35 java_prebuilt("android-all-5.0.0_r2-robolectric-1") { | 35 java_prebuilt("android-all-5.0.0_r2-robolectric-1_java") { |
36 testonly = true | 36 testonly = true |
37 jar_path = "lib/android-all-5.0.0_r2-robolectric-1.jar" | 37 jar_path = "lib/android-all-5.0.0_r2-robolectric-1.jar" |
38 } | 38 } |
39 | 39 |
40 java_library("robolectric_java") { | 40 java_library("robolectric_java") { |
41 testonly = true | 41 testonly = true |
42 deps = [ | 42 deps = [ |
43 ":android-all-5.0.0_r2-robolectric-1", | 43 ":android-all-5.0.0_r2-robolectric-1_java", |
44 ":json-20080701", | 44 ":json-20080701_java", |
45 ":robolectric_annotations_java", | 45 ":robolectric_annotations_java", |
46 ":robolectric_resources_java", | 46 ":robolectric_resources_java", |
47 ":robolectric_utils_java", | 47 ":robolectric_utils_java", |
48 ":shadows-core-3.0-18", | 48 ":shadows-core-3.0-18_java", |
49 ":shadows-core-3.0-21", | 49 ":shadows-core-3.0-21_java", |
50 ":shadows-multidex-3.0", | 50 ":shadows-multidex-3.0_java", |
51 ":tagsoup-1.2", | 51 ":tagsoup-1.2_java", |
52 "//third_party/bouncycastle:bouncycastle_java", | 52 "//third_party/bouncycastle:bouncycastle_java", |
53 "//third_party/icu4j:icu4j_java", | 53 "//third_party/icu4j:icu4j_java", |
54 "//third_party/intellij:intellij_annotations_java", | 54 "//third_party/intellij:intellij_annotations_java", |
55 "//third_party/junit:junit", | 55 "//third_party/junit:junit", |
56 "//third_party/ow2_asm:asm_analysis_java", | 56 "//third_party/ow2_asm:asm_analysis_java", |
57 "//third_party/ow2_asm:asm_commons_java", | 57 "//third_party/ow2_asm:asm_commons_java", |
58 "//third_party/ow2_asm:asm_java", | 58 "//third_party/ow2_asm:asm_java", |
59 "//third_party/ow2_asm:asm_tree_java", | 59 "//third_party/ow2_asm:asm_tree_java", |
60 "//third_party/ow2_asm:asm_util_java", | 60 "//third_party/ow2_asm:asm_util_java", |
61 "//third_party/sqlite4java:sqlite4java_java", | 61 "//third_party/sqlite4java:sqlite4java_java", |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 additional_jar_files = [ [ | 111 additional_jar_files = [ [ |
112 rebase_path( | 112 rebase_path( |
113 "robolectric/robolectric/src/main/resources/robolectric-version.prop
erties"), | 113 "robolectric/robolectric/src/main/resources/robolectric-version.prop
erties"), |
114 "robolectric-version.properties", | 114 "robolectric-version.properties", |
115 ] ] | 115 ] ] |
116 } | 116 } |
117 | 117 |
118 java_library("robolectric_annotations_java") { | 118 java_library("robolectric_annotations_java") { |
119 testonly = true | 119 testonly = true |
120 deps = [ | 120 deps = [ |
121 ":android-all-5.0.0_r2-robolectric-1", | 121 ":android-all-5.0.0_r2-robolectric-1_java", |
122 "//third_party/intellij:intellij_annotations_java", | 122 "//third_party/intellij:intellij_annotations_java", |
123 ] | 123 ] |
124 java_files = [ | 124 java_files = [ |
125 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/AccessibilityChecks.java", | 125 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/AccessibilityChecks.java", |
126 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Config.java", | 126 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Config.java", |
127 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/HiddenApi.java", | 127 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/HiddenApi.java", |
128 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Implementation.java", | 128 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Implementation.java", |
129 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Implements.java", | 129 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Implements.java", |
130 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/RealObject.java", | 130 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/RealObject.java", |
131 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Resetter.java", | 131 "robolectric/robolectric-annotations/src/main/java/org/robolectric/annotatio
n/Resetter.java", |
(...skipping 26 matching lines...) Expand all Loading... |
158 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/RealObjectValidator.java", | 158 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/RealObjectValidator.java", |
159 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/ResetterValidator.java", | 159 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/ResetterValidator.java", |
160 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/Validator.java", | 160 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/Validator.java", |
161 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/package-info.java", | 161 "robolectric/robolectric-processor/src/main/java/org/robolectric/annotation/
processing/validator/package-info.java", |
162 ] | 162 ] |
163 } | 163 } |
164 | 164 |
165 java_library("robolectric_resources_java") { | 165 java_library("robolectric_resources_java") { |
166 testonly = true | 166 testonly = true |
167 deps = [ | 167 deps = [ |
168 ":android-all-5.0.0_r2-robolectric-1", | 168 ":android-all-5.0.0_r2-robolectric-1_java", |
169 ":robolectric_annotations_java", | 169 ":robolectric_annotations_java", |
170 ":robolectric_utils_java", | 170 ":robolectric_utils_java", |
171 "//third_party/intellij:intellij_annotations_java", | 171 "//third_party/intellij:intellij_annotations_java", |
172 ] | 172 ] |
173 java_files = [ | 173 java_files = [ |
174 "robolectric/robolectric-resources/src/main/java/org/robolectric/RuntimeEnvi
ronment.java", | 174 "robolectric/robolectric-resources/src/main/java/org/robolectric/RuntimeEnvi
ronment.java", |
175 "robolectric/robolectric-resources/src/main/java/org/robolectric/ShadowsAdap
ter.java", | 175 "robolectric/robolectric-resources/src/main/java/org/robolectric/ShadowsAdap
ter.java", |
176 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/Ac
tivityData.java", | 176 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/Ac
tivityData.java", |
177 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/An
droidManifest.java", | 177 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/An
droidManifest.java", |
178 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/Br
oadcastReceiverData.java", | 178 "robolectric/robolectric-resources/src/main/java/org/robolectric/manifest/Br
oadcastReceiverData.java", |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Con
verter.java", | 228 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Con
verter.java", |
229 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Res
ourceHelper.java", | 229 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Res
ourceHelper.java", |
230 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Rob
oAttributeSet.java", | 230 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Rob
oAttributeSet.java", |
231 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Rob
oLayoutInflater.java", | 231 "robolectric/robolectric-resources/src/main/java/org/robolectric/shadows/Rob
oLayoutInflater.java", |
232 ] | 232 ] |
233 } | 233 } |
234 | 234 |
235 java_library("robolectric_utils_java") { | 235 java_library("robolectric_utils_java") { |
236 testonly = true | 236 testonly = true |
237 deps = [ | 237 deps = [ |
238 ":android-all-5.0.0_r2-robolectric-1", | 238 ":android-all-5.0.0_r2-robolectric-1_java", |
239 ":robolectric_annotations_java", | 239 ":robolectric_annotations_java", |
240 "//third_party/accessibility_test_framework:accessibility_test_framework_jav
a", | 240 "//third_party/accessibility_test_framework:accessibility_test_framework_jav
a", |
241 "//third_party/hamcrest:hamcrest_core_java", | 241 "//third_party/hamcrest:hamcrest_core_java", |
242 "//third_party/hamcrest:hamcrest_integration_java", | 242 "//third_party/hamcrest:hamcrest_integration_java", |
243 "//third_party/junit:junit", | 243 "//third_party/junit:junit", |
244 "//third_party/ow2_asm:asm_commons_java", | 244 "//third_party/ow2_asm:asm_commons_java", |
245 "//third_party/ow2_asm:asm_java", | 245 "//third_party/ow2_asm:asm_java", |
246 ] | 246 ] |
247 java_files = [ | 247 java_files = [ |
248 "robolectric/robolectric-utils/src/main/java/org/robolectric/internal/Shadow
.java", | 248 "robolectric/robolectric-utils/src/main/java/org/robolectric/internal/Shadow
.java", |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 "template_processor/src/org/chromium/testing/robolectric/template/TemplateFi
leInfo.java", | 534 "template_processor/src/org/chromium/testing/robolectric/template/TemplateFi
leInfo.java", |
535 ] | 535 ] |
536 main_class = | 536 main_class = |
537 "org.chromium.testing.robolectric.template.ProcessRobolectricTemplate" | 537 "org.chromium.testing.robolectric.template.ProcessRobolectricTemplate" |
538 deps = [ | 538 deps = [ |
539 "//third_party/apache_velocity:apache_velocity_java", | 539 "//third_party/apache_velocity:apache_velocity_java", |
540 ] | 540 ] |
541 } | 541 } |
542 | 542 |
543 template("shadows_core") { | 543 template("shadows_core") { |
544 forward_variables_from(invoker, | |
545 [ | |
546 "api_level", | |
547 "android_sdk_deps", | |
548 ]) | |
549 testonly = true | 544 testonly = true |
550 | 545 |
551 _shadows_core_java_files = invoker.shadows_core_java_files | 546 _shadows_core_java_files = invoker.shadows_core_java_files |
552 _template_files = invoker.template_files | 547 _template_files = invoker.template_files |
553 _process_templates_target_name = "${target_name}__process_templates" | 548 _process_templates_target_name = |
| 549 "shadows_core_${invoker.api_level}__process_templates" |
554 | 550 |
555 _processed_template_files = [] | 551 _processed_template_files = [] |
556 _template_file_args = [] | 552 _template_file_args = [] |
557 foreach(template_file, _template_files) { | 553 foreach(template_file, _template_files) { |
558 _gen_dir = get_path_info(template_file, "gen_dir") | 554 _gen_dir = get_path_info(template_file, "gen_dir") |
559 _name = get_path_info(template_file, "name") | 555 _name = get_path_info(template_file, "name") |
560 _output_file = "$_gen_dir/$api_level/$_name" | 556 _output_file = "$_gen_dir/${invoker.api_level}/$_name" |
561 _template_file_args += [ | 557 _template_file_args += [ |
562 "--process-file", | 558 "--process-file", |
563 "$template_file", | 559 "$template_file", |
564 rebase_path(_output_file, root_build_dir), | 560 rebase_path(_output_file, root_build_dir), |
565 ] | 561 ] |
566 _processed_template_files += [ _output_file ] | 562 _processed_template_files += [ _output_file ] |
567 } | 563 } |
568 | 564 |
569 action(_process_templates_target_name) { | 565 action(_process_templates_target_name) { |
570 _base_template_dir = rebase_path(".", root_build_dir) | 566 _base_template_dir = rebase_path(".", root_build_dir) |
571 script = "$root_build_dir/bin/robolectric_template_processor" | 567 script = "$root_build_dir/bin/robolectric_template_processor" |
572 args = [ | 568 args = [ |
573 "--api-level", | 569 "--api-level", |
574 "$api_level", | 570 "${invoker.api_level}", |
575 "--base-template-dir", | 571 "--base-template-dir", |
576 _base_template_dir, | 572 _base_template_dir, |
577 ] | 573 ] |
578 args += _template_file_args | 574 args += _template_file_args |
579 | 575 |
580 inputs = _template_files | 576 inputs = _template_files |
581 outputs = _processed_template_files | 577 outputs = _processed_template_files |
582 | 578 |
583 deps = [ | 579 deps = [ |
584 ":robolectric_template_processor", | 580 ":robolectric_template_processor", |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 ":robolectric_annotations_java", | 631 ":robolectric_annotations_java", |
636 ":robolectric_processor_java", | 632 ":robolectric_processor_java", |
637 ":robolectric_resources_java", | 633 ":robolectric_resources_java", |
638 ":robolectric_utils_java", | 634 ":robolectric_utils_java", |
639 "//build/android:sun_tools_java", | 635 "//build/android:sun_tools_java", |
640 "//third_party/guava:guava_java", | 636 "//third_party/guava:guava_java", |
641 "//third_party/icu4j:icu4j_java", | 637 "//third_party/icu4j:icu4j_java", |
642 "//third_party/intellij:intellij_annotations_java", | 638 "//third_party/intellij:intellij_annotations_java", |
643 "//third_party/sqlite4java:sqlite4java_java", | 639 "//third_party/sqlite4java:sqlite4java_java", |
644 ] | 640 ] |
645 deps += android_sdk_deps | 641 deps += invoker.android_sdk_deps |
646 } | 642 } |
647 } | 643 } |
648 | 644 |
649 shadows_core("shadows-core-3.0-21") { | 645 shadows_core("shadows-core-3.0-21_java") { |
650 api_level = 21 | 646 api_level = 21 |
651 android_sdk_deps = [ ":android-all-5.0.0_r2-robolectric-1" ] | 647 android_sdk_deps = [ ":android-all-5.0.0_r2-robolectric-1_java" ] |
652 } | 648 } |
653 | 649 |
654 shadows_core("shadows-core-3.0-18") { | 650 shadows_core("shadows-core-3.0-18_java") { |
655 api_level = 18 | 651 api_level = 18 |
656 android_sdk_deps = [ ":android-all-4.3_r2-robolectric-0" ] | 652 android_sdk_deps = [ ":android-all-4.3_r2-robolectric-0_java" ] |
657 } | 653 } |
658 | 654 |
659 java_library("shadows-multidex-3.0") { | 655 java_library("shadows-multidex-3.0_java") { |
660 testonly = true | 656 testonly = true |
661 processors_javac = | 657 processors_javac = |
662 [ "org.robolectric.annotation.processing.RobolectricProcessor" ] | 658 [ "org.robolectric.annotation.processing.RobolectricProcessor" ] |
663 processor_args_javac = [ "org.robolectric.annotation.processing.shadowPackage=
org.robolectric.shadows.multidex" ] | 659 processor_args_javac = [ "org.robolectric.annotation.processing.shadowPackage=
org.robolectric.shadows.multidex" ] |
664 provider_configurations = [ "robolectric/robolectric-shadows/shadows-multidex/
src/main/resources/META-INF/services/org.robolectric.internal.ShadowProvider" ] | 660 provider_configurations = [ "robolectric/robolectric-shadows/shadows-multidex/
src/main/resources/META-INF/services/org.robolectric.internal.ShadowProvider" ] |
665 java_files = [ | 661 java_files = [ |
666 "robolectric/robolectric-shadows/shadows-multidex/src/main/java/org/robolect
ric/shadows/multidex/ShadowMultiDex.java", | 662 "robolectric/robolectric-shadows/shadows-multidex/src/main/java/org/robolect
ric/shadows/multidex/ShadowMultiDex.java", |
667 "robolectric/robolectric-shadows/shadows-multidex/src/main/java/org/robolect
ric/shadows/multidex/package-info.java", | 663 "robolectric/robolectric-shadows/shadows-multidex/src/main/java/org/robolect
ric/shadows/multidex/package-info.java", |
668 ] | 664 ] |
669 | 665 |
670 deps = [ | 666 deps = [ |
671 ":android-all-5.0.0_r2-robolectric-1", | 667 ":android-all-5.0.0_r2-robolectric-1_java", |
672 ":robolectric_annotations_java", | 668 ":robolectric_annotations_java", |
673 ":robolectric_processor_java", | 669 ":robolectric_processor_java", |
674 ":robolectric_utils_java", | 670 ":robolectric_utils_java", |
675 "//build/android:sun_tools_java", | 671 "//build/android:sun_tools_java", |
676 "//third_party/android_tools:android_support_multidex_java", | 672 "//third_party/android_tools:android_support_multidex_java", |
677 "//third_party/guava:guava_java", | 673 "//third_party/guava:guava_java", |
678 ] | 674 ] |
679 } | 675 } |
OLD | NEW |