aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-04-02 23:04:13 -0700
committerColin Cross <ccross@android.com>2019-04-08 15:56:32 +0000
commit87224a8f7966767c728376b56284e012ee2b3980 (patch)
tree6f360163b095aa6202da09e0cf21979bd63588db /Android.bp
parent1503523a0d9f04ad5d300136016582a2c61bbe10 (diff)
downloadrobolectric-shadows-87224a8f7966767c728376b56284e012ee2b3980.tar.gz
Convert robolectric_android-all-stub to Android.bp
See build/soong/README.md for more information. The result should be the same as when it was generated by make, except that build.prop is now custom generated by soong/robolectric.go instead of using the one generated for the system image. Test: m checkbuild Test: m RunSettingsRoboTests Bug: 122331577 Change-Id: I3147efcb952b010e629fbf8075ff55a7d49a2462 Merged-In: I3147efcb952b010e629fbf8075ff55a7d49a2462 (cherry picked from commit c3d581068f9faa1898a432e32c7ed4f760237abd)
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp89
1 files changed, 89 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 000000000..8f91855dd
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,89 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_library {
+ name: "robolectric_android-all-stub",
+
+ static_libs: [
+ "conscrypt",
+ "core-libart",
+ "ext",
+ "framework",
+ "icu4j-icudata-jarjar",
+ "icu4j-icutzdata-jarjar",
+ "ims-common",
+ "android.test.base_static",
+ "libphonenumber-platform",
+ "okhttp",
+ "services",
+ "services.accessibility",
+ "telephony-common",
+ "updatable-media",
+
+ "robolectric_tzdata",
+ "robolectric_framework_res",
+ "robolectric_framework_raw_res",
+ ],
+
+ java_resources: [
+ // Copy the build.prop
+ ":robolectric_build_props",
+ ],
+ dist: {
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
+ dest: "android-all-robolectric.jar",
+ }
+}
+
+// build.prop file created by module type defined in soong/robolectric.go
+robolectric_build_props {
+ name: "robolectric_build_props",
+}
+
+// package the framework raw/uncompiled resources and assets into a jar
+// This logic can be removed once the transition to binary resources is complete
+java_library {
+ name: "robolectric_framework_raw_res_orig",
+ java_resources: [":robolectric_framework_raw_res_files"],
+}
+
+// Move the raw/uncompiled resources and assets into raw-res/
+// This logic can be removed once the transition to binary resources is complete
+java_genrule {
+ name: "robolectric_framework_raw_res",
+ out: ["robolectric_framework_raw_res.jar"],
+ srcs: [":robolectric_framework_raw_res_orig"],
+ tools: ["zip2zip"],
+ cmd: "$(location zip2zip) " +
+ "-i $(location :robolectric_framework_raw_res_orig) " +
+ "-o $(location robolectric_framework_raw_res.jar) " +
+ "-x META-INF/**/* " +
+ "**/*:raw-res/",
+}
+
+java_genrule {
+ name: "robolectric_framework_res",
+ tools: ["zip2zip"],
+ srcs: [":framework-res"],
+ out: ["robolectric_framework_res.jar"],
+ cmd: "$(location zip2zip) " +
+ "-i $(location :framework-res) " +
+ "-o $(location robolectric_framework_res.jar) " +
+ "-x classes.dex " +
+ "-x META-INF/**/* " +
+ "-0 resources.arsc",
+}