Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 1 | // Copyright (C) 2023 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 | |
| 15 | // We need this "trampoline" rule to force soong to give a host-side jar to |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 16 | // framework-minus-apex.ravenwood-base. Otherwise, soong would mix up the arch (?) and we'd get |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 17 | // a dex jar. |
| 18 | java_library { |
| 19 | name: "framework-minus-apex-for-hoststubgen", |
| 20 | installable: false, // host only jar. |
| 21 | static_libs: [ |
| 22 | "framework-minus-apex", |
| 23 | ], |
| 24 | sdk_version: "core_platform", |
| 25 | visibility: ["//visibility:private"], |
| 26 | } |
| 27 | |
| 28 | // Generate the stub/impl from framework-all, with hidden APIs. |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 29 | java_genrule { |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 30 | name: "framework-minus-apex.ravenwood-base", |
| 31 | tools: ["hoststubgen"], |
| 32 | cmd: "$(location hoststubgen) " + |
Makoto Onuki | 743a58a | 2023-11-09 12:46:31 -0800 | [diff] [blame] | 33 | "@$(location ravenwood/ravenwood-standard-options.txt) " + |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 34 | |
Makoto Onuki | 623cffb | 2023-11-29 10:45:06 -0800 | [diff] [blame] | 35 | "--debug-log $(location hoststubgen_framework-minus-apex.log) " + |
| 36 | |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 37 | "--out-impl-jar $(location ravenwood.jar) " + |
| 38 | |
| 39 | "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " + |
| 40 | "--gen-input-dump-file $(location hoststubgen_dump.txt) " + |
| 41 | |
| 42 | "--in-jar $(location :framework-minus-apex-for-hoststubgen) " + |
Makoto Onuki | 743a58a | 2023-11-09 12:46:31 -0800 | [diff] [blame] | 43 | "--policy-override-file $(location ravenwood/framework-minus-apex-ravenwood-policies.txt) " + |
| 44 | "--annotation-allowed-classes-file $(location ravenwood/ravenwood-annotation-allowed-classes.txt) ", |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 45 | srcs: [ |
| 46 | ":framework-minus-apex-for-hoststubgen", |
Makoto Onuki | 743a58a | 2023-11-09 12:46:31 -0800 | [diff] [blame] | 47 | "ravenwood/framework-minus-apex-ravenwood-policies.txt", |
| 48 | "ravenwood/ravenwood-standard-options.txt", |
| 49 | "ravenwood/ravenwood-annotation-allowed-classes.txt", |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 50 | ], |
| 51 | out: [ |
| 52 | "ravenwood.jar", |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 53 | |
| 54 | // Following files are created just as FYI. |
| 55 | "hoststubgen_keep_all.txt", |
| 56 | "hoststubgen_dump.txt", |
Makoto Onuki | 623cffb | 2023-11-29 10:45:06 -0800 | [diff] [blame] | 57 | |
| 58 | "hoststubgen_framework-minus-apex.log", |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 59 | ], |
| 60 | visibility: ["//visibility:private"], |
| 61 | } |
| 62 | |
| 63 | // Extract the impl jar from "framework-minus-apex.ravenwood-base" for subsequent build rules. |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 64 | // Note this emits a "device side" output, so that ravenwood tests can (implicitly) |
| 65 | // depend on it. |
| 66 | java_genrule { |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 67 | name: "framework-minus-apex.ravenwood", |
Makoto Onuki | 8bcc628 | 2023-12-18 14:03:59 -0800 | [diff] [blame] | 68 | defaults: ["ravenwood-internal-only-visibility-genrule"], |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 69 | cmd: "cp $(in) $(out)", |
| 70 | srcs: [ |
| 71 | ":framework-minus-apex.ravenwood-base{ravenwood.jar}", |
| 72 | ], |
| 73 | out: [ |
| 74 | "framework-minus-apex.ravenwood.jar", |
| 75 | ], |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 76 | } |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 77 | |
Jeff Sharkey | ed81c78 | 2024-01-11 13:29:07 -0700 | [diff] [blame^] | 78 | java_library { |
| 79 | name: "mockito-ravenwood-prebuilt", |
| 80 | installable: false, |
| 81 | static_libs: [ |
| 82 | "mockito-robolectric-prebuilt", |
| 83 | ], |
| 84 | } |
| 85 | |
| 86 | java_library { |
| 87 | name: "inline-mockito-ravenwood-prebuilt", |
| 88 | installable: false, |
| 89 | static_libs: [ |
| 90 | "inline-mockito-robolectric-prebuilt", |
| 91 | ], |
| 92 | } |
| 93 | |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 94 | android_ravenwood_libgroup { |
| 95 | name: "ravenwood-runtime", |
| 96 | libs: [ |
| 97 | "framework-minus-apex.ravenwood", |
| 98 | "hoststubgen-helper-runtime.ravenwood", |
| 99 | "hoststubgen-helper-framework-runtime.ravenwood", |
Jeff Sharkey | 7c49507 | 2024-01-11 13:26:25 -0700 | [diff] [blame] | 100 | "all-updatable-modules-system-stubs", |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 101 | "junit", |
| 102 | "truth", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 103 | "ravenwood-junit-impl", |
Jeff Sharkey | de34471 | 2023-11-29 12:17:43 -0700 | [diff] [blame] | 104 | "android.test.mock.ravenwood", |
Jeff Sharkey | ed81c78 | 2024-01-11 13:29:07 -0700 | [diff] [blame^] | 105 | "mockito-ravenwood-prebuilt", |
| 106 | "inline-mockito-ravenwood-prebuilt", |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 107 | ], |
| 108 | } |
| 109 | |
| 110 | android_ravenwood_libgroup { |
| 111 | name: "ravenwood-utils", |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 112 | libs: [ |
| 113 | "junit", |
| 114 | "truth", |
| 115 | "ravenwood-junit", |
Jeff Sharkey | ed81c78 | 2024-01-11 13:29:07 -0700 | [diff] [blame^] | 116 | "mockito-ravenwood-prebuilt", |
| 117 | "inline-mockito-ravenwood-prebuilt", |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 118 | ], |
Makoto Onuki | c69a84e | 2023-10-20 10:43:55 -0700 | [diff] [blame] | 119 | } |