Loading java/java.go +14 −0 Original line number Diff line number Diff line Loading @@ -580,6 +580,10 @@ type librarySdkMemberProperties struct { JarToExport android.Path `android:"arch_variant"` AidlIncludeDirs android.Paths // The list of permitted packages that need to be passed to the prebuilts as they are used to // create the updatable-bcp-packages.txt file. PermittedPackages []string } func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) { Loading @@ -588,6 +592,8 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo p.JarToExport = ctx.MemberType().(*librarySdkMemberType).jarToExportGetter(ctx, j) p.AidlIncludeDirs = j.AidlIncludeDirs() p.PermittedPackages = j.PermittedPackagesForUpdatableBootJars() } func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) { Loading @@ -606,6 +612,10 @@ func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberConte propertySet.AddProperty("jars", []string{snapshotRelativeJavaLibPath}) } if len(p.PermittedPackages) > 0 { propertySet.AddProperty("permitted_packages", p.PermittedPackages) } // Do not copy anything else to the snapshot. if memberType.onlyCopyJarToSnapshot { return Loading Loading @@ -1126,6 +1136,10 @@ type ImportProperties struct { Installable *bool // If not empty, classes are restricted to the specified packages and their sub-packages. // This information is used to generate the updatable-bcp-packages.txt file. Permitted_packages []string // List of shared java libs that this module has dependencies to Libs []string Loading java/sdk_library.go +10 −0 Original line number Diff line number Diff line Loading @@ -1897,6 +1897,10 @@ type sdkLibraryImportProperties struct { // If set to true, compile dex files for the stubs. Defaults to false. Compile_dex *bool // If not empty, classes are restricted to the specified packages and their sub-packages. // This information is used to generate the updatable-bcp-packages.txt file. Permitted_packages []string } type SdkLibraryImport struct { Loading Loading @@ -2510,6 +2514,8 @@ type sdkLibrarySdkMemberProperties struct { // The paths to the doctag files to add to the prebuilt. Doctag_paths android.Paths Permitted_packages []string } type scopeProperties struct { Loading Loading @@ -2550,6 +2556,7 @@ func (s *sdkLibrarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMembe s.Shared_library = proptools.BoolPtr(sdk.sharedLibrary()) s.Compile_dex = sdk.dexProperties.Compile_dex s.Doctag_paths = sdk.doctagPaths s.Permitted_packages = sdk.PermittedPackagesForUpdatableBootJars() } func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) { Loading @@ -2562,6 +2569,9 @@ func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberCo if s.Compile_dex != nil { propertySet.AddProperty("compile_dex", *s.Compile_dex) } if len(s.Permitted_packages) > 0 { propertySet.AddProperty("permitted_packages", s.Permitted_packages) } for _, apiScope := range allApiScopes { if properties, ok := s.Scopes[apiScope]; ok { Loading sdk/bootclasspath_fragment_sdk_test.go +7 −0 Original line number Diff line number Diff line Loading @@ -327,6 +327,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -336,6 +337,7 @@ java_sdk_library_import { 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"], Loading Loading @@ -409,6 +411,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -418,6 +421,7 @@ java_sdk_library_import { 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"], Loading Loading @@ -779,6 +783,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) { srcs: ["Test.java"], compile_dex: true, public: {enabled: true}, permitted_packages: ["mysdklibrary"], } `), ).RunTest(t) Loading Loading @@ -822,6 +827,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -831,6 +837,7 @@ java_sdk_library_import { 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"], Loading sdk/java_sdk_test.go +9 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ func TestSnapshotWithJavaHeaderLibrary(t *testing.T) { sdk_version: "none", compile_dex: true, host_supported: true, permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -188,6 +189,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } `), checkVersionedAndroidBpContents(` Loading @@ -199,6 +201,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } sdk_snapshot { Loading Loading @@ -437,6 +440,7 @@ func TestSnapshotWithJavaBootLibrary(t *testing.T) { system_modules: "none", sdk_version: "none", compile_dex: true, permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -450,6 +454,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } `), checkVersionedAndroidBpContents(` Loading @@ -461,6 +466,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } module_exports_snapshot { Loading Loading @@ -1045,6 +1051,7 @@ func TestSnapshotWithJavaSdkLibrary(t *testing.T) { shared_library: false, stubs_library_visibility: ["//other"], stubs_source_visibility: ["//another"], permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -1058,6 +1065,7 @@ java_sdk_library_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:anyapex"], shared_library: false, permitted_packages: ["pkg.myjavalib"], public: { jars: ["sdk_library/public/myjavalib-stubs.jar"], stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], Loading Loading @@ -1090,6 +1098,7 @@ java_sdk_library_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:anyapex"], shared_library: false, permitted_packages: ["pkg.myjavalib"], public: { jars: ["sdk_library/public/myjavalib-stubs.jar"], stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], Loading Loading
java/java.go +14 −0 Original line number Diff line number Diff line Loading @@ -580,6 +580,10 @@ type librarySdkMemberProperties struct { JarToExport android.Path `android:"arch_variant"` AidlIncludeDirs android.Paths // The list of permitted packages that need to be passed to the prebuilts as they are used to // create the updatable-bcp-packages.txt file. PermittedPackages []string } func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) { Loading @@ -588,6 +592,8 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo p.JarToExport = ctx.MemberType().(*librarySdkMemberType).jarToExportGetter(ctx, j) p.AidlIncludeDirs = j.AidlIncludeDirs() p.PermittedPackages = j.PermittedPackagesForUpdatableBootJars() } func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) { Loading @@ -606,6 +612,10 @@ func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberConte propertySet.AddProperty("jars", []string{snapshotRelativeJavaLibPath}) } if len(p.PermittedPackages) > 0 { propertySet.AddProperty("permitted_packages", p.PermittedPackages) } // Do not copy anything else to the snapshot. if memberType.onlyCopyJarToSnapshot { return Loading Loading @@ -1126,6 +1136,10 @@ type ImportProperties struct { Installable *bool // If not empty, classes are restricted to the specified packages and their sub-packages. // This information is used to generate the updatable-bcp-packages.txt file. Permitted_packages []string // List of shared java libs that this module has dependencies to Libs []string Loading
java/sdk_library.go +10 −0 Original line number Diff line number Diff line Loading @@ -1897,6 +1897,10 @@ type sdkLibraryImportProperties struct { // If set to true, compile dex files for the stubs. Defaults to false. Compile_dex *bool // If not empty, classes are restricted to the specified packages and their sub-packages. // This information is used to generate the updatable-bcp-packages.txt file. Permitted_packages []string } type SdkLibraryImport struct { Loading Loading @@ -2510,6 +2514,8 @@ type sdkLibrarySdkMemberProperties struct { // The paths to the doctag files to add to the prebuilt. Doctag_paths android.Paths Permitted_packages []string } type scopeProperties struct { Loading Loading @@ -2550,6 +2556,7 @@ func (s *sdkLibrarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMembe s.Shared_library = proptools.BoolPtr(sdk.sharedLibrary()) s.Compile_dex = sdk.dexProperties.Compile_dex s.Doctag_paths = sdk.doctagPaths s.Permitted_packages = sdk.PermittedPackagesForUpdatableBootJars() } func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) { Loading @@ -2562,6 +2569,9 @@ func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberCo if s.Compile_dex != nil { propertySet.AddProperty("compile_dex", *s.Compile_dex) } if len(s.Permitted_packages) > 0 { propertySet.AddProperty("permitted_packages", s.Permitted_packages) } for _, apiScope := range allApiScopes { if properties, ok := s.Scopes[apiScope]; ok { Loading
sdk/bootclasspath_fragment_sdk_test.go +7 −0 Original line number Diff line number Diff line Loading @@ -327,6 +327,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -336,6 +337,7 @@ java_sdk_library_import { 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"], Loading Loading @@ -409,6 +411,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -418,6 +421,7 @@ java_sdk_library_import { 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"], Loading Loading @@ -779,6 +783,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) { srcs: ["Test.java"], compile_dex: true, public: {enabled: true}, permitted_packages: ["mysdklibrary"], } `), ).RunTest(t) Loading Loading @@ -822,6 +827,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["myapex"], jars: ["java/mybootlib.jar"], permitted_packages: ["mybootlib"], } java_sdk_library_import { Loading @@ -831,6 +837,7 @@ java_sdk_library_import { 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"], Loading
sdk/java_sdk_test.go +9 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ func TestSnapshotWithJavaHeaderLibrary(t *testing.T) { sdk_version: "none", compile_dex: true, host_supported: true, permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -188,6 +189,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } `), checkVersionedAndroidBpContents(` Loading @@ -199,6 +201,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } sdk_snapshot { Loading Loading @@ -437,6 +440,7 @@ func TestSnapshotWithJavaBootLibrary(t *testing.T) { system_modules: "none", sdk_version: "none", compile_dex: true, permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -450,6 +454,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } `), checkVersionedAndroidBpContents(` Loading @@ -461,6 +466,7 @@ java_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:platform"], jars: ["java/myjavalib.jar"], permitted_packages: ["pkg.myjavalib"], } module_exports_snapshot { Loading Loading @@ -1045,6 +1051,7 @@ func TestSnapshotWithJavaSdkLibrary(t *testing.T) { shared_library: false, stubs_library_visibility: ["//other"], stubs_source_visibility: ["//another"], permitted_packages: ["pkg.myjavalib"], } `) Loading @@ -1058,6 +1065,7 @@ java_sdk_library_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:anyapex"], shared_library: false, permitted_packages: ["pkg.myjavalib"], public: { jars: ["sdk_library/public/myjavalib-stubs.jar"], stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], Loading Loading @@ -1090,6 +1098,7 @@ java_sdk_library_import { visibility: ["//visibility:public"], apex_available: ["//apex_available:anyapex"], shared_library: false, permitted_packages: ["pkg.myjavalib"], public: { jars: ["sdk_library/public/myjavalib-stubs.jar"], stub_srcs: ["sdk_library/public/myjavalib_stub_sources"], Loading