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