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