Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | package sdk |
| 16 | |
| 17 | import ( |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 18 | "fmt" |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 19 | "testing" |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 20 | |
Paul Duffin | 4a2a29c | 2021-03-09 22:27:13 +0000 | [diff] [blame] | 21 | "android/soong/android" |
Jiakai Zhang | bc698cd | 2023-05-08 16:28:38 +0000 | [diff] [blame] | 22 | "android/soong/dexpreopt" |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 23 | "android/soong/java" |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 24 | ) |
| 25 | |
Paul Duffin | d14cbc1 | 2021-03-18 09:14:23 +0000 | [diff] [blame] | 26 | var prepareForSdkTestWithJava = android.GroupFixturePreparers( |
| 27 | java.PrepareForTestWithJavaBuildComponents, |
| 28 | PrepareForTestWithSdkBuildComponents, |
Jiakai Zhang | bc698cd | 2023-05-08 16:28:38 +0000 | [diff] [blame] | 29 | dexpreopt.PrepareForTestWithFakeDex2oatd, |
Paul Duffin | db462dd | 2021-03-21 22:01:55 +0000 | [diff] [blame] | 30 | |
| 31 | // Ensure that all source paths are provided. This helps ensure that the snapshot generation is |
| 32 | // consistent and all files referenced from the snapshot's Android.bp file have actually been |
| 33 | // copied into the snapshot. |
| 34 | android.PrepareForTestDisallowNonExistentPaths, |
| 35 | |
| 36 | // Files needs by most of the tests. |
| 37 | android.MockFS{ |
Jiakai Zhang | 9c4dc19 | 2023-02-09 00:09:24 +0800 | [diff] [blame] | 38 | "Test.java": nil, |
| 39 | "art-profile": nil, |
Paul Duffin | db462dd | 2021-03-21 22:01:55 +0000 | [diff] [blame] | 40 | }.AddToFixture(), |
Paul Duffin | d14cbc1 | 2021-03-18 09:14:23 +0000 | [diff] [blame] | 41 | ) |
| 42 | |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 43 | var prepareForSdkTestWithJavaSdkLibrary = android.GroupFixturePreparers( |
| 44 | prepareForSdkTestWithJava, |
| 45 | java.PrepareForTestWithJavaDefaultModules, |
| 46 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 47 | java.FixtureWithLastReleaseApis("myjavalib"), |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 48 | android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { |
| 49 | variables.BuildFlags = map[string]string{ |
| 50 | "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true", |
| 51 | } |
| 52 | }), |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 53 | ) |
| 54 | |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 55 | // Contains tests for SDK members provided by the java package. |
| 56 | |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 57 | func TestSdkDependsOnSourceEvenWhenPrebuiltPreferred(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 58 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 59 | sdk { |
| 60 | name: "mysdk", |
| 61 | java_header_libs: ["sdkmember"], |
| 62 | } |
| 63 | |
| 64 | java_library { |
| 65 | name: "sdkmember", |
| 66 | srcs: ["Test.java"], |
| 67 | system_modules: "none", |
| 68 | sdk_version: "none", |
| 69 | } |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 70 | `) |
| 71 | |
| 72 | // Make sure that the mysdk module depends on "sdkmember" and not "prebuilt_sdkmember". |
Paul Duffin | 1822a0a | 2021-03-21 12:56:33 +0000 | [diff] [blame] | 73 | sdkChecker := func(t *testing.T, result *android.TestResult) { |
| 74 | java.CheckModuleDependencies(t, result.TestContext, "mysdk", "android_common", []string{"sdkmember"}) |
| 75 | } |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 76 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 77 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | 1822a0a | 2021-03-21 12:56:33 +0000 | [diff] [blame] | 78 | snapshotTestChecker(checkSnapshotWithSourcePreferred, sdkChecker), |
| 79 | snapshotTestChecker(checkSnapshotPreferredWithSource, sdkChecker), |
| 80 | ) |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 81 | } |
| 82 | |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 83 | func TestSnapshotWithJavaHeaderLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 84 | result := android.GroupFixturePreparers( |
| 85 | prepareForSdkTestWithJava, |
| 86 | android.FixtureAddFile("aidl/foo/bar/Test.aidl", nil), |
| 87 | ).RunTestWithBp(t, ` |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 88 | sdk { |
| 89 | name: "mysdk", |
| 90 | java_header_libs: ["myjavalib"], |
| 91 | } |
| 92 | |
| 93 | java_library { |
| 94 | name: "myjavalib", |
| 95 | srcs: ["Test.java"], |
| 96 | aidl: { |
| 97 | export_include_dirs: ["aidl"], |
| 98 | }, |
| 99 | system_modules: "none", |
| 100 | sdk_version: "none", |
| 101 | compile_dex: true, |
| 102 | host_supported: true, |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 103 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 104 | } |
| 105 | `) |
| 106 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 107 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 108 | checkAndroidBpContents(` |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 109 | // This is auto-generated. DO NOT EDIT. |
| 110 | |
| 111 | java_import { |
| 112 | name: "myjavalib", |
| 113 | prefer: false, |
| 114 | visibility: ["//visibility:public"], |
| 115 | apex_available: ["//apex_available:platform"], |
| 116 | jars: ["java/myjavalib.jar"], |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 117 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 118 | } |
| 119 | `), |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 120 | checkAllCopyRules(` |
| 121 | .intermediates/myjavalib/android_common/turbine-combined/myjavalib.jar -> java/myjavalib.jar |
| 122 | aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl |
| 123 | `), |
| 124 | ) |
| 125 | } |
| 126 | |
| 127 | func TestHostSnapshotWithJavaHeaderLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 128 | result := android.GroupFixturePreparers( |
| 129 | prepareForSdkTestWithJava, |
| 130 | android.FixtureAddFile("aidl/foo/bar/Test.aidl", nil), |
| 131 | ).RunTestWithBp(t, ` |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 132 | sdk { |
| 133 | name: "mysdk", |
| 134 | device_supported: false, |
| 135 | host_supported: true, |
| 136 | java_header_libs: ["myjavalib"], |
| 137 | } |
| 138 | |
| 139 | java_library { |
| 140 | name: "myjavalib", |
| 141 | device_supported: false, |
| 142 | host_supported: true, |
| 143 | srcs: ["Test.java"], |
| 144 | aidl: { |
| 145 | export_include_dirs: ["aidl"], |
| 146 | }, |
| 147 | system_modules: "none", |
| 148 | sdk_version: "none", |
| 149 | compile_dex: true, |
| 150 | } |
| 151 | `) |
| 152 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 153 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 154 | checkAndroidBpContents(` |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 155 | // This is auto-generated. DO NOT EDIT. |
| 156 | |
| 157 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 158 | name: "myjavalib", |
| 159 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 160 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 161 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 162 | device_supported: false, |
| 163 | host_supported: true, |
| 164 | jars: ["java/myjavalib.jar"], |
| 165 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 166 | `), |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 167 | checkAllCopyRules(` |
Colin Cross | f06d8dc | 2023-07-18 22:11:07 -0700 | [diff] [blame] | 168 | .intermediates/myjavalib/linux_glibc_common/javac-header/myjavalib.jar -> java/myjavalib.jar |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 169 | aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl |
| 170 | `), |
| 171 | ) |
| 172 | } |
| 173 | |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 174 | func TestDeviceAndHostSnapshotWithJavaHeaderLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 175 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 176 | sdk { |
| 177 | name: "mysdk", |
| 178 | host_supported: true, |
| 179 | java_header_libs: ["myjavalib"], |
| 180 | } |
| 181 | |
| 182 | java_library { |
| 183 | name: "myjavalib", |
| 184 | host_supported: true, |
| 185 | srcs: ["Test.java"], |
| 186 | system_modules: "none", |
| 187 | sdk_version: "none", |
| 188 | compile_dex: true, |
| 189 | } |
| 190 | `) |
| 191 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 192 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 193 | checkAndroidBpContents(` |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 194 | // This is auto-generated. DO NOT EDIT. |
| 195 | |
| 196 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 197 | name: "myjavalib", |
| 198 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 199 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 200 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 201 | host_supported: true, |
| 202 | target: { |
| 203 | android: { |
| 204 | jars: ["java/android/myjavalib.jar"], |
| 205 | }, |
| 206 | linux_glibc: { |
| 207 | jars: ["java/linux_glibc/myjavalib.jar"], |
| 208 | }, |
| 209 | }, |
| 210 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 211 | `), |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 212 | checkAllCopyRules(` |
| 213 | .intermediates/myjavalib/android_common/turbine-combined/myjavalib.jar -> java/android/myjavalib.jar |
Colin Cross | f06d8dc | 2023-07-18 22:11:07 -0700 | [diff] [blame] | 214 | .intermediates/myjavalib/linux_glibc_common/javac-header/myjavalib.jar -> java/linux_glibc/myjavalib.jar |
Paul Duffin | a04c107 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 215 | `), |
| 216 | ) |
| 217 | } |
| 218 | |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 219 | func TestSnapshotWithJavaImplLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 220 | result := android.GroupFixturePreparers( |
| 221 | prepareForSdkTestWithJava, |
| 222 | android.FixtureAddFile("aidl/foo/bar/Test.aidl", nil), |
Paul Duffin | db462dd | 2021-03-21 22:01:55 +0000 | [diff] [blame] | 223 | android.FixtureAddFile("resource.txt", nil), |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 224 | ).RunTestWithBp(t, ` |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 225 | module_exports { |
| 226 | name: "myexports", |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 227 | java_libs: ["myjavalib"], |
| 228 | } |
| 229 | |
| 230 | java_library { |
| 231 | name: "myjavalib", |
| 232 | srcs: ["Test.java"], |
Paul Duffin | 4e77284 | 2020-06-24 12:10:42 +0100 | [diff] [blame] | 233 | java_resources: ["resource.txt"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 234 | aidl: { |
| 235 | export_include_dirs: ["aidl"], |
| 236 | }, |
| 237 | system_modules: "none", |
| 238 | sdk_version: "none", |
| 239 | compile_dex: true, |
| 240 | host_supported: true, |
| 241 | } |
| 242 | `) |
| 243 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 244 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 245 | checkAndroidBpContents(` |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 246 | // This is auto-generated. DO NOT EDIT. |
| 247 | |
| 248 | java_import { |
| 249 | name: "myjavalib", |
| 250 | prefer: false, |
| 251 | visibility: ["//visibility:public"], |
| 252 | apex_available: ["//apex_available:platform"], |
| 253 | jars: ["java/myjavalib.jar"], |
| 254 | } |
| 255 | `), |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 256 | checkAllCopyRules(` |
Paul Duffin | 4e77284 | 2020-06-24 12:10:42 +0100 | [diff] [blame] | 257 | .intermediates/myjavalib/android_common/withres/myjavalib.jar -> java/myjavalib.jar |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 258 | aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl |
| 259 | `), |
| 260 | ) |
| 261 | } |
| 262 | |
Paul Duffin | db170e4 | 2020-12-08 17:48:25 +0000 | [diff] [blame] | 263 | func TestSnapshotWithJavaBootLibrary(t *testing.T) { |
Paul Duffin | db462dd | 2021-03-21 22:01:55 +0000 | [diff] [blame] | 264 | result := android.GroupFixturePreparers( |
| 265 | prepareForSdkTestWithJava, |
| 266 | android.FixtureAddFile("aidl", nil), |
| 267 | android.FixtureAddFile("resource.txt", nil), |
| 268 | ).RunTestWithBp(t, ` |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 269 | sdk { |
| 270 | name: "mysdk", |
Paul Duffin | db170e4 | 2020-12-08 17:48:25 +0000 | [diff] [blame] | 271 | java_boot_libs: ["myjavalib"], |
| 272 | } |
| 273 | |
| 274 | java_library { |
| 275 | name: "myjavalib", |
| 276 | srcs: ["Test.java"], |
| 277 | java_resources: ["resource.txt"], |
| 278 | // The aidl files should not be copied to the snapshot because a java_boot_libs member is not |
| 279 | // intended to be used for compiling Java, only for accessing the dex implementation jar. |
| 280 | aidl: { |
| 281 | export_include_dirs: ["aidl"], |
| 282 | }, |
| 283 | system_modules: "none", |
| 284 | sdk_version: "none", |
| 285 | compile_dex: true, |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 286 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | db170e4 | 2020-12-08 17:48:25 +0000 | [diff] [blame] | 287 | } |
| 288 | `) |
| 289 | |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 290 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 291 | checkAndroidBpContents(` |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 292 | // This is auto-generated. DO NOT EDIT. |
| 293 | |
| 294 | java_import { |
| 295 | name: "myjavalib", |
| 296 | prefer: false, |
| 297 | visibility: ["//visibility:public"], |
| 298 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 299 | jars: ["java_boot_libs/snapshot/jars/are/invalid/myjavalib.jar"], |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 300 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 301 | } |
| 302 | `), |
Paul Duffin | db170e4 | 2020-12-08 17:48:25 +0000 | [diff] [blame] | 303 | checkAllCopyRules(` |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 304 | .intermediates/mysdk/common_os/empty -> java_boot_libs/snapshot/jars/are/invalid/myjavalib.jar |
Paul Duffin | db170e4 | 2020-12-08 17:48:25 +0000 | [diff] [blame] | 305 | `), |
| 306 | ) |
| 307 | } |
| 308 | |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 309 | func TestSnapshotWithJavaBootLibrary_UpdatableMedia(t *testing.T) { |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 310 | runTest := func(t *testing.T, targetBuildRelease, expectedJarPath, expectedCopyRule string) { |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 311 | result := android.GroupFixturePreparers( |
| 312 | prepareForSdkTestWithJava, |
| 313 | android.FixtureMergeEnv(map[string]string{ |
| 314 | "SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": targetBuildRelease, |
| 315 | }), |
| 316 | ).RunTestWithBp(t, ` |
| 317 | sdk { |
| 318 | name: "mysdk", |
| 319 | java_boot_libs: ["updatable-media"], |
| 320 | } |
| 321 | |
| 322 | java_library { |
| 323 | name: "updatable-media", |
| 324 | srcs: ["Test.java"], |
| 325 | system_modules: "none", |
| 326 | sdk_version: "none", |
| 327 | compile_dex: true, |
| 328 | permitted_packages: ["pkg.media"], |
| 329 | apex_available: ["com.android.media"], |
| 330 | } |
| 331 | `) |
| 332 | |
| 333 | CheckSnapshot(t, result, "mysdk", "", |
| 334 | checkAndroidBpContents(fmt.Sprintf(` |
| 335 | // This is auto-generated. DO NOT EDIT. |
| 336 | |
| 337 | java_import { |
| 338 | name: "updatable-media", |
| 339 | prefer: false, |
| 340 | visibility: ["//visibility:public"], |
| 341 | apex_available: ["com.android.media"], |
| 342 | jars: ["%s"], |
| 343 | permitted_packages: ["pkg.media"], |
| 344 | } |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 345 | `, expectedJarPath)), |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 346 | checkAllCopyRules(expectedCopyRule), |
| 347 | ) |
| 348 | } |
| 349 | |
| 350 | t.Run("updatable-media in S", func(t *testing.T) { |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 351 | runTest(t, "S", "java/updatable-media.jar", ` |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 352 | .intermediates/updatable-media/android_common/package-check/updatable-media.jar -> java/updatable-media.jar |
| 353 | `) |
| 354 | }) |
| 355 | |
| 356 | t.Run("updatable-media in T", func(t *testing.T) { |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 357 | runTest(t, "Tiramisu", "java_boot_libs/snapshot/jars/are/invalid/updatable-media.jar", ` |
| 358 | .intermediates/mysdk/common_os/empty -> java_boot_libs/snapshot/jars/are/invalid/updatable-media.jar |
Paul Duffin | 1364891 | 2022-07-15 13:12:35 +0000 | [diff] [blame] | 359 | `) |
| 360 | }) |
| 361 | } |
| 362 | |
Paul Duffin | bb638eb | 2022-11-26 13:36:38 +0000 | [diff] [blame] | 363 | func TestSnapshotWithJavaLibrary_MinSdkVersion(t *testing.T) { |
| 364 | runTest := func(t *testing.T, targetBuildRelease, minSdkVersion, expectedMinSdkVersion string) { |
| 365 | result := android.GroupFixturePreparers( |
| 366 | prepareForSdkTestWithJava, |
| 367 | android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { |
| 368 | variables.Platform_version_active_codenames = []string{"S", "Tiramisu", "Unfinalized"} |
| 369 | }), |
| 370 | android.FixtureMergeEnv(map[string]string{ |
| 371 | "SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": targetBuildRelease, |
| 372 | }), |
| 373 | ).RunTestWithBp(t, fmt.Sprintf(` |
| 374 | sdk { |
| 375 | name: "mysdk", |
| 376 | java_header_libs: ["mylib"], |
| 377 | } |
| 378 | |
| 379 | java_library { |
| 380 | name: "mylib", |
| 381 | srcs: ["Test.java"], |
| 382 | system_modules: "none", |
| 383 | sdk_version: "none", |
| 384 | compile_dex: true, |
| 385 | min_sdk_version: "%s", |
| 386 | } |
| 387 | `, minSdkVersion)) |
| 388 | |
| 389 | expectedMinSdkVersionLine := "" |
| 390 | if expectedMinSdkVersion != "" { |
| 391 | expectedMinSdkVersionLine = fmt.Sprintf(" min_sdk_version: %q,\n", expectedMinSdkVersion) |
| 392 | } |
| 393 | |
| 394 | CheckSnapshot(t, result, "mysdk", "", |
| 395 | checkAndroidBpContents(fmt.Sprintf(` |
| 396 | // This is auto-generated. DO NOT EDIT. |
| 397 | |
| 398 | java_import { |
| 399 | name: "mylib", |
| 400 | prefer: false, |
| 401 | visibility: ["//visibility:public"], |
| 402 | apex_available: ["//apex_available:platform"], |
| 403 | jars: ["java/mylib.jar"], |
| 404 | %s} |
| 405 | `, expectedMinSdkVersionLine)), |
| 406 | ) |
| 407 | } |
| 408 | |
| 409 | t.Run("min_sdk_version=S in S", func(t *testing.T) { |
| 410 | // min_sdk_version was not added to java_import until Tiramisu. |
| 411 | runTest(t, "S", "S", "") |
| 412 | }) |
| 413 | |
| 414 | t.Run("min_sdk_version=S in Tiramisu", func(t *testing.T) { |
| 415 | // The canonical form of S is 31. |
| 416 | runTest(t, "Tiramisu", "S", "31") |
| 417 | }) |
| 418 | |
| 419 | t.Run("min_sdk_version=24 in Tiramisu", func(t *testing.T) { |
| 420 | // A numerical min_sdk_version is already in canonical form. |
| 421 | runTest(t, "Tiramisu", "24", "24") |
| 422 | }) |
| 423 | |
| 424 | t.Run("min_sdk_version=Unfinalized in latest", func(t *testing.T) { |
| 425 | // An unfinalized min_sdk_version has no numeric value yet. |
| 426 | runTest(t, "", "Unfinalized", "Unfinalized") |
| 427 | }) |
| 428 | } |
| 429 | |
Jiakai Zhang | ea18033 | 2021-09-26 08:58:02 +0000 | [diff] [blame] | 430 | func TestSnapshotWithJavaSystemserverLibrary(t *testing.T) { |
| 431 | result := android.GroupFixturePreparers( |
| 432 | prepareForSdkTestWithJava, |
| 433 | android.FixtureAddFile("aidl", nil), |
| 434 | android.FixtureAddFile("resource.txt", nil), |
| 435 | ).RunTestWithBp(t, ` |
| 436 | module_exports { |
| 437 | name: "myexports", |
| 438 | java_systemserver_libs: ["myjavalib"], |
| 439 | } |
| 440 | |
| 441 | java_library { |
| 442 | name: "myjavalib", |
| 443 | srcs: ["Test.java"], |
| 444 | java_resources: ["resource.txt"], |
| 445 | // The aidl files should not be copied to the snapshot because a java_systemserver_libs member |
| 446 | // is not intended to be used for compiling Java, only for accessing the dex implementation |
| 447 | // jar. |
| 448 | aidl: { |
| 449 | export_include_dirs: ["aidl"], |
| 450 | }, |
| 451 | system_modules: "none", |
| 452 | sdk_version: "none", |
| 453 | compile_dex: true, |
| 454 | permitted_packages: ["pkg.myjavalib"], |
| 455 | } |
| 456 | `) |
| 457 | |
| 458 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 459 | checkAndroidBpContents(` |
Jiakai Zhang | ea18033 | 2021-09-26 08:58:02 +0000 | [diff] [blame] | 460 | // This is auto-generated. DO NOT EDIT. |
| 461 | |
| 462 | java_import { |
| 463 | name: "myjavalib", |
| 464 | prefer: false, |
| 465 | visibility: ["//visibility:public"], |
| 466 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 467 | jars: ["java_systemserver_libs/snapshot/jars/are/invalid/myjavalib.jar"], |
Jiakai Zhang | ea18033 | 2021-09-26 08:58:02 +0000 | [diff] [blame] | 468 | permitted_packages: ["pkg.myjavalib"], |
| 469 | } |
| 470 | `), |
Jiakai Zhang | ea18033 | 2021-09-26 08:58:02 +0000 | [diff] [blame] | 471 | checkAllCopyRules(` |
Paul Duffin | 7ed6ff8 | 2022-11-21 10:57:30 +0000 | [diff] [blame] | 472 | .intermediates/myexports/common_os/empty -> java_systemserver_libs/snapshot/jars/are/invalid/myjavalib.jar |
Jiakai Zhang | ea18033 | 2021-09-26 08:58:02 +0000 | [diff] [blame] | 473 | `), |
| 474 | ) |
| 475 | } |
| 476 | |
Paul Duffin | a0dbf43 | 2019-12-05 11:25:53 +0000 | [diff] [blame] | 477 | func TestHostSnapshotWithJavaImplLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 478 | result := android.GroupFixturePreparers( |
| 479 | prepareForSdkTestWithJava, |
| 480 | android.FixtureAddFile("aidl/foo/bar/Test.aidl", nil), |
| 481 | ).RunTestWithBp(t, ` |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 482 | module_exports { |
| 483 | name: "myexports", |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 484 | device_supported: false, |
| 485 | host_supported: true, |
| 486 | java_libs: ["myjavalib"], |
| 487 | } |
| 488 | |
| 489 | java_library { |
| 490 | name: "myjavalib", |
| 491 | device_supported: false, |
| 492 | host_supported: true, |
| 493 | srcs: ["Test.java"], |
| 494 | aidl: { |
| 495 | export_include_dirs: ["aidl"], |
| 496 | }, |
| 497 | system_modules: "none", |
| 498 | sdk_version: "none", |
| 499 | compile_dex: true, |
| 500 | } |
| 501 | `) |
| 502 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 503 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 504 | checkAndroidBpContents(` |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 505 | // This is auto-generated. DO NOT EDIT. |
| 506 | |
| 507 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 508 | name: "myjavalib", |
| 509 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 510 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 511 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 512 | device_supported: false, |
| 513 | host_supported: true, |
| 514 | jars: ["java/myjavalib.jar"], |
| 515 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 516 | `), |
Paul Duffin | a80fdec | 2019-12-03 15:25:00 +0000 | [diff] [blame] | 517 | checkAllCopyRules(` |
| 518 | .intermediates/myjavalib/linux_glibc_common/javac/myjavalib.jar -> java/myjavalib.jar |
| 519 | aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl |
| 520 | `), |
| 521 | ) |
| 522 | } |
| 523 | |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 524 | func TestSnapshotWithJavaTest(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 525 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 526 | module_exports { |
| 527 | name: "myexports", |
| 528 | java_tests: ["myjavatests"], |
| 529 | } |
| 530 | |
| 531 | java_test { |
| 532 | name: "myjavatests", |
| 533 | srcs: ["Test.java"], |
| 534 | system_modules: "none", |
| 535 | sdk_version: "none", |
| 536 | compile_dex: true, |
| 537 | host_supported: true, |
| 538 | } |
| 539 | `) |
| 540 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 541 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 542 | checkAndroidBpContents(` |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 543 | // This is auto-generated. DO NOT EDIT. |
| 544 | |
| 545 | java_test_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 546 | name: "myjavatests", |
| 547 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 548 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 549 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 550 | jars: ["java/myjavatests.jar"], |
| 551 | test_config: "java/myjavatests-AndroidTest.xml", |
| 552 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 553 | `), |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 554 | checkAllCopyRules(` |
| 555 | .intermediates/myjavatests/android_common/javac/myjavatests.jar -> java/myjavatests.jar |
| 556 | .intermediates/myjavatests/android_common/myjavatests.config -> java/myjavatests-AndroidTest.xml |
| 557 | `), |
| 558 | ) |
| 559 | } |
| 560 | |
| 561 | func TestHostSnapshotWithJavaTest(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 562 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 563 | module_exports { |
| 564 | name: "myexports", |
| 565 | device_supported: false, |
| 566 | host_supported: true, |
| 567 | java_tests: ["myjavatests"], |
| 568 | } |
| 569 | |
| 570 | java_test { |
| 571 | name: "myjavatests", |
| 572 | device_supported: false, |
| 573 | host_supported: true, |
| 574 | srcs: ["Test.java"], |
| 575 | system_modules: "none", |
| 576 | sdk_version: "none", |
| 577 | compile_dex: true, |
| 578 | } |
| 579 | `) |
| 580 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 581 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 582 | checkAndroidBpContents(` |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 583 | // This is auto-generated. DO NOT EDIT. |
| 584 | |
| 585 | java_test_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 586 | name: "myjavatests", |
| 587 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 588 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 589 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 590 | device_supported: false, |
| 591 | host_supported: true, |
| 592 | jars: ["java/myjavatests.jar"], |
| 593 | test_config: "java/myjavatests-AndroidTest.xml", |
| 594 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 595 | `), |
Paul Duffin | 1b82e6a | 2019-12-03 18:06:47 +0000 | [diff] [blame] | 596 | checkAllCopyRules(` |
| 597 | .intermediates/myjavatests/linux_glibc_common/javac/myjavatests.jar -> java/myjavatests.jar |
| 598 | .intermediates/myjavatests/linux_glibc_common/myjavatests.config -> java/myjavatests-AndroidTest.xml |
| 599 | `), |
| 600 | ) |
| 601 | } |
| 602 | |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 603 | func TestSnapshotWithJavaSystemModules(t *testing.T) { |
Paul Duffin | 958806b | 2022-05-16 13:10:47 +0000 | [diff] [blame] | 604 | result := android.GroupFixturePreparers( |
| 605 | prepareForSdkTestWithJava, |
| 606 | java.PrepareForTestWithJavaDefaultModules, |
| 607 | java.PrepareForTestWithJavaSdkLibraryFiles, |
| 608 | java.FixtureWithPrebuiltApisAndExtensions(map[string][]string{ |
| 609 | "31": {"myjavalib"}, |
| 610 | "32": {"myjavalib"}, |
| 611 | "current": {"myjavalib"}, |
| 612 | }, map[string][]string{ |
| 613 | "1": {"myjavalib"}, |
| 614 | "2": {"myjavalib"}, |
| 615 | }), |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 616 | android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { |
| 617 | variables.BuildFlags = map[string]string{ |
| 618 | "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true", |
| 619 | } |
| 620 | }), |
Paul Duffin | 958806b | 2022-05-16 13:10:47 +0000 | [diff] [blame] | 621 | ).RunTestWithBp(t, ` |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 622 | sdk { |
| 623 | name: "mysdk", |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 624 | java_header_libs: ["exported-system-module"], |
Paul Duffin | 3302871 | 2021-06-22 11:00:07 +0100 | [diff] [blame] | 625 | java_sdk_libs: ["myjavalib"], |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 626 | java_system_modules: ["my-system-modules"], |
| 627 | } |
| 628 | |
Paul Duffin | 3302871 | 2021-06-22 11:00:07 +0100 | [diff] [blame] | 629 | java_sdk_library { |
| 630 | name: "myjavalib", |
| 631 | apex_available: ["//apex_available:anyapex"], |
| 632 | srcs: ["Test.java"], |
| 633 | sdk_version: "current", |
| 634 | shared_library: false, |
| 635 | public: { |
| 636 | enabled: true, |
| 637 | }, |
| 638 | } |
| 639 | |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 640 | java_system_modules { |
| 641 | name: "my-system-modules", |
Paul Duffin | 3302871 | 2021-06-22 11:00:07 +0100 | [diff] [blame] | 642 | libs: ["system-module", "exported-system-module", "myjavalib.stubs"], |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | java_library { |
| 646 | name: "system-module", |
| 647 | srcs: ["Test.java"], |
| 648 | sdk_version: "none", |
| 649 | system_modules: "none", |
| 650 | } |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 651 | |
| 652 | java_library { |
| 653 | name: "exported-system-module", |
| 654 | srcs: ["Test.java"], |
| 655 | sdk_version: "none", |
| 656 | system_modules: "none", |
| 657 | } |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 658 | `) |
| 659 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 660 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 661 | checkAndroidBpContents(` |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 662 | // This is auto-generated. DO NOT EDIT. |
| 663 | |
| 664 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 665 | name: "exported-system-module", |
| 666 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 667 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 668 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 669 | jars: ["java/exported-system-module.jar"], |
| 670 | } |
| 671 | |
| 672 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 673 | name: "mysdk_system-module", |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 674 | prefer: false, |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 675 | visibility: ["//visibility:private"], |
| 676 | apex_available: ["//apex_available:platform"], |
| 677 | jars: ["java/system-module.jar"], |
| 678 | } |
| 679 | |
Paul Duffin | 3302871 | 2021-06-22 11:00:07 +0100 | [diff] [blame] | 680 | java_sdk_library_import { |
| 681 | name: "myjavalib", |
| 682 | prefer: false, |
| 683 | visibility: ["//visibility:public"], |
| 684 | apex_available: ["//apex_available:anyapex"], |
| 685 | shared_library: false, |
| 686 | public: { |
| 687 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 688 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
| 689 | current_api: "sdk_library/public/myjavalib.txt", |
| 690 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 691 | sdk_version: "current", |
| 692 | }, |
| 693 | } |
| 694 | |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 695 | java_system_modules_import { |
| 696 | name: "my-system-modules", |
| 697 | prefer: false, |
| 698 | visibility: ["//visibility:public"], |
| 699 | libs: [ |
| 700 | "mysdk_system-module", |
| 701 | "exported-system-module", |
Paul Duffin | b97b157 | 2021-04-29 21:50:40 +0100 | [diff] [blame] | 702 | "myjavalib.stubs", |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 703 | ], |
| 704 | } |
| 705 | `), |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 706 | checkAllCopyRules(` |
| 707 | .intermediates/exported-system-module/android_common/turbine-combined/exported-system-module.jar -> java/exported-system-module.jar |
| 708 | .intermediates/system-module/android_common/turbine-combined/system-module.jar -> java/system-module.jar |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 709 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 710 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 711 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 712 | `), |
Paul Duffin | 958806b | 2022-05-16 13:10:47 +0000 | [diff] [blame] | 713 | checkInfoContents(result.Config, ` |
Paul Duffin | c6ba182 | 2022-05-06 09:38:02 +0000 | [diff] [blame] | 714 | [ |
| 715 | { |
| 716 | "@type": "sdk", |
| 717 | "@name": "mysdk", |
| 718 | "java_header_libs": [ |
| 719 | "exported-system-module", |
| 720 | "system-module" |
| 721 | ], |
| 722 | "java_sdk_libs": [ |
| 723 | "myjavalib" |
| 724 | ], |
| 725 | "java_system_modules": [ |
| 726 | "my-system-modules" |
| 727 | ] |
| 728 | }, |
| 729 | { |
| 730 | "@type": "java_library", |
| 731 | "@name": "exported-system-module" |
| 732 | }, |
| 733 | { |
| 734 | "@type": "java_system_modules", |
| 735 | "@name": "my-system-modules", |
| 736 | "@deps": [ |
| 737 | "exported-system-module", |
| 738 | "system-module" |
| 739 | ] |
| 740 | }, |
| 741 | { |
| 742 | "@type": "java_sdk_library", |
Paul Duffin | 958806b | 2022-05-16 13:10:47 +0000 | [diff] [blame] | 743 | "@name": "myjavalib", |
| 744 | "dist_stem": "myjavalib", |
| 745 | "scopes": { |
| 746 | "public": { |
| 747 | "current_api": "sdk_library/public/myjavalib.txt", |
| 748 | "latest_api": "out/soong/.intermediates/prebuilts/sdk/myjavalib.api.public.latest/gen/myjavalib.api.public.latest", |
| 749 | "latest_removed_api": "out/soong/.intermediates/prebuilts/sdk/myjavalib-removed.api.public.latest/gen/myjavalib-removed.api.public.latest", |
| 750 | "removed_api": "sdk_library/public/myjavalib-removed.txt" |
| 751 | } |
| 752 | } |
Paul Duffin | c6ba182 | 2022-05-06 09:38:02 +0000 | [diff] [blame] | 753 | }, |
| 754 | { |
| 755 | "@type": "java_library", |
| 756 | "@name": "system-module" |
| 757 | } |
| 758 | ] |
| 759 | `), |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 760 | ) |
| 761 | } |
| 762 | |
| 763 | func TestHostSnapshotWithJavaSystemModules(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 764 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 765 | sdk { |
| 766 | name: "mysdk", |
| 767 | device_supported: false, |
| 768 | host_supported: true, |
| 769 | java_system_modules: ["my-system-modules"], |
| 770 | } |
| 771 | |
| 772 | java_system_modules { |
| 773 | name: "my-system-modules", |
| 774 | device_supported: false, |
| 775 | host_supported: true, |
| 776 | libs: ["system-module"], |
| 777 | } |
| 778 | |
| 779 | java_library { |
| 780 | name: "system-module", |
| 781 | device_supported: false, |
| 782 | host_supported: true, |
| 783 | srcs: ["Test.java"], |
| 784 | sdk_version: "none", |
| 785 | system_modules: "none", |
| 786 | } |
| 787 | `) |
| 788 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 789 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 790 | checkAndroidBpContents(` |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 791 | // This is auto-generated. DO NOT EDIT. |
| 792 | |
| 793 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 794 | name: "mysdk_system-module", |
| 795 | prefer: false, |
Paul Duffin | 7291095 | 2020-01-20 18:16:30 +0000 | [diff] [blame] | 796 | visibility: ["//visibility:private"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 797 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 798 | device_supported: false, |
| 799 | host_supported: true, |
| 800 | jars: ["java/system-module.jar"], |
| 801 | } |
| 802 | |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 803 | java_system_modules_import { |
| 804 | name: "my-system-modules", |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 805 | prefer: false, |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 806 | visibility: ["//visibility:public"], |
| 807 | device_supported: false, |
| 808 | host_supported: true, |
| 809 | libs: ["mysdk_system-module"], |
| 810 | } |
| 811 | `), |
Colin Cross | f06d8dc | 2023-07-18 22:11:07 -0700 | [diff] [blame] | 812 | checkAllCopyRules(".intermediates/system-module/linux_glibc_common/javac-header/system-module.jar -> java/system-module.jar"), |
Paul Duffin | 7b81f5e | 2020-01-13 21:03:22 +0000 | [diff] [blame] | 813 | ) |
| 814 | } |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 815 | |
| 816 | func TestDeviceAndHostSnapshotWithOsSpecificMembers(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 817 | result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 818 | module_exports { |
| 819 | name: "myexports", |
| 820 | host_supported: true, |
| 821 | java_libs: ["myjavalib"], |
| 822 | target: { |
| 823 | android: { |
| 824 | java_header_libs: ["androidjavalib"], |
| 825 | }, |
| 826 | host: { |
| 827 | java_header_libs: ["hostjavalib"], |
| 828 | }, |
| 829 | }, |
| 830 | } |
| 831 | |
| 832 | java_library { |
| 833 | name: "myjavalib", |
| 834 | host_supported: true, |
| 835 | srcs: ["Test.java"], |
| 836 | system_modules: "none", |
| 837 | sdk_version: "none", |
| 838 | } |
| 839 | |
| 840 | java_library { |
| 841 | name: "androidjavalib", |
| 842 | srcs: ["Test.java"], |
| 843 | system_modules: "none", |
| 844 | sdk_version: "none", |
| 845 | } |
| 846 | |
| 847 | java_library_host { |
| 848 | name: "hostjavalib", |
| 849 | srcs: ["Test.java"], |
| 850 | } |
| 851 | `) |
| 852 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 853 | CheckSnapshot(t, result, "myexports", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 854 | checkAndroidBpContents(` |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 855 | // This is auto-generated. DO NOT EDIT. |
| 856 | |
| 857 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 858 | name: "hostjavalib", |
| 859 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 860 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 861 | apex_available: ["//apex_available:platform"], |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 862 | device_supported: false, |
| 863 | host_supported: true, |
| 864 | jars: ["java/hostjavalib.jar"], |
| 865 | } |
| 866 | |
| 867 | java_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 868 | name: "androidjavalib", |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 869 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 870 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 871 | apex_available: ["//apex_available:platform"], |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 872 | jars: ["java/androidjavalib.jar"], |
| 873 | } |
| 874 | |
| 875 | java_import { |
| 876 | name: "myjavalib", |
| 877 | prefer: false, |
| 878 | visibility: ["//visibility:public"], |
| 879 | apex_available: ["//apex_available:platform"], |
| 880 | host_supported: true, |
| 881 | target: { |
| 882 | android: { |
| 883 | jars: ["java/android/myjavalib.jar"], |
| 884 | }, |
| 885 | linux_glibc: { |
| 886 | jars: ["java/linux_glibc/myjavalib.jar"], |
| 887 | }, |
| 888 | }, |
| 889 | } |
| 890 | `), |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 891 | checkAllCopyRules(` |
Colin Cross | f06d8dc | 2023-07-18 22:11:07 -0700 | [diff] [blame] | 892 | .intermediates/hostjavalib/linux_glibc_common/javac-header/hostjavalib.jar -> java/hostjavalib.jar |
Paul Duffin | 865171e | 2020-03-02 18:38:15 +0000 | [diff] [blame] | 893 | .intermediates/androidjavalib/android_common/turbine-combined/androidjavalib.jar -> java/androidjavalib.jar |
| 894 | .intermediates/myjavalib/android_common/javac/myjavalib.jar -> java/android/myjavalib.jar |
| 895 | .intermediates/myjavalib/linux_glibc_common/javac/myjavalib.jar -> java/linux_glibc/myjavalib.jar |
| 896 | `), |
| 897 | ) |
| 898 | } |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 899 | |
| 900 | func TestSnapshotWithJavaSdkLibrary(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 901 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 902 | sdk { |
| 903 | name: "mysdk", |
| 904 | java_sdk_libs: ["myjavalib"], |
| 905 | } |
| 906 | |
| 907 | java_sdk_library { |
| 908 | name: "myjavalib", |
| 909 | apex_available: ["//apex_available:anyapex"], |
| 910 | srcs: ["Test.java"], |
| 911 | sdk_version: "current", |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 912 | shared_library: false, |
Paul Duffin | 4911a89 | 2020-04-29 23:35:13 +0100 | [diff] [blame] | 913 | stubs_library_visibility: ["//other"], |
| 914 | stubs_source_visibility: ["//another"], |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 915 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 916 | } |
| 917 | `) |
| 918 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 919 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 920 | checkAndroidBpContents(` |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 921 | // This is auto-generated. DO NOT EDIT. |
| 922 | |
| 923 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 924 | name: "myjavalib", |
| 925 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 926 | visibility: ["//visibility:public"], |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 927 | apex_available: ["//apex_available:anyapex"], |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 928 | shared_library: false, |
Paul Duffin | 869de14 | 2021-07-15 14:14:41 +0100 | [diff] [blame] | 929 | permitted_packages: ["pkg.myjavalib"], |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 930 | public: { |
| 931 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 932 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 1fd005d | 2020-04-09 01:08:11 +0100 | [diff] [blame] | 933 | current_api: "sdk_library/public/myjavalib.txt", |
| 934 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 935 | sdk_version: "current", |
| 936 | }, |
| 937 | system: { |
| 938 | jars: ["sdk_library/system/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 939 | stub_srcs: ["sdk_library/system/myjavalib_stub_sources"], |
Paul Duffin | 1fd005d | 2020-04-09 01:08:11 +0100 | [diff] [blame] | 940 | current_api: "sdk_library/system/myjavalib.txt", |
| 941 | removed_api: "sdk_library/system/myjavalib-removed.txt", |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 942 | sdk_version: "system_current", |
| 943 | }, |
| 944 | test: { |
| 945 | jars: ["sdk_library/test/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 946 | stub_srcs: ["sdk_library/test/myjavalib_stub_sources"], |
Paul Duffin | 1fd005d | 2020-04-09 01:08:11 +0100 | [diff] [blame] | 947 | current_api: "sdk_library/test/myjavalib.txt", |
| 948 | removed_api: "sdk_library/test/myjavalib-removed.txt", |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 949 | sdk_version: "test_current", |
| 950 | }, |
| 951 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 952 | `), |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 953 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 954 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 955 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 956 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
| 957 | .intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar |
| 958 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt |
| 959 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt |
| 960 | .intermediates/myjavalib.stubs.exportable.test/android_common/combined/myjavalib.stubs.exportable.test.jar -> sdk_library/test/myjavalib-stubs.jar |
| 961 | .intermediates/myjavalib.stubs.source.test/android_common/exportable/myjavalib.stubs.source.test_api.txt -> sdk_library/test/myjavalib.txt |
| 962 | .intermediates/myjavalib.stubs.source.test/android_common/exportable/myjavalib.stubs.source.test_removed.txt -> sdk_library/test/myjavalib-removed.txt |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 963 | `), |
Paul Duffin | 3d1248c | 2020-04-09 00:10:17 +0100 | [diff] [blame] | 964 | checkMergeZips( |
| 965 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 966 | ".intermediates/mysdk/common_os/tmp/sdk_library/system/myjavalib_stub_sources.zip", |
Paul Duffin | 3302871 | 2021-06-22 11:00:07 +0100 | [diff] [blame] | 967 | ".intermediates/mysdk/common_os/tmp/sdk_library/test/myjavalib_stub_sources.zip", |
| 968 | ), |
Paul Duffin | dd46f71 | 2020-02-10 13:37:10 +0000 | [diff] [blame] | 969 | ) |
| 970 | } |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 971 | |
Paul Duffin | e840995 | 2022-09-22 16:24:46 +0100 | [diff] [blame] | 972 | func TestSnapshotWithJavaSdkLibrary_DistStem(t *testing.T) { |
| 973 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
| 974 | sdk { |
| 975 | name: "mysdk", |
| 976 | java_sdk_libs: ["myjavalib-foo"], |
| 977 | } |
| 978 | |
| 979 | java_sdk_library { |
| 980 | name: "myjavalib-foo", |
| 981 | apex_available: ["//apex_available:anyapex"], |
| 982 | srcs: ["Test.java"], |
| 983 | sdk_version: "current", |
| 984 | shared_library: false, |
| 985 | public: { |
| 986 | enabled: true, |
| 987 | }, |
| 988 | dist_stem: "myjavalib", |
| 989 | } |
| 990 | `) |
| 991 | |
| 992 | CheckSnapshot(t, result, "mysdk", "", |
| 993 | checkAndroidBpContents(` |
| 994 | // This is auto-generated. DO NOT EDIT. |
| 995 | |
| 996 | java_sdk_library_import { |
| 997 | name: "myjavalib-foo", |
| 998 | prefer: false, |
| 999 | visibility: ["//visibility:public"], |
| 1000 | apex_available: ["//apex_available:anyapex"], |
| 1001 | shared_library: false, |
| 1002 | public: { |
| 1003 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 1004 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
| 1005 | current_api: "sdk_library/public/myjavalib.txt", |
| 1006 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1007 | sdk_version: "current", |
| 1008 | }, |
| 1009 | } |
| 1010 | `), |
| 1011 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1012 | .intermediates/myjavalib-foo.stubs.exportable/android_common/combined/myjavalib-foo.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1013 | .intermediates/myjavalib-foo.stubs.source/android_common/exportable/myjavalib-foo.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1014 | .intermediates/myjavalib-foo.stubs.source/android_common/exportable/myjavalib-foo.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | e840995 | 2022-09-22 16:24:46 +0100 | [diff] [blame] | 1015 | `), |
| 1016 | checkMergeZips( |
| 1017 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1018 | ), |
| 1019 | ) |
| 1020 | } |
| 1021 | |
Paul Duffin | 22628d5 | 2021-05-12 23:13:22 +0100 | [diff] [blame] | 1022 | func TestSnapshotWithJavaSdkLibrary_UseSrcJar(t *testing.T) { |
| 1023 | result := android.GroupFixturePreparers( |
| 1024 | prepareForSdkTestWithJavaSdkLibrary, |
| 1025 | android.FixtureMergeEnv(map[string]string{ |
| 1026 | "SOONG_SDK_SNAPSHOT_USE_SRCJAR": "true", |
| 1027 | }), |
| 1028 | ).RunTestWithBp(t, ` |
| 1029 | sdk { |
| 1030 | name: "mysdk", |
| 1031 | java_sdk_libs: ["myjavalib"], |
| 1032 | } |
| 1033 | |
| 1034 | java_sdk_library { |
| 1035 | name: "myjavalib", |
| 1036 | srcs: ["Test.java"], |
| 1037 | sdk_version: "current", |
| 1038 | shared_library: false, |
| 1039 | public: { |
| 1040 | enabled: true, |
| 1041 | }, |
| 1042 | } |
| 1043 | `) |
| 1044 | |
| 1045 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1046 | checkAndroidBpContents(` |
Paul Duffin | 22628d5 | 2021-05-12 23:13:22 +0100 | [diff] [blame] | 1047 | // This is auto-generated. DO NOT EDIT. |
| 1048 | |
| 1049 | java_sdk_library_import { |
| 1050 | name: "myjavalib", |
| 1051 | prefer: false, |
| 1052 | visibility: ["//visibility:public"], |
| 1053 | apex_available: ["//apex_available:platform"], |
| 1054 | shared_library: false, |
| 1055 | public: { |
| 1056 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 1057 | stub_srcs: ["sdk_library/public/myjavalib.srcjar"], |
| 1058 | current_api: "sdk_library/public/myjavalib.txt", |
| 1059 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1060 | sdk_version: "current", |
| 1061 | }, |
| 1062 | } |
| 1063 | `), |
| 1064 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1065 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1066 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source-stubs.srcjar -> sdk_library/public/myjavalib.srcjar |
| 1067 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1068 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | 22628d5 | 2021-05-12 23:13:22 +0100 | [diff] [blame] | 1069 | `), |
| 1070 | ) |
| 1071 | } |
| 1072 | |
Anton Hansson | d78eb76 | 2021-09-21 15:25:12 +0100 | [diff] [blame] | 1073 | func TestSnapshotWithJavaSdkLibrary_AnnotationsZip(t *testing.T) { |
| 1074 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
| 1075 | sdk { |
| 1076 | name: "mysdk", |
| 1077 | java_sdk_libs: ["myjavalib"], |
| 1078 | } |
| 1079 | |
| 1080 | java_sdk_library { |
| 1081 | name: "myjavalib", |
| 1082 | srcs: ["Test.java"], |
| 1083 | sdk_version: "current", |
| 1084 | shared_library: false, |
| 1085 | annotations_enabled: true, |
| 1086 | public: { |
| 1087 | enabled: true, |
| 1088 | }, |
| 1089 | } |
| 1090 | `) |
| 1091 | |
| 1092 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1093 | checkAndroidBpContents(` |
Anton Hansson | d78eb76 | 2021-09-21 15:25:12 +0100 | [diff] [blame] | 1094 | // This is auto-generated. DO NOT EDIT. |
| 1095 | |
| 1096 | java_sdk_library_import { |
| 1097 | name: "myjavalib", |
| 1098 | prefer: false, |
| 1099 | visibility: ["//visibility:public"], |
| 1100 | apex_available: ["//apex_available:platform"], |
| 1101 | shared_library: false, |
| 1102 | public: { |
| 1103 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 1104 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
| 1105 | current_api: "sdk_library/public/myjavalib.txt", |
| 1106 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1107 | annotations: "sdk_library/public/myjavalib_annotations.zip", |
| 1108 | sdk_version: "current", |
| 1109 | }, |
| 1110 | } |
| 1111 | `), |
| 1112 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1113 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1114 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1115 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
| 1116 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_annotations.zip -> sdk_library/public/myjavalib_annotations.zip |
Anton Hansson | d78eb76 | 2021-09-21 15:25:12 +0100 | [diff] [blame] | 1117 | `), |
| 1118 | checkMergeZips(".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip"), |
| 1119 | ) |
| 1120 | } |
| 1121 | |
Paul Duffin | a54016c | 2022-01-27 16:39:47 +0000 | [diff] [blame] | 1122 | func TestSnapshotWithJavaSdkLibrary_AnnotationsZip_PreT(t *testing.T) { |
| 1123 | result := android.GroupFixturePreparers( |
| 1124 | prepareForSdkTestWithJavaSdkLibrary, |
| 1125 | android.FixtureMergeEnv(map[string]string{ |
| 1126 | "SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S", |
| 1127 | }), |
| 1128 | ).RunTestWithBp(t, ` |
| 1129 | sdk { |
| 1130 | name: "mysdk", |
| 1131 | java_sdk_libs: ["myjavalib"], |
| 1132 | } |
| 1133 | |
| 1134 | java_sdk_library { |
| 1135 | name: "myjavalib", |
| 1136 | srcs: ["Test.java"], |
Paul Duffin | 1938dba | 2022-07-26 23:53:00 +0000 | [diff] [blame] | 1137 | sdk_version: "S", |
Paul Duffin | a54016c | 2022-01-27 16:39:47 +0000 | [diff] [blame] | 1138 | shared_library: false, |
| 1139 | annotations_enabled: true, |
| 1140 | public: { |
| 1141 | enabled: true, |
| 1142 | }, |
| 1143 | } |
| 1144 | `) |
| 1145 | |
| 1146 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1147 | checkAndroidBpContents(` |
Paul Duffin | a54016c | 2022-01-27 16:39:47 +0000 | [diff] [blame] | 1148 | // This is auto-generated. DO NOT EDIT. |
| 1149 | |
| 1150 | java_sdk_library_import { |
| 1151 | name: "myjavalib", |
| 1152 | prefer: false, |
| 1153 | visibility: ["//visibility:public"], |
| 1154 | apex_available: ["//apex_available:platform"], |
| 1155 | shared_library: false, |
| 1156 | public: { |
| 1157 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 1158 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
| 1159 | current_api: "sdk_library/public/myjavalib.txt", |
| 1160 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1161 | sdk_version: "current", |
| 1162 | }, |
| 1163 | } |
| 1164 | `), |
| 1165 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1166 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1167 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1168 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | a54016c | 2022-01-27 16:39:47 +0000 | [diff] [blame] | 1169 | `), |
| 1170 | checkMergeZips(".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip"), |
| 1171 | ) |
| 1172 | } |
| 1173 | |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1174 | func TestSnapshotWithJavaSdkLibrary_CompileDex(t *testing.T) { |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 1175 | result := android.GroupFixturePreparers( |
| 1176 | prepareForSdkTestWithJavaSdkLibrary, |
| 1177 | android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { |
| 1178 | variables.BuildFlags = map[string]string{ |
| 1179 | "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true", |
| 1180 | } |
| 1181 | }), |
| 1182 | ).RunTestWithBp(t, ` |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1183 | sdk { |
| 1184 | name: "mysdk", |
| 1185 | java_sdk_libs: ["myjavalib"], |
| 1186 | } |
| 1187 | |
| 1188 | java_sdk_library { |
| 1189 | name: "myjavalib", |
| 1190 | srcs: ["Test.java"], |
| 1191 | sdk_version: "current", |
| 1192 | shared_library: false, |
| 1193 | compile_dex: true, |
| 1194 | public: { |
| 1195 | enabled: true, |
| 1196 | }, |
| 1197 | system: { |
| 1198 | enabled: true, |
| 1199 | }, |
| 1200 | } |
| 1201 | `) |
| 1202 | |
| 1203 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1204 | checkAndroidBpContents(` |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1205 | // This is auto-generated. DO NOT EDIT. |
| 1206 | |
| 1207 | java_sdk_library_import { |
| 1208 | name: "myjavalib", |
| 1209 | prefer: false, |
| 1210 | visibility: ["//visibility:public"], |
| 1211 | apex_available: ["//apex_available:platform"], |
| 1212 | shared_library: false, |
| 1213 | compile_dex: true, |
| 1214 | public: { |
| 1215 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
| 1216 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
| 1217 | current_api: "sdk_library/public/myjavalib.txt", |
| 1218 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1219 | sdk_version: "current", |
| 1220 | }, |
| 1221 | system: { |
| 1222 | jars: ["sdk_library/system/myjavalib-stubs.jar"], |
| 1223 | stub_srcs: ["sdk_library/system/myjavalib_stub_sources"], |
| 1224 | current_api: "sdk_library/system/myjavalib.txt", |
| 1225 | removed_api: "sdk_library/system/myjavalib-removed.txt", |
| 1226 | sdk_version: "system_current", |
| 1227 | }, |
| 1228 | } |
| 1229 | `), |
| 1230 | snapshotTestChecker(checkSnapshotWithSourcePreferred, func(t *testing.T, result *android.TestResult) { |
| 1231 | ctx := android.ModuleInstallPathContextForTesting(result.Config) |
| 1232 | dexJarBuildPath := func(name string, kind android.SdkKind) string { |
| 1233 | dep := result.Module(name, "android_common").(java.SdkLibraryDependency) |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 1234 | path := dep.SdkApiExportableStubDexJar(ctx, kind).Path() |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1235 | return path.RelativeToTop().String() |
| 1236 | } |
| 1237 | |
| 1238 | dexJarPath := dexJarBuildPath("myjavalib", android.SdkPublic) |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 1239 | android.AssertStringEquals(t, "source dex public stubs jar build path", "out/soong/.intermediates/myjavalib.stubs.exportable/android_common/dex/myjavalib.stubs.exportable.jar", dexJarPath) |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1240 | |
| 1241 | dexJarPath = dexJarBuildPath("myjavalib", android.SdkSystem) |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 1242 | systemDexJar := "out/soong/.intermediates/myjavalib.stubs.exportable.system/android_common/dex/myjavalib.stubs.exportable.system.jar" |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1243 | android.AssertStringEquals(t, "source dex system stubs jar build path", systemDexJar, dexJarPath) |
| 1244 | |
| 1245 | // This should fall back to system as module is not available. |
| 1246 | dexJarPath = dexJarBuildPath("myjavalib", android.SdkModule) |
| 1247 | android.AssertStringEquals(t, "source dex module stubs jar build path", systemDexJar, dexJarPath) |
| 1248 | |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 1249 | // Prebuilt dex jar does not come from the exportable stubs. |
Paul Duffin | 1267d87 | 2021-04-16 17:21:36 +0100 | [diff] [blame] | 1250 | dexJarPath = dexJarBuildPath(android.PrebuiltNameFromSource("myjavalib"), android.SdkPublic) |
| 1251 | android.AssertStringEquals(t, "prebuilt dex public stubs jar build path", "out/soong/.intermediates/snapshot/prebuilt_myjavalib.stubs/android_common/dex/myjavalib.stubs.jar", dexJarPath) |
| 1252 | }), |
| 1253 | ) |
| 1254 | } |
| 1255 | |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1256 | func TestSnapshotWithJavaSdkLibrary_SdkVersion_None(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1257 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1258 | sdk { |
| 1259 | name: "mysdk", |
| 1260 | java_sdk_libs: ["myjavalib"], |
| 1261 | } |
| 1262 | |
| 1263 | java_sdk_library { |
| 1264 | name: "myjavalib", |
| 1265 | srcs: ["Test.java"], |
| 1266 | sdk_version: "none", |
| 1267 | system_modules: "none", |
| 1268 | } |
| 1269 | `) |
| 1270 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1271 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1272 | checkAndroidBpContents(` |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1273 | // This is auto-generated. DO NOT EDIT. |
| 1274 | |
| 1275 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1276 | name: "myjavalib", |
| 1277 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1278 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1279 | apex_available: ["//apex_available:platform"], |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 1280 | shared_library: true, |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1281 | public: { |
| 1282 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1283 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1284 | current_api: "sdk_library/public/myjavalib.txt", |
| 1285 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1286 | sdk_version: "none", |
| 1287 | }, |
| 1288 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1289 | `), |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1290 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1291 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1292 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1293 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | 780c5f4 | 2020-05-12 15:52:55 +0100 | [diff] [blame] | 1294 | `), |
| 1295 | checkMergeZips( |
| 1296 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1297 | ), |
| 1298 | ) |
| 1299 | } |
| 1300 | |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1301 | func TestSnapshotWithJavaSdkLibrary_SdkVersion_ForScope(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1302 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1303 | sdk { |
| 1304 | name: "mysdk", |
| 1305 | java_sdk_libs: ["myjavalib"], |
| 1306 | } |
| 1307 | |
| 1308 | java_sdk_library { |
| 1309 | name: "myjavalib", |
| 1310 | srcs: ["Test.java"], |
| 1311 | sdk_version: "module_current", |
| 1312 | public: { |
| 1313 | enabled: true, |
| 1314 | sdk_version: "module_current", |
| 1315 | }, |
| 1316 | } |
| 1317 | `) |
| 1318 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1319 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1320 | checkAndroidBpContents(` |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1321 | // This is auto-generated. DO NOT EDIT. |
| 1322 | |
| 1323 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1324 | name: "myjavalib", |
| 1325 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1326 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1327 | apex_available: ["//apex_available:platform"], |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 1328 | shared_library: true, |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1329 | public: { |
| 1330 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1331 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1332 | current_api: "sdk_library/public/myjavalib.txt", |
| 1333 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1334 | sdk_version: "module_current", |
| 1335 | }, |
| 1336 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1337 | `), |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1338 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1339 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1340 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1341 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | 87a05a3 | 2020-05-12 11:50:28 +0100 | [diff] [blame] | 1342 | `), |
| 1343 | checkMergeZips( |
| 1344 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1345 | ), |
| 1346 | ) |
| 1347 | } |
| 1348 | |
| 1349 | func TestSnapshotWithJavaSdkLibrary_ApiScopes(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1350 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1351 | sdk { |
| 1352 | name: "mysdk", |
| 1353 | java_sdk_libs: ["myjavalib"], |
| 1354 | } |
| 1355 | |
| 1356 | java_sdk_library { |
| 1357 | name: "myjavalib", |
| 1358 | apex_available: ["//apex_available:anyapex"], |
| 1359 | srcs: ["Test.java"], |
| 1360 | sdk_version: "current", |
| 1361 | public: { |
| 1362 | enabled: true, |
| 1363 | }, |
| 1364 | system: { |
| 1365 | enabled: true, |
| 1366 | }, |
| 1367 | } |
| 1368 | `) |
| 1369 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1370 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1371 | checkAndroidBpContents(` |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1372 | // This is auto-generated. DO NOT EDIT. |
| 1373 | |
| 1374 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1375 | name: "myjavalib", |
| 1376 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1377 | visibility: ["//visibility:public"], |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1378 | apex_available: ["//apex_available:anyapex"], |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 1379 | shared_library: true, |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1380 | public: { |
| 1381 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1382 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1383 | current_api: "sdk_library/public/myjavalib.txt", |
| 1384 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1385 | sdk_version: "current", |
| 1386 | }, |
| 1387 | system: { |
| 1388 | jars: ["sdk_library/system/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1389 | stub_srcs: ["sdk_library/system/myjavalib_stub_sources"], |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1390 | current_api: "sdk_library/system/myjavalib.txt", |
| 1391 | removed_api: "sdk_library/system/myjavalib-removed.txt", |
| 1392 | sdk_version: "system_current", |
| 1393 | }, |
| 1394 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1395 | `), |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1396 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1397 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1398 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1399 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
| 1400 | .intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar |
| 1401 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt |
| 1402 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt |
Paul Duffin | 3375e35 | 2020-04-28 10:44:03 +0100 | [diff] [blame] | 1403 | `), |
| 1404 | checkMergeZips( |
| 1405 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1406 | ".intermediates/mysdk/common_os/tmp/sdk_library/system/myjavalib_stub_sources.zip", |
| 1407 | ), |
| 1408 | ) |
| 1409 | } |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1410 | |
| 1411 | func TestSnapshotWithJavaSdkLibrary_ModuleLib(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1412 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1413 | sdk { |
| 1414 | name: "mysdk", |
| 1415 | java_sdk_libs: ["myjavalib"], |
| 1416 | } |
| 1417 | |
| 1418 | java_sdk_library { |
| 1419 | name: "myjavalib", |
| 1420 | apex_available: ["//apex_available:anyapex"], |
| 1421 | srcs: ["Test.java"], |
| 1422 | sdk_version: "current", |
| 1423 | public: { |
| 1424 | enabled: true, |
| 1425 | }, |
| 1426 | system: { |
| 1427 | enabled: true, |
| 1428 | }, |
| 1429 | module_lib: { |
| 1430 | enabled: true, |
| 1431 | }, |
| 1432 | } |
| 1433 | `) |
| 1434 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1435 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1436 | checkAndroidBpContents(` |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1437 | // This is auto-generated. DO NOT EDIT. |
| 1438 | |
| 1439 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1440 | name: "myjavalib", |
| 1441 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1442 | visibility: ["//visibility:public"], |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1443 | apex_available: ["//apex_available:anyapex"], |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 1444 | shared_library: true, |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1445 | public: { |
| 1446 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1447 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1448 | current_api: "sdk_library/public/myjavalib.txt", |
| 1449 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1450 | sdk_version: "current", |
| 1451 | }, |
| 1452 | system: { |
| 1453 | jars: ["sdk_library/system/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1454 | stub_srcs: ["sdk_library/system/myjavalib_stub_sources"], |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1455 | current_api: "sdk_library/system/myjavalib.txt", |
| 1456 | removed_api: "sdk_library/system/myjavalib-removed.txt", |
| 1457 | sdk_version: "system_current", |
| 1458 | }, |
| 1459 | module_lib: { |
Paul Duffin | 6b836ba | 2020-05-13 19:19:49 +0100 | [diff] [blame] | 1460 | jars: ["sdk_library/module-lib/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1461 | stub_srcs: ["sdk_library/module-lib/myjavalib_stub_sources"], |
Paul Duffin | 6b836ba | 2020-05-13 19:19:49 +0100 | [diff] [blame] | 1462 | current_api: "sdk_library/module-lib/myjavalib.txt", |
| 1463 | removed_api: "sdk_library/module-lib/myjavalib-removed.txt", |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1464 | sdk_version: "module_current", |
| 1465 | }, |
| 1466 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1467 | `), |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1468 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1469 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1470 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1471 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
| 1472 | .intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar |
| 1473 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt |
| 1474 | .intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt |
| 1475 | .intermediates/myjavalib.stubs.exportable.module_lib/android_common/combined/myjavalib.stubs.exportable.module_lib.jar -> sdk_library/module-lib/myjavalib-stubs.jar |
| 1476 | .intermediates/myjavalib.stubs.source.module_lib/android_common/exportable/myjavalib.stubs.source.module_lib_api.txt -> sdk_library/module-lib/myjavalib.txt |
| 1477 | .intermediates/myjavalib.stubs.source.module_lib/android_common/exportable/myjavalib.stubs.source.module_lib_removed.txt -> sdk_library/module-lib/myjavalib-removed.txt |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1478 | `), |
| 1479 | checkMergeZips( |
Paul Duffin | 74f1dcd | 2022-07-18 13:18:23 +0000 | [diff] [blame] | 1480 | ".intermediates/mysdk/common_os/tmp/sdk_library/module-lib/myjavalib_stub_sources.zip", |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1481 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1482 | ".intermediates/mysdk/common_os/tmp/sdk_library/system/myjavalib_stub_sources.zip", |
Paul Duffin | 8f265b9 | 2020-04-28 14:13:56 +0100 | [diff] [blame] | 1483 | ), |
| 1484 | ) |
| 1485 | } |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1486 | |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1487 | func TestSnapshotWithJavaSdkLibrary_SystemServer(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1488 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1489 | sdk { |
| 1490 | name: "mysdk", |
| 1491 | java_sdk_libs: ["myjavalib"], |
| 1492 | } |
| 1493 | |
| 1494 | java_sdk_library { |
| 1495 | name: "myjavalib", |
| 1496 | apex_available: ["//apex_available:anyapex"], |
| 1497 | srcs: ["Test.java"], |
| 1498 | sdk_version: "current", |
| 1499 | public: { |
| 1500 | enabled: true, |
| 1501 | }, |
| 1502 | system_server: { |
| 1503 | enabled: true, |
| 1504 | }, |
| 1505 | } |
| 1506 | `) |
| 1507 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1508 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1509 | checkAndroidBpContents(` |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1510 | // This is auto-generated. DO NOT EDIT. |
| 1511 | |
| 1512 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1513 | name: "myjavalib", |
| 1514 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1515 | visibility: ["//visibility:public"], |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1516 | apex_available: ["//apex_available:anyapex"], |
| 1517 | shared_library: true, |
| 1518 | public: { |
| 1519 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1520 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1521 | current_api: "sdk_library/public/myjavalib.txt", |
| 1522 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1523 | sdk_version: "current", |
| 1524 | }, |
| 1525 | system_server: { |
| 1526 | jars: ["sdk_library/system-server/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1527 | stub_srcs: ["sdk_library/system-server/myjavalib_stub_sources"], |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1528 | current_api: "sdk_library/system-server/myjavalib.txt", |
| 1529 | removed_api: "sdk_library/system-server/myjavalib-removed.txt", |
| 1530 | sdk_version: "system_server_current", |
| 1531 | }, |
| 1532 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1533 | `), |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1534 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1535 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1536 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1537 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
| 1538 | .intermediates/myjavalib.stubs.exportable.system_server/android_common/combined/myjavalib.stubs.exportable.system_server.jar -> sdk_library/system-server/myjavalib-stubs.jar |
| 1539 | .intermediates/myjavalib.stubs.source.system_server/android_common/exportable/myjavalib.stubs.source.system_server_api.txt -> sdk_library/system-server/myjavalib.txt |
| 1540 | .intermediates/myjavalib.stubs.source.system_server/android_common/exportable/myjavalib.stubs.source.system_server_removed.txt -> sdk_library/system-server/myjavalib-removed.txt |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 1541 | `), |
| 1542 | checkMergeZips( |
| 1543 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1544 | ".intermediates/mysdk/common_os/tmp/sdk_library/system-server/myjavalib_stub_sources.zip", |
| 1545 | ), |
| 1546 | ) |
| 1547 | } |
| 1548 | |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1549 | func TestSnapshotWithJavaSdkLibrary_NamingScheme(t *testing.T) { |
Paul Duffin | 9ec86b1 | 2021-03-15 11:17:52 +0000 | [diff] [blame] | 1550 | result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1551 | sdk { |
| 1552 | name: "mysdk", |
| 1553 | java_sdk_libs: ["myjavalib"], |
| 1554 | } |
| 1555 | |
| 1556 | java_sdk_library { |
| 1557 | name: "myjavalib", |
| 1558 | apex_available: ["//apex_available:anyapex"], |
| 1559 | srcs: ["Test.java"], |
| 1560 | sdk_version: "current", |
Paul Duffin | ee9ad5d | 2020-09-11 13:04:05 +0100 | [diff] [blame] | 1561 | naming_scheme: "default", |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1562 | public: { |
| 1563 | enabled: true, |
| 1564 | }, |
| 1565 | } |
| 1566 | `) |
| 1567 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1568 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1569 | checkAndroidBpContents(` |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1570 | // This is auto-generated. DO NOT EDIT. |
| 1571 | |
| 1572 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1573 | name: "myjavalib", |
| 1574 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1575 | visibility: ["//visibility:public"], |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1576 | apex_available: ["//apex_available:anyapex"], |
Paul Duffin | ee9ad5d | 2020-09-11 13:04:05 +0100 | [diff] [blame] | 1577 | naming_scheme: "default", |
Paul Duffin | d7eb1c2 | 2020-05-26 20:57:10 +0100 | [diff] [blame] | 1578 | shared_library: true, |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1579 | public: { |
| 1580 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1581 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1582 | current_api: "sdk_library/public/myjavalib.txt", |
| 1583 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1584 | sdk_version: "current", |
| 1585 | }, |
| 1586 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1587 | `), |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1588 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1589 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1590 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1591 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | f7a6433 | 2020-05-13 16:54:55 +0100 | [diff] [blame] | 1592 | `), |
| 1593 | checkMergeZips( |
| 1594 | ".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip", |
| 1595 | ), |
| 1596 | ) |
| 1597 | } |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1598 | |
| 1599 | func TestSnapshotWithJavaSdkLibrary_DoctagFiles(t *testing.T) { |
Paul Duffin | db462dd | 2021-03-21 22:01:55 +0000 | [diff] [blame] | 1600 | result := android.GroupFixturePreparers( |
| 1601 | prepareForSdkTestWithJavaSdkLibrary, |
| 1602 | android.FixtureAddFile("docs/known_doctags", nil), |
| 1603 | ).RunTestWithBp(t, ` |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1604 | sdk { |
| 1605 | name: "mysdk", |
| 1606 | java_sdk_libs: ["myjavalib"], |
| 1607 | } |
| 1608 | |
| 1609 | java_sdk_library { |
| 1610 | name: "myjavalib", |
| 1611 | srcs: ["Test.java"], |
| 1612 | sdk_version: "current", |
| 1613 | public: { |
| 1614 | enabled: true, |
| 1615 | }, |
| 1616 | doctag_files: ["docs/known_doctags"], |
| 1617 | } |
| 1618 | |
| 1619 | filegroup { |
| 1620 | name: "mygroup", |
| 1621 | srcs: [":myjavalib{.doctags}"], |
| 1622 | } |
| 1623 | `) |
| 1624 | |
Paul Duffin | 36474d3 | 2021-03-12 12:19:43 +0000 | [diff] [blame] | 1625 | CheckSnapshot(t, result, "mysdk", "", |
Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 1626 | checkAndroidBpContents(` |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1627 | // This is auto-generated. DO NOT EDIT. |
| 1628 | |
| 1629 | java_sdk_library_import { |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1630 | name: "myjavalib", |
| 1631 | prefer: false, |
Paul Duffin | d99d997 | 2020-09-29 16:00:55 +0100 | [diff] [blame] | 1632 | visibility: ["//visibility:public"], |
Martin Stjernholm | 1e04109 | 2020-11-03 00:11:09 +0000 | [diff] [blame] | 1633 | apex_available: ["//apex_available:platform"], |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1634 | shared_library: true, |
| 1635 | doctag_files: ["doctags/docs/known_doctags"], |
| 1636 | public: { |
| 1637 | jars: ["sdk_library/public/myjavalib-stubs.jar"], |
Paul Duffin | ab5ac8f | 2020-11-18 16:37:35 +0000 | [diff] [blame] | 1638 | stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1639 | current_api: "sdk_library/public/myjavalib.txt", |
| 1640 | removed_api: "sdk_library/public/myjavalib-removed.txt", |
| 1641 | sdk_version: "current", |
| 1642 | }, |
| 1643 | } |
Paul Duffin | e138188 | 2021-04-16 17:05:10 +0100 | [diff] [blame] | 1644 | `), |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1645 | checkAllCopyRules(` |
Jihoon Kang | f55a5f7 | 2024-01-08 08:56:20 +0000 | [diff] [blame] | 1646 | .intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar |
| 1647 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt |
| 1648 | .intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt |
Paul Duffin | a2ae7e0 | 2020-09-11 11:55:00 +0100 | [diff] [blame] | 1649 | docs/known_doctags -> doctags/docs/known_doctags |
| 1650 | `), |
| 1651 | ) |
| 1652 | } |