blob: f8db47b61a4f785fa5d84809a18802a97f0973fd [file] [log] [blame]
Colin Cross87224a82019-04-02 23:04:13 -07001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15java_library {
16 name: "robolectric_android-all-stub",
17
18 static_libs: [
19 "conscrypt",
Victor Changfa9de592019-08-06 16:38:07 +010020 "core-icu4j",
Colin Cross87224a82019-04-02 23:04:13 -070021 "core-libart",
22 "ext",
Jiyong Parkd6566b02020-01-06 13:28:58 +090023 "framework-all",
Colin Cross87224a82019-04-02 23:04:13 -070024 "icu4j-icudata-jarjar",
25 "icu4j-icutzdata-jarjar",
26 "ims-common",
27 "android.test.base_static",
28 "libphonenumber-platform",
29 "okhttp",
30 "services",
31 "services.accessibility",
32 "telephony-common",
Colin Cross87224a82019-04-02 23:04:13 -070033
34 "robolectric_tzdata",
35 "robolectric_framework_res",
36 "robolectric_framework_raw_res",
37 ],
38
39 java_resources: [
40 // Copy the build.prop
41 ":robolectric_build_props",
42 ],
43 dist: {
44 targets: [
45 "sdk",
46 "win_sdk",
47 ],
48 dest: "android-all-robolectric.jar",
49 }
50}
51
52// build.prop file created by module type defined in soong/robolectric.go
53robolectric_build_props {
54 name: "robolectric_build_props",
55}
56
57// package the framework raw/uncompiled resources and assets into a jar
58// This logic can be removed once the transition to binary resources is complete
59java_library {
60 name: "robolectric_framework_raw_res_orig",
61 java_resources: [":robolectric_framework_raw_res_files"],
62}
63
64// Move the raw/uncompiled resources and assets into raw-res/
65// This logic can be removed once the transition to binary resources is complete
66java_genrule {
67 name: "robolectric_framework_raw_res",
68 out: ["robolectric_framework_raw_res.jar"],
69 srcs: [":robolectric_framework_raw_res_orig"],
70 tools: ["zip2zip"],
71 cmd: "$(location zip2zip) " +
72 "-i $(location :robolectric_framework_raw_res_orig) " +
73 "-o $(location robolectric_framework_raw_res.jar) " +
74 "-x META-INF/**/* " +
75 "**/*:raw-res/",
76}
77
78java_genrule {
79 name: "robolectric_framework_res",
80 tools: ["zip2zip"],
81 srcs: [":framework-res"],
82 out: ["robolectric_framework_res.jar"],
83 cmd: "$(location zip2zip) " +
84 "-i $(location :framework-res) " +
85 "-o $(location robolectric_framework_res.jar) " +
86 "-x classes.dex " +
87 "-x META-INF/**/* " +
88 "-0 resources.arsc",
89}
Colin Cross698cc7c2019-04-23 15:11:07 -070090
91// Make robolectric_android-all-stub available as a host jar
92java_device_for_host {
93 name: "robolectric-host-android_all",
94 libs: ["robolectric_android-all-stub"],
95}
96
97//#############################################
98// Assemble Robolectric_all
99//#############################################
100
101java_library_host {
102 name: "Robolectric_all",
103
104 static_libs: [
105 "Robolectric_shadows_androidx_fragment",
106 "Robolectric_shadows_httpclient",
107 "Robolectric_shadows_framework",
108 "Robolectric_shadows_supportv4",
109 "Robolectric_shadows_multidex",
110 "Robolectric_robolectric",
111 "Robolectric_annotations",
112 "Robolectric_resources",
113 "Robolectric_shadowapi",
114 "Robolectric_sandbox",
115 "Robolectric_junit",
116 "Robolectric_utils",
Pete Gillin390294a2019-06-20 17:00:30 +0100117 "asm-6.0", // if upgrading to ASM 7.0+, unset my_require_v53_or_lower_class_files in robotest-internal.mk (requires robolectric 4.0.x, see b/135459087)
Colin Cross698cc7c2019-04-23 15:11:07 -0700118 "junit",
119 "asm-tree-6.0",
120 "guava",
121 "asm-commons-6.0",
122 "bouncycastle-unbundled",
123 "robolectric-sqlite4java-0.282",
124 "hamcrest",
125 "hamcrest-library",
126 "robolectric-host-androidx-test-runner",
127 "robolectric-host-org_apache_http_legacy",
128 ],
129
130 java_resource_dirs: [
131 "shadows/framework/src/main/resources",
132 "src/main/resources",
133 ],
134}
135
136// Make Robolectric_all available as a target jar
137java_host_for_device {
138 name: "Robolectric_all-target",
139 libs: ["Robolectric_all"],
140}
141
142// Make dependencies available as host jars
143java_device_for_host {
144 name: "robolectric-host-androidx-test-core",
145 libs: ["androidx.test.core"],
146}
147
148java_device_for_host {
149 name: "robolectric-host-androidx-test-ext-junit",
150 libs: ["androidx.test.ext.junit"],
151}
152
153java_device_for_host {
154 name: "robolectric-host-androidx-test-monitor",
155 libs: ["androidx.test.monitor"],
156}
157
158java_device_for_host {
159 name: "robolectric-host-androidx-test-runner",
160 libs: ["androidx.test.runner"],
161}
162
163java_device_for_host {
164 name: "robolectric-host-androidx",
165 libs: ["androidx.fragment_fragment"],
166}
167
168java_device_for_host {
169 name: "robolectric-host-android-support-v4",
170 libs: ["android-support-v4"],
171}
172
173java_device_for_host {
174 name: "robolectric-host-android-support-multidex",
175 libs: ["android-support-multidex"],
176}
177
178java_device_for_host {
179 name: "robolectric-host-org_apache_http_legacy",
180 libs: ["org.apache.http.legacy.stubs"],
181}