Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 1 | // Copyright (C) 2021 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 | package apex |
| 16 | |
| 17 | import ( |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 18 | "fmt" |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 19 | "sort" |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 20 | "strings" |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 21 | "testing" |
| 22 | |
| 23 | "android/soong/android" |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 24 | "android/soong/java" |
Paul Duffin | 5cca7c4 | 2021-05-26 10:16:01 +0100 | [diff] [blame] | 25 | "github.com/google/blueprint/proptools" |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 26 | ) |
| 27 | |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 28 | // Contains tests for bootclasspath_fragment logic from java/bootclasspath_fragment.go as the ART |
| 29 | // bootclasspath_fragment requires modules from the ART apex. |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 30 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 31 | var prepareForTestWithBootclasspathFragment = android.GroupFixturePreparers( |
Paul Duffin | 52bfaa4 | 2021-03-23 23:40:12 +0000 | [diff] [blame] | 32 | java.PrepareForTestWithDexpreopt, |
| 33 | PrepareForTestWithApexBuildComponents, |
| 34 | ) |
| 35 | |
| 36 | // Some additional files needed for the art apex. |
| 37 | var prepareForTestWithArtApex = android.FixtureMergeMockFs(android.MockFS{ |
| 38 | "com.android.art.avbpubkey": nil, |
| 39 | "com.android.art.pem": nil, |
| 40 | "system/sepolicy/apex/com.android.art-file_contexts": nil, |
| 41 | }) |
| 42 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 43 | func TestBootclasspathFragments(t *testing.T) { |
Paul Duffin | 52bfaa4 | 2021-03-23 23:40:12 +0000 | [diff] [blame] | 44 | result := android.GroupFixturePreparers( |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 45 | prepareForTestWithBootclasspathFragment, |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 46 | // Configure some libraries in the art bootclasspath_fragment and platform_bootclasspath. |
Paul Duffin | 60264a0 | 2021-04-12 20:02:36 +0100 | [diff] [blame] | 47 | java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "platform:foo", "platform:bar"), |
Paul Duffin | 52bfaa4 | 2021-03-23 23:40:12 +0000 | [diff] [blame] | 48 | prepareForTestWithArtApex, |
| 49 | |
| 50 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 51 | java.FixtureWithLastReleaseApis("foo"), |
Paul Duffin | 34d433a | 2021-03-09 14:13:25 +0000 | [diff] [blame] | 52 | ).RunTestWithBp(t, ` |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 53 | java_sdk_library { |
| 54 | name: "foo", |
| 55 | srcs: ["b.java"], |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | java_library { |
| 59 | name: "bar", |
| 60 | srcs: ["b.java"], |
| 61 | installable: true, |
| 62 | } |
| 63 | |
| 64 | apex { |
| 65 | name: "com.android.art", |
| 66 | key: "com.android.art.key", |
Paul Duffin | 58e0e76 | 2021-05-21 19:27:58 +0100 | [diff] [blame] | 67 | bootclasspath_fragments: ["art-bootclasspath-fragment"], |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 68 | java_libs: [ |
| 69 | "baz", |
| 70 | "quuz", |
| 71 | ], |
Mathew Inwood | f8dcf5e | 2021-02-16 11:40:16 +0000 | [diff] [blame] | 72 | updatable: false, |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | apex_key { |
| 76 | name: "com.android.art.key", |
| 77 | public_key: "com.android.art.avbpubkey", |
| 78 | private_key: "com.android.art.pem", |
| 79 | } |
| 80 | |
| 81 | java_library { |
| 82 | name: "baz", |
| 83 | apex_available: [ |
| 84 | "com.android.art", |
| 85 | ], |
| 86 | srcs: ["b.java"], |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 87 | compile_dex: true, |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | java_library { |
| 91 | name: "quuz", |
| 92 | apex_available: [ |
| 93 | "com.android.art", |
| 94 | ], |
| 95 | srcs: ["b.java"], |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 96 | compile_dex: true, |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 97 | } |
Paul Duffin | 5bbfef8 | 2021-01-30 12:57:26 +0000 | [diff] [blame] | 98 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 99 | bootclasspath_fragment { |
| 100 | name: "art-bootclasspath-fragment", |
Paul Duffin | 5bbfef8 | 2021-01-30 12:57:26 +0000 | [diff] [blame] | 101 | image_name: "art", |
Paul Duffin | f23bc47 | 2021-04-27 12:42:20 +0100 | [diff] [blame] | 102 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 103 | contents: ["baz", "quuz"], |
Paul Duffin | c7ef989 | 2021-03-23 23:21:59 +0000 | [diff] [blame] | 104 | apex_available: [ |
| 105 | "com.android.art", |
| 106 | ], |
Paul Duffin | 5bbfef8 | 2021-01-30 12:57:26 +0000 | [diff] [blame] | 107 | } |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 108 | `, |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 109 | ) |
| 110 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 111 | // Make sure that the art-bootclasspath-fragment is using the correct configuration. |
Paul Duffin | 58e0e76 | 2021-05-21 19:27:58 +0100 | [diff] [blame] | 112 | checkBootclasspathFragment(t, result, "art-bootclasspath-fragment", "android_common_apex10000", |
| 113 | "com.android.art:baz,com.android.art:quuz", ` |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 114 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art |
| 115 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat |
| 116 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex |
| 117 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.art |
| 118 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.oat |
| 119 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot-quuz.vdex |
| 120 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art |
| 121 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat |
| 122 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex |
| 123 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.art |
| 124 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.oat |
| 125 | test_device/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-quuz.vdex |
| 126 | `) |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 127 | } |
| 128 | |
Paul Duffin | f1b358c | 2021-05-17 07:38:47 +0100 | [diff] [blame] | 129 | func TestBootclasspathFragments_FragmentDependency(t *testing.T) { |
| 130 | result := android.GroupFixturePreparers( |
| 131 | prepareForTestWithBootclasspathFragment, |
| 132 | // Configure some libraries in the art bootclasspath_fragment and platform_bootclasspath. |
| 133 | java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "platform:foo", "platform:bar"), |
| 134 | prepareForTestWithArtApex, |
| 135 | |
| 136 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 137 | java.FixtureWithLastReleaseApis("foo", "baz"), |
| 138 | ).RunTestWithBp(t, ` |
| 139 | java_sdk_library { |
| 140 | name: "foo", |
| 141 | srcs: ["b.java"], |
| 142 | shared_library: false, |
| 143 | public: { |
| 144 | enabled: true, |
| 145 | }, |
| 146 | system: { |
| 147 | enabled: true, |
| 148 | }, |
| 149 | } |
| 150 | |
| 151 | java_library { |
| 152 | name: "bar", |
| 153 | srcs: ["b.java"], |
| 154 | installable: true, |
| 155 | } |
| 156 | |
| 157 | apex { |
| 158 | name: "com.android.art", |
| 159 | key: "com.android.art.key", |
| 160 | bootclasspath_fragments: ["art-bootclasspath-fragment"], |
| 161 | updatable: false, |
| 162 | } |
| 163 | |
| 164 | apex_key { |
| 165 | name: "com.android.art.key", |
| 166 | public_key: "com.android.art.avbpubkey", |
| 167 | private_key: "com.android.art.pem", |
| 168 | } |
| 169 | |
| 170 | java_sdk_library { |
| 171 | name: "baz", |
| 172 | apex_available: [ |
| 173 | "com.android.art", |
| 174 | ], |
| 175 | srcs: ["b.java"], |
| 176 | shared_library: false, |
| 177 | public: { |
| 178 | enabled: true, |
| 179 | }, |
| 180 | system: { |
| 181 | enabled: true, |
| 182 | }, |
| 183 | test: { |
| 184 | enabled: true, |
| 185 | }, |
| 186 | } |
| 187 | |
| 188 | java_library { |
| 189 | name: "quuz", |
| 190 | apex_available: [ |
| 191 | "com.android.art", |
| 192 | ], |
| 193 | srcs: ["b.java"], |
| 194 | compile_dex: true, |
| 195 | } |
| 196 | |
| 197 | bootclasspath_fragment { |
| 198 | name: "art-bootclasspath-fragment", |
| 199 | image_name: "art", |
| 200 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 201 | contents: ["baz", "quuz"], |
| 202 | apex_available: [ |
| 203 | "com.android.art", |
| 204 | ], |
| 205 | } |
| 206 | |
| 207 | bootclasspath_fragment { |
| 208 | name: "other-bootclasspath-fragment", |
| 209 | contents: ["foo", "bar"], |
| 210 | fragments: [ |
| 211 | { |
| 212 | apex: "com.android.art", |
| 213 | module: "art-bootclasspath-fragment", |
| 214 | }, |
| 215 | ], |
| 216 | } |
| 217 | `, |
| 218 | ) |
| 219 | |
Paul Duffin | 31fad80 | 2021-06-18 18:14:25 +0100 | [diff] [blame] | 220 | checkAPIScopeStubs := func(message string, info java.HiddenAPIInfo, apiScope *java.HiddenAPIScope, expectedPaths ...string) { |
Paul Duffin | f1b358c | 2021-05-17 07:38:47 +0100 | [diff] [blame] | 221 | t.Helper() |
Paul Duffin | 280a31a | 2021-06-27 20:28:29 +0100 | [diff] [blame] | 222 | paths := info.TransitiveStubDexJarsByScope.StubDexJarsForScope(apiScope) |
| 223 | android.AssertPathsRelativeToTopEquals(t, fmt.Sprintf("%s %s", message, apiScope), expectedPaths, paths) |
Paul Duffin | f1b358c | 2021-05-17 07:38:47 +0100 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | // Check stub dex paths exported by art. |
| 227 | artFragment := result.Module("art-bootclasspath-fragment", "android_common") |
| 228 | artInfo := result.ModuleProvider(artFragment, java.HiddenAPIInfoProvider).(java.HiddenAPIInfo) |
| 229 | |
| 230 | bazPublicStubs := "out/soong/.intermediates/baz.stubs/android_common/dex/baz.stubs.jar" |
| 231 | bazSystemStubs := "out/soong/.intermediates/baz.stubs.system/android_common/dex/baz.stubs.system.jar" |
| 232 | bazTestStubs := "out/soong/.intermediates/baz.stubs.test/android_common/dex/baz.stubs.test.jar" |
| 233 | |
Paul Duffin | 31fad80 | 2021-06-18 18:14:25 +0100 | [diff] [blame] | 234 | checkAPIScopeStubs("art", artInfo, java.PublicHiddenAPIScope, bazPublicStubs) |
| 235 | checkAPIScopeStubs("art", artInfo, java.SystemHiddenAPIScope, bazSystemStubs) |
| 236 | checkAPIScopeStubs("art", artInfo, java.TestHiddenAPIScope, bazTestStubs) |
| 237 | checkAPIScopeStubs("art", artInfo, java.CorePlatformHiddenAPIScope) |
Paul Duffin | f1b358c | 2021-05-17 07:38:47 +0100 | [diff] [blame] | 238 | |
| 239 | // Check stub dex paths exported by other. |
| 240 | otherFragment := result.Module("other-bootclasspath-fragment", "android_common") |
| 241 | otherInfo := result.ModuleProvider(otherFragment, java.HiddenAPIInfoProvider).(java.HiddenAPIInfo) |
| 242 | |
| 243 | fooPublicStubs := "out/soong/.intermediates/foo.stubs/android_common/dex/foo.stubs.jar" |
| 244 | fooSystemStubs := "out/soong/.intermediates/foo.stubs.system/android_common/dex/foo.stubs.system.jar" |
| 245 | |
Paul Duffin | 31fad80 | 2021-06-18 18:14:25 +0100 | [diff] [blame] | 246 | checkAPIScopeStubs("other", otherInfo, java.PublicHiddenAPIScope, bazPublicStubs, fooPublicStubs) |
| 247 | checkAPIScopeStubs("other", otherInfo, java.SystemHiddenAPIScope, bazSystemStubs, fooSystemStubs) |
| 248 | checkAPIScopeStubs("other", otherInfo, java.TestHiddenAPIScope, bazTestStubs, fooSystemStubs) |
| 249 | checkAPIScopeStubs("other", otherInfo, java.CorePlatformHiddenAPIScope) |
Paul Duffin | f1b358c | 2021-05-17 07:38:47 +0100 | [diff] [blame] | 250 | } |
| 251 | |
Paul Duffin | 58e0e76 | 2021-05-21 19:27:58 +0100 | [diff] [blame] | 252 | func checkBootclasspathFragment(t *testing.T, result *android.TestResult, moduleName, variantName string, expectedConfiguredModules string, expectedBootclasspathFragmentFiles string) { |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 253 | t.Helper() |
| 254 | |
Paul Duffin | 58e0e76 | 2021-05-21 19:27:58 +0100 | [diff] [blame] | 255 | bootclasspathFragment := result.ModuleForTests(moduleName, variantName).Module().(*java.BootclasspathFragmentModule) |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 256 | |
Paul Duffin | e946b32 | 2021-04-25 23:04:00 +0100 | [diff] [blame] | 257 | bootclasspathFragmentInfo := result.ModuleProvider(bootclasspathFragment, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo) |
| 258 | modules := bootclasspathFragmentInfo.Modules() |
Paul Duffin | 34d433a | 2021-03-09 14:13:25 +0000 | [diff] [blame] | 259 | android.AssertStringEquals(t, "invalid modules for "+moduleName, expectedConfiguredModules, modules.String()) |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 260 | |
| 261 | // Get a list of all the paths in the boot image sorted by arch type. |
| 262 | allPaths := []string{} |
Paul Duffin | e946b32 | 2021-04-25 23:04:00 +0100 | [diff] [blame] | 263 | bootImageFilesByArchType := bootclasspathFragmentInfo.AndroidBootImageFilesByArchType() |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 264 | for _, archType := range android.ArchTypeList() { |
| 265 | if paths, ok := bootImageFilesByArchType[archType]; ok { |
| 266 | for _, path := range paths { |
| 267 | allPaths = append(allPaths, android.NormalizePathForTesting(path)) |
| 268 | } |
| 269 | } |
| 270 | } |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 271 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 272 | android.AssertTrimmedStringEquals(t, "invalid paths for "+moduleName, expectedBootclasspathFragmentFiles, strings.Join(allPaths, "\n")) |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 273 | } |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 274 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 275 | func TestBootclasspathFragmentInArtApex(t *testing.T) { |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 276 | commonPreparer := android.GroupFixturePreparers( |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 277 | prepareForTestWithBootclasspathFragment, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 278 | prepareForTestWithArtApex, |
| 279 | |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 280 | android.FixtureWithRootAndroidBp(` |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 281 | apex { |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 282 | name: "com.android.art", |
| 283 | key: "com.android.art.key", |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 284 | bootclasspath_fragments: [ |
| 285 | "mybootclasspathfragment", |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 286 | ], |
Paul Duffin | 4d101b6 | 2021-03-24 15:42:20 +0000 | [diff] [blame] | 287 | // bar (like foo) should be transitively included in this apex because it is part of the |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 288 | // mybootclasspathfragment bootclasspath_fragment. However, it is kept here to ensure that the |
| 289 | // apex dedups the files correctly. |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 290 | java_libs: [ |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 291 | "bar", |
| 292 | ], |
Mathew Inwood | f8dcf5e | 2021-02-16 11:40:16 +0000 | [diff] [blame] | 293 | updatable: false, |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | apex_key { |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 297 | name: "com.android.art.key", |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 298 | public_key: "testkey.avbpubkey", |
| 299 | private_key: "testkey.pem", |
| 300 | } |
| 301 | |
| 302 | java_library { |
| 303 | name: "foo", |
| 304 | srcs: ["b.java"], |
| 305 | installable: true, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 306 | apex_available: [ |
| 307 | "com.android.art", |
| 308 | ], |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | java_library { |
| 312 | name: "bar", |
| 313 | srcs: ["b.java"], |
| 314 | installable: true, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 315 | apex_available: [ |
| 316 | "com.android.art", |
| 317 | ], |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 318 | } |
| 319 | |
Paul Duffin | 6589805 | 2021-04-20 22:47:03 +0100 | [diff] [blame] | 320 | java_import { |
| 321 | name: "foo", |
| 322 | jars: ["foo.jar"], |
| 323 | apex_available: [ |
| 324 | "com.android.art", |
| 325 | ], |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 326 | compile_dex: true, |
Paul Duffin | 6589805 | 2021-04-20 22:47:03 +0100 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | java_import { |
| 330 | name: "bar", |
| 331 | jars: ["bar.jar"], |
| 332 | apex_available: [ |
| 333 | "com.android.art", |
| 334 | ], |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 335 | compile_dex: true, |
Paul Duffin | 6589805 | 2021-04-20 22:47:03 +0100 | [diff] [blame] | 336 | } |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 337 | `), |
| 338 | ) |
Paul Duffin | 6589805 | 2021-04-20 22:47:03 +0100 | [diff] [blame] | 339 | |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 340 | contentsInsert := func(contents []string) string { |
| 341 | insert := "" |
| 342 | if contents != nil { |
| 343 | insert = fmt.Sprintf(`contents: ["%s"],`, strings.Join(contents, `", "`)) |
Paul Duffin | 396229f | 2021-03-18 18:30:31 +0000 | [diff] [blame] | 344 | } |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 345 | return insert |
| 346 | } |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 347 | |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 348 | addSource := func(contents ...string) android.FixturePreparer { |
| 349 | text := fmt.Sprintf(` |
| 350 | bootclasspath_fragment { |
| 351 | name: "mybootclasspathfragment", |
| 352 | image_name: "art", |
| 353 | %s |
| 354 | apex_available: [ |
| 355 | "com.android.art", |
| 356 | ], |
| 357 | } |
| 358 | `, contentsInsert(contents)) |
| 359 | |
| 360 | return android.FixtureAddTextFile("art/build/boot/Android.bp", text) |
| 361 | } |
| 362 | |
| 363 | addPrebuilt := func(prefer bool, contents ...string) android.FixturePreparer { |
| 364 | text := fmt.Sprintf(` |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 365 | prebuilt_apex { |
| 366 | name: "com.android.art", |
| 367 | arch: { |
| 368 | arm64: { |
| 369 | src: "com.android.art-arm64.apex", |
| 370 | }, |
| 371 | arm: { |
| 372 | src: "com.android.art-arm.apex", |
| 373 | }, |
| 374 | }, |
| 375 | exported_bootclasspath_fragments: ["mybootclasspathfragment"], |
| 376 | } |
| 377 | |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 378 | prebuilt_bootclasspath_fragment { |
| 379 | name: "mybootclasspathfragment", |
| 380 | image_name: "art", |
| 381 | %s |
| 382 | prefer: %t, |
| 383 | apex_available: [ |
| 384 | "com.android.art", |
| 385 | ], |
Paul Duffin | 54e4197 | 2021-07-19 13:23:40 +0100 | [diff] [blame^] | 386 | hidden_api: { |
| 387 | annotation_flags: "mybootclasspathfragment/annotation-flags.csv", |
| 388 | metadata: "mybootclasspathfragment/metadata.csv", |
| 389 | index: "mybootclasspathfragment/index.csv", |
| 390 | stub_flags: "mybootclasspathfragment/stub-flags.csv", |
| 391 | all_flags: "mybootclasspathfragment/all-flags.csv", |
| 392 | }, |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 393 | } |
| 394 | `, contentsInsert(contents), prefer) |
| 395 | return android.FixtureAddTextFile("prebuilts/module_sdk/art/Android.bp", text) |
| 396 | } |
| 397 | |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 398 | t.Run("boot image files from source", func(t *testing.T) { |
| 399 | result := android.GroupFixturePreparers( |
| 400 | commonPreparer, |
| 401 | |
| 402 | // Configure some libraries in the art bootclasspath_fragment that match the source |
| 403 | // bootclasspath_fragment's contents property. |
| 404 | java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"), |
| 405 | addSource("foo", "bar"), |
| 406 | ).RunTest(t) |
| 407 | |
| 408 | ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{ |
| 409 | "etc/classpaths/bootclasspath.pb", |
| 410 | "javalib/arm/boot.art", |
| 411 | "javalib/arm/boot.oat", |
| 412 | "javalib/arm/boot.vdex", |
| 413 | "javalib/arm/boot-bar.art", |
| 414 | "javalib/arm/boot-bar.oat", |
| 415 | "javalib/arm/boot-bar.vdex", |
| 416 | "javalib/arm64/boot.art", |
| 417 | "javalib/arm64/boot.oat", |
| 418 | "javalib/arm64/boot.vdex", |
| 419 | "javalib/arm64/boot-bar.art", |
| 420 | "javalib/arm64/boot-bar.oat", |
| 421 | "javalib/arm64/boot-bar.vdex", |
| 422 | "javalib/bar.jar", |
| 423 | "javalib/foo.jar", |
| 424 | }) |
| 425 | |
| 426 | java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{ |
| 427 | `bar`, |
| 428 | `com.android.art.key`, |
| 429 | `mybootclasspathfragment`, |
| 430 | }) |
| 431 | |
| 432 | // Make sure that the source bootclasspath_fragment copies its dex files to the predefined |
| 433 | // locations for the art image. |
| 434 | module := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000") |
| 435 | checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo") |
| 436 | }) |
| 437 | |
| 438 | t.Run("boot image files with preferred prebuilt", func(t *testing.T) { |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 439 | result := android.GroupFixturePreparers( |
| 440 | commonPreparer, |
| 441 | |
| 442 | // Configure some libraries in the art bootclasspath_fragment that match the source |
| 443 | // bootclasspath_fragment's contents property. |
| 444 | java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"), |
| 445 | addSource("foo", "bar"), |
| 446 | |
| 447 | // Make sure that a preferred prebuilt with consistent contents doesn't affect the apex. |
| 448 | addPrebuilt(true, "foo", "bar"), |
| 449 | ).RunTest(t) |
| 450 | |
| 451 | ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{ |
satayev | 227e745 | 2021-05-20 21:35:06 +0100 | [diff] [blame] | 452 | "etc/classpaths/bootclasspath.pb", |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 453 | "javalib/arm/boot.art", |
| 454 | "javalib/arm/boot.oat", |
| 455 | "javalib/arm/boot.vdex", |
| 456 | "javalib/arm/boot-bar.art", |
| 457 | "javalib/arm/boot-bar.oat", |
| 458 | "javalib/arm/boot-bar.vdex", |
| 459 | "javalib/arm64/boot.art", |
| 460 | "javalib/arm64/boot.oat", |
| 461 | "javalib/arm64/boot.vdex", |
| 462 | "javalib/arm64/boot-bar.art", |
| 463 | "javalib/arm64/boot-bar.oat", |
| 464 | "javalib/arm64/boot-bar.vdex", |
| 465 | "javalib/bar.jar", |
| 466 | "javalib/foo.jar", |
| 467 | }) |
| 468 | |
| 469 | java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{ |
| 470 | `bar`, |
| 471 | `com.android.art.key`, |
| 472 | `mybootclasspathfragment`, |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 473 | `prebuilt_com.android.art`, |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 474 | }) |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 475 | |
| 476 | // Make sure that the prebuilt bootclasspath_fragment copies its dex files to the predefined |
| 477 | // locations for the art image. |
| 478 | module := result.ModuleForTests("prebuilt_mybootclasspathfragment", "android_common_com.android.art") |
| 479 | checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo") |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 480 | }) |
Paul Duffin | 396229f | 2021-03-18 18:30:31 +0000 | [diff] [blame] | 481 | |
Paul Duffin | ba6afd0 | 2019-11-19 19:44:10 +0000 | [diff] [blame] | 482 | t.Run("source with inconsistency between config and contents", func(t *testing.T) { |
| 483 | android.GroupFixturePreparers( |
| 484 | commonPreparer, |
| 485 | |
| 486 | // Create an inconsistency between the ArtApexJars configuration and the art source |
| 487 | // bootclasspath_fragment module's contents property. |
| 488 | java.FixtureConfigureBootJars("com.android.art:foo"), |
| 489 | addSource("foo", "bar"), |
| 490 | ). |
| 491 | ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(`\QArtApexJars configuration specifies []string{"foo"}, contents property specifies []string{"foo", "bar"}\E`)). |
| 492 | RunTest(t) |
| 493 | }) |
| 494 | |
| 495 | t.Run("prebuilt with inconsistency between config and contents", func(t *testing.T) { |
| 496 | android.GroupFixturePreparers( |
| 497 | commonPreparer, |
| 498 | |
| 499 | // Create an inconsistency between the ArtApexJars configuration and the art |
| 500 | // prebuilt_bootclasspath_fragment module's contents property. |
| 501 | java.FixtureConfigureBootJars("com.android.art:foo"), |
| 502 | addPrebuilt(false, "foo", "bar"), |
| 503 | ). |
| 504 | ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(`\QArtApexJars configuration specifies []string{"foo"}, contents property specifies []string{"foo", "bar"}\E`)). |
| 505 | RunTest(t) |
| 506 | }) |
| 507 | |
| 508 | t.Run("preferred prebuilt with inconsistency between config and contents", func(t *testing.T) { |
| 509 | android.GroupFixturePreparers( |
| 510 | commonPreparer, |
| 511 | |
| 512 | // Create an inconsistency between the ArtApexJars configuration and the art |
| 513 | // prebuilt_bootclasspath_fragment module's contents property. |
| 514 | java.FixtureConfigureBootJars("com.android.art:foo"), |
| 515 | addPrebuilt(true, "foo", "bar"), |
| 516 | |
| 517 | // Source contents property is consistent with the config. |
| 518 | addSource("foo"), |
| 519 | ). |
| 520 | ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(`\QArtApexJars configuration specifies []string{"foo"}, contents property specifies []string{"foo", "bar"}\E`)). |
| 521 | RunTest(t) |
| 522 | }) |
| 523 | |
| 524 | t.Run("source preferred and prebuilt with inconsistency between config and contents", func(t *testing.T) { |
| 525 | android.GroupFixturePreparers( |
| 526 | commonPreparer, |
| 527 | |
| 528 | // Create an inconsistency between the ArtApexJars configuration and the art |
| 529 | // prebuilt_bootclasspath_fragment module's contents property. |
| 530 | java.FixtureConfigureBootJars("com.android.art:foo"), |
| 531 | addPrebuilt(false, "foo", "bar"), |
| 532 | |
| 533 | // Source contents property is consistent with the config. |
| 534 | addSource("foo"), |
| 535 | |
| 536 | // This should pass because while the prebuilt is inconsistent with the configuration it is |
| 537 | // not actually used. |
| 538 | ).RunTest(t) |
Paul Duffin | 396229f | 2021-03-18 18:30:31 +0000 | [diff] [blame] | 539 | }) |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 540 | } |
| 541 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 542 | func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) { |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 543 | result := android.GroupFixturePreparers( |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 544 | prepareForTestWithBootclasspathFragment, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 545 | prepareForTestWithArtApex, |
| 546 | |
| 547 | android.FixtureMergeMockFs(android.MockFS{ |
| 548 | "com.android.art-arm64.apex": nil, |
| 549 | "com.android.art-arm.apex": nil, |
| 550 | }), |
| 551 | |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 552 | // Configure some libraries in the art bootclasspath_fragment. |
Paul Duffin | 60264a0 | 2021-04-12 20:02:36 +0100 | [diff] [blame] | 553 | java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"), |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 554 | ).RunTestWithBp(t, ` |
| 555 | prebuilt_apex { |
| 556 | name: "com.android.art", |
| 557 | arch: { |
| 558 | arm64: { |
| 559 | src: "com.android.art-arm64.apex", |
| 560 | }, |
| 561 | arm: { |
| 562 | src: "com.android.art-arm.apex", |
| 563 | }, |
| 564 | }, |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 565 | exported_bootclasspath_fragments: ["mybootclasspathfragment"], |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | java_import { |
| 569 | name: "foo", |
| 570 | jars: ["foo.jar"], |
| 571 | apex_available: [ |
| 572 | "com.android.art", |
| 573 | ], |
| 574 | } |
| 575 | |
| 576 | java_import { |
| 577 | name: "bar", |
| 578 | jars: ["bar.jar"], |
| 579 | apex_available: [ |
| 580 | "com.android.art", |
| 581 | ], |
| 582 | } |
| 583 | |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 584 | prebuilt_bootclasspath_fragment { |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 585 | name: "mybootclasspathfragment", |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 586 | image_name: "art", |
Paul Duffin | f23bc47 | 2021-04-27 12:42:20 +0100 | [diff] [blame] | 587 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 588 | contents: ["foo", "bar"], |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 589 | apex_available: [ |
| 590 | "com.android.art", |
| 591 | ], |
Paul Duffin | 54e4197 | 2021-07-19 13:23:40 +0100 | [diff] [blame^] | 592 | hidden_api: { |
| 593 | annotation_flags: "mybootclasspathfragment/annotation-flags.csv", |
| 594 | metadata: "mybootclasspathfragment/metadata.csv", |
| 595 | index: "mybootclasspathfragment/index.csv", |
| 596 | stub_flags: "mybootclasspathfragment/stub-flags.csv", |
| 597 | all_flags: "mybootclasspathfragment/all-flags.csv", |
| 598 | }, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 599 | } |
| 600 | `) |
| 601 | |
Paul Duffin | 6717d88 | 2021-06-15 19:09:41 +0100 | [diff] [blame] | 602 | java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art", []string{ |
Paul Duffin | 11216db | 2021-03-01 14:14:52 +0000 | [diff] [blame] | 603 | `com.android.art.apex.selector`, |
Paul Duffin | e521881 | 2021-06-07 13:28:19 +0100 | [diff] [blame] | 604 | `prebuilt_mybootclasspathfragment`, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 605 | }) |
| 606 | |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 607 | java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_com.android.art", []string{ |
Paul Duffin | 5466a36 | 2021-06-07 10:25:31 +0100 | [diff] [blame] | 608 | `com.android.art.deapexer`, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 609 | `dex2oatd`, |
Paul Duffin | c7ef989 | 2021-03-23 23:21:59 +0000 | [diff] [blame] | 610 | `prebuilt_bar`, |
| 611 | `prebuilt_foo`, |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 612 | }) |
Paul Duffin | ce918b0 | 2021-06-07 14:33:47 +0100 | [diff] [blame] | 613 | |
| 614 | module := result.ModuleForTests("mybootclasspathfragment", "android_common_com.android.art") |
| 615 | checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo") |
| 616 | } |
| 617 | |
| 618 | // checkCopiesToPredefinedLocationForArt checks that the supplied modules are copied to the |
| 619 | // predefined locations of boot dex jars used as inputs for the ART boot image. |
| 620 | func checkCopiesToPredefinedLocationForArt(t *testing.T, config android.Config, module android.TestingModule, modules ...string) { |
| 621 | t.Helper() |
| 622 | bootJarLocations := []string{} |
| 623 | for _, output := range module.AllOutputs() { |
| 624 | output = android.StringRelativeToTop(config, output) |
| 625 | if strings.HasPrefix(output, "out/soong/test_device/dex_artjars_input/") { |
| 626 | bootJarLocations = append(bootJarLocations, output) |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | sort.Strings(bootJarLocations) |
| 631 | expected := []string{} |
| 632 | for _, m := range modules { |
| 633 | expected = append(expected, fmt.Sprintf("out/soong/test_device/dex_artjars_input/%s.jar", m)) |
| 634 | } |
| 635 | sort.Strings(expected) |
| 636 | |
| 637 | android.AssertArrayString(t, "copies to predefined locations for art", expected, bootJarLocations) |
Paul Duffin | 9ea71c0 | 2021-03-23 22:53:07 +0000 | [diff] [blame] | 638 | } |
| 639 | |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 640 | func TestBootclasspathFragmentContentsNoName(t *testing.T) { |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 641 | result := android.GroupFixturePreparers( |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 642 | prepareForTestWithBootclasspathFragment, |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 643 | prepareForTestWithMyapex, |
Paul Duffin | f2fa0b5 | 2021-05-14 18:21:45 +0100 | [diff] [blame] | 644 | // Configure bootclasspath jars to ensure that hidden API encoding is performed on them. |
| 645 | java.FixtureConfigureBootJars("myapex:foo", "myapex:bar"), |
| 646 | // Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding |
| 647 | // is disabled. |
| 648 | android.FixtureAddTextFile("frameworks/base/Android.bp", ""), |
| 649 | |
| 650 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 651 | java.FixtureWithLastReleaseApis("foo"), |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 652 | ).RunTestWithBp(t, ` |
| 653 | apex { |
| 654 | name: "myapex", |
| 655 | key: "myapex.key", |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 656 | bootclasspath_fragments: [ |
| 657 | "mybootclasspathfragment", |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 658 | ], |
| 659 | updatable: false, |
| 660 | } |
| 661 | |
| 662 | apex_key { |
| 663 | name: "myapex.key", |
| 664 | public_key: "testkey.avbpubkey", |
| 665 | private_key: "testkey.pem", |
| 666 | } |
| 667 | |
Paul Duffin | f2fa0b5 | 2021-05-14 18:21:45 +0100 | [diff] [blame] | 668 | java_sdk_library { |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 669 | name: "foo", |
| 670 | srcs: ["b.java"], |
Paul Duffin | f2fa0b5 | 2021-05-14 18:21:45 +0100 | [diff] [blame] | 671 | shared_library: false, |
| 672 | public: {enabled: true}, |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 673 | apex_available: [ |
| 674 | "myapex", |
| 675 | ], |
| 676 | } |
| 677 | |
| 678 | java_library { |
| 679 | name: "bar", |
| 680 | srcs: ["b.java"], |
| 681 | installable: true, |
| 682 | apex_available: [ |
| 683 | "myapex", |
| 684 | ], |
| 685 | } |
| 686 | |
Paul Duffin | 7771eba | 2021-04-23 14:25:28 +0100 | [diff] [blame] | 687 | bootclasspath_fragment { |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 688 | name: "mybootclasspathfragment", |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 689 | contents: [ |
| 690 | "foo", |
| 691 | "bar", |
| 692 | ], |
| 693 | apex_available: [ |
| 694 | "myapex", |
| 695 | ], |
| 696 | } |
| 697 | `) |
| 698 | |
Paul Duffin | 4d101b6 | 2021-03-24 15:42:20 +0000 | [diff] [blame] | 699 | ensureExactContents(t, result.TestContext, "myapex", "android_common_myapex_image", []string{ |
| 700 | // This does not include art, oat or vdex files as they are only included for the art boot |
| 701 | // image. |
satayev | 227e745 | 2021-05-20 21:35:06 +0100 | [diff] [blame] | 702 | "etc/classpaths/bootclasspath.pb", |
Paul Duffin | 4d101b6 | 2021-03-24 15:42:20 +0000 | [diff] [blame] | 703 | "javalib/bar.jar", |
| 704 | "javalib/foo.jar", |
| 705 | }) |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 706 | |
| 707 | java.CheckModuleDependencies(t, result.TestContext, "myapex", "android_common_myapex_image", []string{ |
| 708 | `myapex.key`, |
Paul Duffin | 94f1963 | 2021-04-20 12:40:07 +0100 | [diff] [blame] | 709 | `mybootclasspathfragment`, |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 710 | }) |
Paul Duffin | f2fa0b5 | 2021-05-14 18:21:45 +0100 | [diff] [blame] | 711 | |
| 712 | apex := result.ModuleForTests("myapex", "android_common_myapex_image") |
| 713 | apexRule := apex.Rule("apexRule") |
| 714 | copyCommands := apexRule.Args["copy_commands"] |
| 715 | |
| 716 | // Make sure that the fragment provides the hidden API encoded dex jars to the APEX. |
| 717 | fragment := result.Module("mybootclasspathfragment", "android_common_apex10000") |
| 718 | |
| 719 | info := result.ModuleProvider(fragment, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo) |
| 720 | |
| 721 | checkFragmentExportedDexJar := func(name string, expectedDexJar string) { |
| 722 | module := result.Module(name, "android_common_apex10000") |
Paul Duffin | 1a8010a | 2021-05-15 12:39:23 +0100 | [diff] [blame] | 723 | dexJar, err := info.DexBootJarPathForContentModule(module) |
| 724 | if err != nil { |
| 725 | t.Error(err) |
| 726 | } |
Paul Duffin | f2fa0b5 | 2021-05-14 18:21:45 +0100 | [diff] [blame] | 727 | android.AssertPathRelativeToTopEquals(t, name+" dex", expectedDexJar, dexJar) |
| 728 | |
| 729 | expectedCopyCommand := fmt.Sprintf("&& cp -f %s out/soong/.intermediates/myapex/android_common_myapex_image/image.apex/javalib/%s.jar", expectedDexJar, name) |
| 730 | android.AssertStringDoesContain(t, name+" apex copy command", copyCommands, expectedCopyCommand) |
| 731 | } |
| 732 | |
Paul Duffin | 54c98f5 | 2021-05-15 08:54:30 +0100 | [diff] [blame] | 733 | checkFragmentExportedDexJar("foo", "out/soong/.intermediates/mybootclasspathfragment/android_common_apex10000/hiddenapi-modular/encoded/foo.jar") |
| 734 | checkFragmentExportedDexJar("bar", "out/soong/.intermediates/mybootclasspathfragment/android_common_apex10000/hiddenapi-modular/encoded/bar.jar") |
Paul Duffin | 82886d6 | 2021-03-24 01:34:57 +0000 | [diff] [blame] | 735 | } |
| 736 | |
Paul Duffin | 48b6741 | 2021-06-23 16:13:50 +0100 | [diff] [blame] | 737 | func getDexJarPath(result *android.TestResult, name string) string { |
| 738 | module := result.Module(name, "android_common") |
| 739 | return module.(java.UsesLibraryDependency).DexJarBuildPath().RelativeToTop().String() |
| 740 | } |
| 741 | |
| 742 | // TestBootclasspathFragment_HiddenAPIList checks to make sure that the correct parameters are |
| 743 | // passed to the hiddenapi list tool. |
| 744 | func TestBootclasspathFragment_HiddenAPIList(t *testing.T) { |
| 745 | result := android.GroupFixturePreparers( |
| 746 | prepareForTestWithBootclasspathFragment, |
| 747 | prepareForTestWithArtApex, |
| 748 | prepareForTestWithMyapex, |
| 749 | // Configure bootclasspath jars to ensure that hidden API encoding is performed on them. |
| 750 | java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"), |
| 751 | java.FixtureConfigureUpdatableBootJars("myapex:foo", "myapex:bar"), |
| 752 | // Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding |
| 753 | // is disabled. |
| 754 | android.FixtureAddTextFile("frameworks/base/Android.bp", ""), |
| 755 | |
| 756 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 757 | java.FixtureWithLastReleaseApis("foo", "quuz"), |
| 758 | ).RunTestWithBp(t, ` |
| 759 | apex { |
| 760 | name: "com.android.art", |
| 761 | key: "com.android.art.key", |
| 762 | bootclasspath_fragments: ["art-bootclasspath-fragment"], |
| 763 | updatable: false, |
| 764 | } |
| 765 | |
| 766 | apex_key { |
| 767 | name: "com.android.art.key", |
| 768 | public_key: "com.android.art.avbpubkey", |
| 769 | private_key: "com.android.art.pem", |
| 770 | } |
| 771 | |
| 772 | java_library { |
| 773 | name: "baz", |
| 774 | apex_available: [ |
| 775 | "com.android.art", |
| 776 | ], |
| 777 | srcs: ["b.java"], |
| 778 | compile_dex: true, |
| 779 | } |
| 780 | |
| 781 | java_sdk_library { |
| 782 | name: "quuz", |
| 783 | apex_available: [ |
| 784 | "com.android.art", |
| 785 | ], |
| 786 | srcs: ["b.java"], |
| 787 | compile_dex: true, |
| 788 | public: {enabled: true}, |
| 789 | system: {enabled: true}, |
| 790 | test: {enabled: true}, |
| 791 | module_lib: {enabled: true}, |
| 792 | } |
| 793 | |
| 794 | bootclasspath_fragment { |
| 795 | name: "art-bootclasspath-fragment", |
| 796 | image_name: "art", |
| 797 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 798 | contents: ["baz", "quuz"], |
| 799 | apex_available: [ |
| 800 | "com.android.art", |
| 801 | ], |
| 802 | } |
| 803 | |
| 804 | apex { |
| 805 | name: "myapex", |
| 806 | key: "myapex.key", |
| 807 | bootclasspath_fragments: [ |
| 808 | "mybootclasspathfragment", |
| 809 | ], |
| 810 | updatable: false, |
| 811 | } |
| 812 | |
| 813 | apex_key { |
| 814 | name: "myapex.key", |
| 815 | public_key: "testkey.avbpubkey", |
| 816 | private_key: "testkey.pem", |
| 817 | } |
| 818 | |
| 819 | java_sdk_library { |
| 820 | name: "foo", |
| 821 | srcs: ["b.java"], |
| 822 | shared_library: false, |
| 823 | public: {enabled: true}, |
| 824 | apex_available: [ |
| 825 | "myapex", |
| 826 | ], |
| 827 | } |
| 828 | |
| 829 | java_library { |
| 830 | name: "bar", |
| 831 | srcs: ["b.java"], |
| 832 | installable: true, |
| 833 | apex_available: [ |
| 834 | "myapex", |
| 835 | ], |
| 836 | } |
| 837 | |
| 838 | bootclasspath_fragment { |
| 839 | name: "mybootclasspathfragment", |
| 840 | contents: [ |
| 841 | "foo", |
| 842 | "bar", |
| 843 | ], |
| 844 | apex_available: [ |
| 845 | "myapex", |
| 846 | ], |
| 847 | fragments: [ |
| 848 | { |
| 849 | apex: "com.android.art", |
| 850 | module: "art-bootclasspath-fragment", |
| 851 | }, |
| 852 | ], |
| 853 | } |
| 854 | `) |
| 855 | |
| 856 | java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{ |
| 857 | "art-bootclasspath-fragment", |
| 858 | "bar", |
| 859 | "dex2oatd", |
| 860 | "foo", |
| 861 | }) |
| 862 | |
| 863 | fooStubs := getDexJarPath(result, "foo.stubs") |
| 864 | quuzPublicStubs := getDexJarPath(result, "quuz.stubs") |
| 865 | quuzSystemStubs := getDexJarPath(result, "quuz.stubs.system") |
| 866 | quuzTestStubs := getDexJarPath(result, "quuz.stubs.test") |
Paul Duffin | b51db2e | 2021-06-21 14:08:08 +0100 | [diff] [blame] | 867 | quuzModuleLibStubs := getDexJarPath(result, "quuz.stubs.module_lib") |
Paul Duffin | 48b6741 | 2021-06-23 16:13:50 +0100 | [diff] [blame] | 868 | |
| 869 | // Make sure that the fragment uses the quuz stub dex jars when generating the hidden API flags. |
| 870 | fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000") |
| 871 | |
| 872 | rule := fragment.Rule("modularHiddenAPIStubFlagsFile") |
| 873 | command := rule.RuleParams.Command |
| 874 | android.AssertStringDoesContain(t, "check correct rule", command, "hiddenapi list") |
| 875 | |
| 876 | // Make sure that the quuz stubs are available for resolving references from the implementation |
| 877 | // boot dex jars provided by this module. |
Paul Duffin | b51db2e | 2021-06-21 14:08:08 +0100 | [diff] [blame] | 878 | android.AssertStringDoesContain(t, "quuz widest", command, "--dependency-stub-dex="+quuzModuleLibStubs) |
Paul Duffin | 48b6741 | 2021-06-23 16:13:50 +0100 | [diff] [blame] | 879 | |
| 880 | // Make sure that the quuz stubs are available for resolving references from the different API |
| 881 | // stubs provided by this module. |
| 882 | android.AssertStringDoesContain(t, "public", command, "--public-stub-classpath="+quuzPublicStubs+":"+fooStubs) |
| 883 | android.AssertStringDoesContain(t, "system", command, "--system-stub-classpath="+quuzSystemStubs+":"+fooStubs) |
| 884 | android.AssertStringDoesContain(t, "test", command, "--test-stub-classpath="+quuzTestStubs+":"+fooStubs) |
| 885 | } |
| 886 | |
Paul Duffin | 5cca7c4 | 2021-05-26 10:16:01 +0100 | [diff] [blame] | 887 | // TestBootclasspathFragment_AndroidNonUpdatable checks to make sure that setting |
| 888 | // additional_stubs: ["android-non-updatable"] causes the source android-non-updatable modules to be |
| 889 | // added to the hiddenapi list tool. |
| 890 | func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) { |
| 891 | result := android.GroupFixturePreparers( |
| 892 | prepareForTestWithBootclasspathFragment, |
| 893 | prepareForTestWithArtApex, |
| 894 | prepareForTestWithMyapex, |
| 895 | // Configure bootclasspath jars to ensure that hidden API encoding is performed on them. |
| 896 | java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "myapex:foo", "myapex:bar"), |
| 897 | // Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding |
| 898 | // is disabled. |
| 899 | android.FixtureAddTextFile("frameworks/base/Android.bp", ""), |
| 900 | |
| 901 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 902 | java.FixtureWithLastReleaseApis("foo", "android-non-updatable"), |
| 903 | ).RunTestWithBp(t, ` |
| 904 | java_sdk_library { |
| 905 | name: "android-non-updatable", |
| 906 | srcs: ["b.java"], |
| 907 | compile_dex: true, |
| 908 | public: { |
| 909 | enabled: true, |
| 910 | }, |
| 911 | system: { |
| 912 | enabled: true, |
| 913 | }, |
| 914 | test: { |
| 915 | enabled: true, |
| 916 | }, |
| 917 | module_lib: { |
| 918 | enabled: true, |
| 919 | }, |
| 920 | } |
| 921 | |
| 922 | apex { |
| 923 | name: "com.android.art", |
| 924 | key: "com.android.art.key", |
| 925 | bootclasspath_fragments: ["art-bootclasspath-fragment"], |
| 926 | java_libs: [ |
| 927 | "baz", |
| 928 | "quuz", |
| 929 | ], |
| 930 | updatable: false, |
| 931 | } |
| 932 | |
| 933 | apex_key { |
| 934 | name: "com.android.art.key", |
| 935 | public_key: "com.android.art.avbpubkey", |
| 936 | private_key: "com.android.art.pem", |
| 937 | } |
| 938 | |
| 939 | java_library { |
| 940 | name: "baz", |
| 941 | apex_available: [ |
| 942 | "com.android.art", |
| 943 | ], |
| 944 | srcs: ["b.java"], |
| 945 | compile_dex: true, |
| 946 | } |
| 947 | |
| 948 | java_library { |
| 949 | name: "quuz", |
| 950 | apex_available: [ |
| 951 | "com.android.art", |
| 952 | ], |
| 953 | srcs: ["b.java"], |
| 954 | compile_dex: true, |
| 955 | } |
| 956 | |
| 957 | bootclasspath_fragment { |
| 958 | name: "art-bootclasspath-fragment", |
| 959 | image_name: "art", |
| 960 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 961 | contents: ["baz", "quuz"], |
| 962 | apex_available: [ |
| 963 | "com.android.art", |
| 964 | ], |
| 965 | } |
| 966 | |
| 967 | apex { |
| 968 | name: "myapex", |
| 969 | key: "myapex.key", |
| 970 | bootclasspath_fragments: [ |
| 971 | "mybootclasspathfragment", |
| 972 | ], |
| 973 | updatable: false, |
| 974 | } |
| 975 | |
| 976 | apex_key { |
| 977 | name: "myapex.key", |
| 978 | public_key: "testkey.avbpubkey", |
| 979 | private_key: "testkey.pem", |
| 980 | } |
| 981 | |
| 982 | java_sdk_library { |
| 983 | name: "foo", |
| 984 | srcs: ["b.java"], |
| 985 | shared_library: false, |
| 986 | public: {enabled: true}, |
| 987 | apex_available: [ |
| 988 | "myapex", |
| 989 | ], |
| 990 | } |
| 991 | |
| 992 | java_library { |
| 993 | name: "bar", |
| 994 | srcs: ["b.java"], |
| 995 | installable: true, |
| 996 | apex_available: [ |
| 997 | "myapex", |
| 998 | ], |
| 999 | } |
| 1000 | |
| 1001 | bootclasspath_fragment { |
| 1002 | name: "mybootclasspathfragment", |
| 1003 | contents: [ |
| 1004 | "foo", |
| 1005 | "bar", |
| 1006 | ], |
| 1007 | apex_available: [ |
| 1008 | "myapex", |
| 1009 | ], |
| 1010 | additional_stubs: ["android-non-updatable"], |
| 1011 | fragments: [ |
| 1012 | { |
| 1013 | apex: "com.android.art", |
| 1014 | module: "art-bootclasspath-fragment", |
| 1015 | }, |
| 1016 | ], |
| 1017 | } |
| 1018 | `) |
| 1019 | |
| 1020 | java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{ |
| 1021 | "android-non-updatable.stubs", |
| 1022 | "android-non-updatable.stubs.module_lib", |
| 1023 | "android-non-updatable.stubs.system", |
| 1024 | "android-non-updatable.stubs.test", |
| 1025 | "art-bootclasspath-fragment", |
| 1026 | "bar", |
| 1027 | "dex2oatd", |
| 1028 | "foo", |
| 1029 | }) |
| 1030 | |
| 1031 | nonUpdatablePublicStubs := getDexJarPath(result, "android-non-updatable.stubs") |
| 1032 | nonUpdatableSystemStubs := getDexJarPath(result, "android-non-updatable.stubs.system") |
| 1033 | nonUpdatableTestStubs := getDexJarPath(result, "android-non-updatable.stubs.test") |
| 1034 | nonUpdatableModuleLibStubs := getDexJarPath(result, "android-non-updatable.stubs.module_lib") |
| 1035 | |
| 1036 | // Make sure that the fragment uses the android-non-updatable modules when generating the hidden |
| 1037 | // API flags. |
| 1038 | fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000") |
| 1039 | |
| 1040 | rule := fragment.Rule("modularHiddenAPIStubFlagsFile") |
| 1041 | command := rule.RuleParams.Command |
| 1042 | android.AssertStringDoesContain(t, "check correct rule", command, "hiddenapi list") |
| 1043 | |
| 1044 | // Make sure that the module_lib non-updatable stubs are available for resolving references from |
| 1045 | // the implementation boot dex jars provided by this module. |
| 1046 | android.AssertStringDoesContain(t, "android-non-updatable widest", command, "--dependency-stub-dex="+nonUpdatableModuleLibStubs) |
| 1047 | |
| 1048 | // Make sure that the appropriate non-updatable stubs are available for resolving references from |
| 1049 | // the different API stubs provided by this module. |
| 1050 | android.AssertStringDoesContain(t, "public", command, "--public-stub-classpath="+nonUpdatablePublicStubs) |
| 1051 | android.AssertStringDoesContain(t, "system", command, "--system-stub-classpath="+nonUpdatableSystemStubs) |
| 1052 | android.AssertStringDoesContain(t, "test", command, "--test-stub-classpath="+nonUpdatableTestStubs) |
| 1053 | } |
| 1054 | |
| 1055 | // TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks checks to make sure that |
| 1056 | // setting additional_stubs: ["android-non-updatable"] causes the prebuilt android-non-updatable |
| 1057 | // modules to be added to the hiddenapi list tool. |
| 1058 | func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *testing.T) { |
| 1059 | result := android.GroupFixturePreparers( |
| 1060 | prepareForTestWithBootclasspathFragment, |
| 1061 | java.PrepareForTestWithJavaDefaultModules, |
| 1062 | prepareForTestWithArtApex, |
| 1063 | prepareForTestWithMyapex, |
| 1064 | // Configure bootclasspath jars to ensure that hidden API encoding is performed on them. |
| 1065 | java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz", "myapex:foo", "myapex:bar"), |
| 1066 | // Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding |
| 1067 | // is disabled. |
| 1068 | android.FixtureAddTextFile("frameworks/base/Android.bp", ""), |
| 1069 | |
| 1070 | android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { |
| 1071 | variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true) |
| 1072 | }), |
| 1073 | |
| 1074 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 1075 | java.FixtureWithPrebuiltApis(map[string][]string{ |
| 1076 | "current": {"android-non-updatable"}, |
| 1077 | "30": {"foo"}, |
| 1078 | }), |
| 1079 | ).RunTestWithBp(t, ` |
| 1080 | apex { |
| 1081 | name: "com.android.art", |
| 1082 | key: "com.android.art.key", |
| 1083 | bootclasspath_fragments: ["art-bootclasspath-fragment"], |
| 1084 | java_libs: [ |
| 1085 | "baz", |
| 1086 | "quuz", |
| 1087 | ], |
| 1088 | updatable: false, |
| 1089 | } |
| 1090 | |
| 1091 | apex_key { |
| 1092 | name: "com.android.art.key", |
| 1093 | public_key: "com.android.art.avbpubkey", |
| 1094 | private_key: "com.android.art.pem", |
| 1095 | } |
| 1096 | |
| 1097 | java_library { |
| 1098 | name: "baz", |
| 1099 | apex_available: [ |
| 1100 | "com.android.art", |
| 1101 | ], |
| 1102 | srcs: ["b.java"], |
| 1103 | compile_dex: true, |
| 1104 | } |
| 1105 | |
| 1106 | java_library { |
| 1107 | name: "quuz", |
| 1108 | apex_available: [ |
| 1109 | "com.android.art", |
| 1110 | ], |
| 1111 | srcs: ["b.java"], |
| 1112 | compile_dex: true, |
| 1113 | } |
| 1114 | |
| 1115 | bootclasspath_fragment { |
| 1116 | name: "art-bootclasspath-fragment", |
| 1117 | image_name: "art", |
| 1118 | // Must match the "com.android.art:" entries passed to FixtureConfigureBootJars above. |
| 1119 | contents: ["baz", "quuz"], |
| 1120 | apex_available: [ |
| 1121 | "com.android.art", |
| 1122 | ], |
| 1123 | } |
| 1124 | |
| 1125 | apex { |
| 1126 | name: "myapex", |
| 1127 | key: "myapex.key", |
| 1128 | bootclasspath_fragments: [ |
| 1129 | "mybootclasspathfragment", |
| 1130 | ], |
| 1131 | updatable: false, |
| 1132 | } |
| 1133 | |
| 1134 | apex_key { |
| 1135 | name: "myapex.key", |
| 1136 | public_key: "testkey.avbpubkey", |
| 1137 | private_key: "testkey.pem", |
| 1138 | } |
| 1139 | |
| 1140 | java_sdk_library { |
| 1141 | name: "foo", |
| 1142 | srcs: ["b.java"], |
| 1143 | shared_library: false, |
| 1144 | public: {enabled: true}, |
| 1145 | apex_available: [ |
| 1146 | "myapex", |
| 1147 | ], |
| 1148 | } |
| 1149 | |
| 1150 | java_library { |
| 1151 | name: "bar", |
| 1152 | srcs: ["b.java"], |
| 1153 | installable: true, |
| 1154 | apex_available: [ |
| 1155 | "myapex", |
| 1156 | ], |
| 1157 | } |
| 1158 | |
| 1159 | bootclasspath_fragment { |
| 1160 | name: "mybootclasspathfragment", |
| 1161 | contents: [ |
| 1162 | "foo", |
| 1163 | "bar", |
| 1164 | ], |
| 1165 | apex_available: [ |
| 1166 | "myapex", |
| 1167 | ], |
| 1168 | additional_stubs: ["android-non-updatable"], |
| 1169 | fragments: [ |
| 1170 | { |
| 1171 | apex: "com.android.art", |
| 1172 | module: "art-bootclasspath-fragment", |
| 1173 | }, |
| 1174 | ], |
| 1175 | } |
| 1176 | `) |
| 1177 | |
| 1178 | java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{ |
| 1179 | "art-bootclasspath-fragment", |
| 1180 | "bar", |
| 1181 | "dex2oatd", |
| 1182 | "foo", |
| 1183 | "prebuilt_sdk_module-lib_current_android-non-updatable", |
| 1184 | "prebuilt_sdk_public_current_android-non-updatable", |
| 1185 | "prebuilt_sdk_system_current_android-non-updatable", |
| 1186 | "prebuilt_sdk_test_current_android-non-updatable", |
| 1187 | }) |
| 1188 | |
| 1189 | nonUpdatablePublicStubs := getDexJarPath(result, "sdk_public_current_android-non-updatable") |
| 1190 | nonUpdatableSystemStubs := getDexJarPath(result, "sdk_system_current_android-non-updatable") |
| 1191 | nonUpdatableTestStubs := getDexJarPath(result, "sdk_test_current_android-non-updatable") |
| 1192 | nonUpdatableModuleLibStubs := getDexJarPath(result, "sdk_module-lib_current_android-non-updatable") |
| 1193 | |
| 1194 | // Make sure that the fragment uses the android-non-updatable modules when generating the hidden |
| 1195 | // API flags. |
| 1196 | fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000") |
| 1197 | |
| 1198 | rule := fragment.Rule("modularHiddenAPIStubFlagsFile") |
| 1199 | command := rule.RuleParams.Command |
| 1200 | android.AssertStringDoesContain(t, "check correct rule", command, "hiddenapi list") |
| 1201 | |
| 1202 | // Make sure that the module_lib non-updatable stubs are available for resolving references from |
| 1203 | // the implementation boot dex jars provided by this module. |
| 1204 | android.AssertStringDoesContain(t, "android-non-updatable widest", command, "--dependency-stub-dex="+nonUpdatableModuleLibStubs) |
| 1205 | |
| 1206 | // Make sure that the appropriate non-updatable stubs are available for resolving references from |
| 1207 | // the different API stubs provided by this module. |
| 1208 | android.AssertStringDoesContain(t, "public", command, "--public-stub-classpath="+nonUpdatablePublicStubs) |
| 1209 | android.AssertStringDoesContain(t, "system", command, "--system-stub-classpath="+nonUpdatableSystemStubs) |
| 1210 | android.AssertStringDoesContain(t, "test", command, "--test-stub-classpath="+nonUpdatableTestStubs) |
| 1211 | } |
| 1212 | |
Paul Duffin | a1d6025 | 2021-01-21 18:13:43 +0000 | [diff] [blame] | 1213 | // TODO(b/177892522) - add test for host apex. |