Loading apex/apex_test.go +24 −0 Original line number Diff line number Diff line Loading @@ -6227,6 +6227,9 @@ func TestOverrideApex(t *testing.T) { name: "mybootclasspath_fragment", contents: ["bcplib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading @@ -6241,6 +6244,9 @@ func TestOverrideApex(t *testing.T) { name: "override_bootclasspath_fragment", contents: ["override_bcplib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -7294,6 +7300,9 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi apex_available: [ "some-non-updatable-apex", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -7352,6 +7361,9 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi apex_available: [ "com.android.art.debug", ], hidden_api: { split_packages: ["*"], }, } apex_key { Loading Loading @@ -8695,6 +8707,9 @@ func TestApexJavaCoverage(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -9015,6 +9030,9 @@ func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_sdk_library { Loading Loading @@ -9115,6 +9133,9 @@ func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_sdk_library { Loading Loading @@ -9334,6 +9355,9 @@ func TestApexStrictUpdtabilityLintBcpFragmentDeps(t *testing.T) { name: "mybootclasspathfragment", contents: ["myjavalib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { name: "myjavalib", Loading apex/bootclasspath_fragment_test.go +33 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ func TestBootclasspathFragments(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } `, ) Loading Loading @@ -209,6 +212,9 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } bootclasspath_fragment { Loading @@ -220,6 +226,9 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `, ) Loading Loading @@ -361,6 +370,9 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } `, contentsInsert(contents)) Loading Loading @@ -853,6 +865,9 @@ func TestBootclasspathFragmentContentsNoName(t *testing.T) { apex_available: [ "myapex", ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -959,6 +974,9 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1010,6 +1028,9 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -1123,6 +1144,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1175,6 +1199,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -1282,6 +1309,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1334,6 +1364,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading apex/classpath_element_test.go +6 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ func TestCreateClasspathElements(t *testing.T) { "baz", "quuz", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -134,6 +137,9 @@ func TestCreateClasspathElements(t *testing.T) { contents: [ "bar", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading apex/platform_bootclasspath_test.go +22 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ func TestPlatformBootclasspath_Fragments(t *testing.T) { unsupported_packages: [ "bar-unsupported-packages.txt", ], split_packages: ["*"], }, } Loading Loading @@ -274,6 +275,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { "baz", "quuz", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -317,6 +321,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { name: "my-bootclasspath-fragment", contents: ["bar"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } apex_key { Loading Loading @@ -482,6 +489,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) { contents: [ "foo", "bar", ], hidden_api: { split_packages: ["*"], }, } prebuilt_bootclasspath_fragment { Loading Loading @@ -599,6 +609,9 @@ func TestPlatformBootclasspath_IncludesRemainingApexJars(t *testing.T) { generate_classpaths_proto: false, contents: ["foo"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -656,6 +669,9 @@ func TestBootJarNotInApex(t *testing.T) { contents: [ "foo", ], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading Loading @@ -696,6 +712,9 @@ func TestBootFragmentNotInApex(t *testing.T) { bootclasspath_fragment { name: "not-in-apex-fragment", contents: ["foo"], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading Loading @@ -746,6 +765,9 @@ func TestNonBootJarInFragment(t *testing.T) { name: "apex-fragment", contents: ["foo", "bar"], apex_available:[ "myapex" ], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading java/bootclasspath_fragment.go +10 −3 Original line number Diff line number Diff line Loading @@ -858,11 +858,18 @@ func (b *BootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleC packagePrefixes := b.sourceOnlyProperties.Hidden_api.Package_prefixes singlePackages := b.sourceOnlyProperties.Hidden_api.Single_packages if splitPackages != nil || packagePrefixes != nil || singlePackages != nil { if splitPackages == nil { splitPackages = []string{"*"} } output.SignaturePatternsPath = buildRuleSignaturePatternsFile( ctx, output.AllFlagsPath, splitPackages, packagePrefixes, singlePackages) } else if !b.isTestFragment() { ctx.ModuleErrorf(`Must specify at least one of the split_packages, package_prefixes and single_packages properties If this is a new bootclasspath_fragment or you are unsure what to do add the the following to the bootclasspath_fragment: hidden_api: {split_packages: ["*"]}, and then run the following: m analyze_bcpf && analyze_bcpf --bcpf %q it will analyze the bootclasspath_fragment and provide hints as to what you should specify here. If you are happy with its suggestions then you can add the --fix option and it will fix them for you.`, b.BaseModuleName()) } return output Loading Loading
apex/apex_test.go +24 −0 Original line number Diff line number Diff line Loading @@ -6227,6 +6227,9 @@ func TestOverrideApex(t *testing.T) { name: "mybootclasspath_fragment", contents: ["bcplib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading @@ -6241,6 +6244,9 @@ func TestOverrideApex(t *testing.T) { name: "override_bootclasspath_fragment", contents: ["override_bcplib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -7294,6 +7300,9 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi apex_available: [ "some-non-updatable-apex", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -7352,6 +7361,9 @@ func testNoUpdatableJarsInBootImage(t *testing.T, errmsg string, preparer androi apex_available: [ "com.android.art.debug", ], hidden_api: { split_packages: ["*"], }, } apex_key { Loading Loading @@ -8695,6 +8707,9 @@ func TestApexJavaCoverage(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -9015,6 +9030,9 @@ func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_sdk_library { Loading Loading @@ -9115,6 +9133,9 @@ func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) { name: "mybootclasspathfragment", contents: ["mybootclasspathlib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_sdk_library { Loading Loading @@ -9334,6 +9355,9 @@ func TestApexStrictUpdtabilityLintBcpFragmentDeps(t *testing.T) { name: "mybootclasspathfragment", contents: ["myjavalib"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { name: "myjavalib", Loading
apex/bootclasspath_fragment_test.go +33 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ func TestBootclasspathFragments(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } `, ) Loading Loading @@ -209,6 +212,9 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } bootclasspath_fragment { Loading @@ -220,6 +226,9 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `, ) Loading Loading @@ -361,6 +370,9 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } `, contentsInsert(contents)) Loading Loading @@ -853,6 +865,9 @@ func TestBootclasspathFragmentContentsNoName(t *testing.T) { apex_available: [ "myapex", ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -959,6 +974,9 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1010,6 +1028,9 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -1123,6 +1144,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) { apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1175,6 +1199,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) { module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading Loading @@ -1282,6 +1309,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test apex_available: [ "com.android.art", ], hidden_api: { split_packages: ["*"], }, } apex { Loading Loading @@ -1334,6 +1364,9 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test module: "art-bootclasspath-fragment", }, ], hidden_api: { split_packages: ["*"], }, } `) Loading
apex/classpath_element_test.go +6 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,9 @@ func TestCreateClasspathElements(t *testing.T) { "baz", "quuz", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -134,6 +137,9 @@ func TestCreateClasspathElements(t *testing.T) { contents: [ "bar", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading
apex/platform_bootclasspath_test.go +22 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ func TestPlatformBootclasspath_Fragments(t *testing.T) { unsupported_packages: [ "bar-unsupported-packages.txt", ], split_packages: ["*"], }, } Loading Loading @@ -274,6 +275,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { "baz", "quuz", ], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -317,6 +321,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { name: "my-bootclasspath-fragment", contents: ["bar"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } apex_key { Loading Loading @@ -482,6 +489,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) { contents: [ "foo", "bar", ], hidden_api: { split_packages: ["*"], }, } prebuilt_bootclasspath_fragment { Loading Loading @@ -599,6 +609,9 @@ func TestPlatformBootclasspath_IncludesRemainingApexJars(t *testing.T) { generate_classpaths_proto: false, contents: ["foo"], apex_available: ["myapex"], hidden_api: { split_packages: ["*"], }, } java_library { Loading Loading @@ -656,6 +669,9 @@ func TestBootJarNotInApex(t *testing.T) { contents: [ "foo", ], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading Loading @@ -696,6 +712,9 @@ func TestBootFragmentNotInApex(t *testing.T) { bootclasspath_fragment { name: "not-in-apex-fragment", contents: ["foo"], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading Loading @@ -746,6 +765,9 @@ func TestNonBootJarInFragment(t *testing.T) { name: "apex-fragment", contents: ["foo", "bar"], apex_available:[ "myapex" ], hidden_api: { split_packages: ["*"], }, } platform_bootclasspath { Loading
java/bootclasspath_fragment.go +10 −3 Original line number Diff line number Diff line Loading @@ -858,11 +858,18 @@ func (b *BootclasspathFragmentModule) produceHiddenAPIOutput(ctx android.ModuleC packagePrefixes := b.sourceOnlyProperties.Hidden_api.Package_prefixes singlePackages := b.sourceOnlyProperties.Hidden_api.Single_packages if splitPackages != nil || packagePrefixes != nil || singlePackages != nil { if splitPackages == nil { splitPackages = []string{"*"} } output.SignaturePatternsPath = buildRuleSignaturePatternsFile( ctx, output.AllFlagsPath, splitPackages, packagePrefixes, singlePackages) } else if !b.isTestFragment() { ctx.ModuleErrorf(`Must specify at least one of the split_packages, package_prefixes and single_packages properties If this is a new bootclasspath_fragment or you are unsure what to do add the the following to the bootclasspath_fragment: hidden_api: {split_packages: ["*"]}, and then run the following: m analyze_bcpf && analyze_bcpf --bcpf %q it will analyze the bootclasspath_fragment and provide hints as to what you should specify here. If you are happy with its suggestions then you can add the --fix option and it will fix them for you.`, b.BaseModuleName()) } return output Loading