Propagate permitted packages to sdk snapshot
Previously, permitted_packages were not copied to the sdk snapshot.
This change corrects that.
Bug: 193763688
Test: m nothing
- Added unit tests, which all failed and then fixed the tests.
Merged-In: I4560987f746f78c0ae706058195b6db4bea438aa
Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
(cherry picked from commit 869de147abdb2c86a91cced4fda7d27746c52af4)
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go
index 9b7b868..c30324a 100644
--- a/sdk/bootclasspath_fragment_sdk_test.go
+++ b/sdk/bootclasspath_fragment_sdk_test.go
@@ -346,6 +346,7 @@
visibility: ["//visibility:public"],
apex_available: ["myapex"],
jars: ["java/mybootlib.jar"],
+ permitted_packages: ["mybootlib"],
}
java_sdk_library_import {
@@ -355,6 +356,7 @@
apex_available: ["myapex"],
shared_library: true,
compile_dex: true,
+ permitted_packages: ["myothersdklibrary"],
public: {
jars: ["sdk_library/public/myothersdklibrary-stubs.jar"],
stub_srcs: ["sdk_library/public/myothersdklibrary_stub_sources"],
@@ -428,6 +430,7 @@
visibility: ["//visibility:public"],
apex_available: ["myapex"],
jars: ["java/mybootlib.jar"],
+ permitted_packages: ["mybootlib"],
}
java_sdk_library_import {
@@ -437,6 +440,7 @@
apex_available: ["myapex"],
shared_library: true,
compile_dex: true,
+ permitted_packages: ["myothersdklibrary"],
public: {
jars: ["sdk_library/public/myothersdklibrary-stubs.jar"],
stub_srcs: ["sdk_library/public/myothersdklibrary_stub_sources"],
@@ -677,6 +681,7 @@
srcs: ["Test.java"],
compile_dex: true,
public: {enabled: true},
+ permitted_packages: ["mysdklibrary"],
}
`),
).RunTest(t)
@@ -720,6 +725,7 @@
visibility: ["//visibility:public"],
apex_available: ["myapex"],
jars: ["java/mybootlib.jar"],
+ permitted_packages: ["mybootlib"],
}
java_sdk_library_import {
@@ -729,6 +735,7 @@
apex_available: ["//apex_available:platform"],
shared_library: true,
compile_dex: true,
+ permitted_packages: ["mysdklibrary"],
public: {
jars: ["sdk_library/public/mysdklibrary-stubs.jar"],
stub_srcs: ["sdk_library/public/mysdklibrary_stub_sources"],