Merge "Build updatable-bcp-packages.txt from prebuilts in sdk snapshot"

This commit is contained in:
Paul Duffin
2021-07-15 14:58:12 +00:00
committed by Gerrit Code Review
4 changed files with 19 additions and 0 deletions

View File

@@ -398,6 +398,7 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) {
name: "foo", name: "foo",
prefer: false, prefer: false,
shared_library: false, shared_library: false,
permitted_packages: ["foo"],
public: { public: {
jars: ["sdk_library/public/foo-stubs.jar"], jars: ["sdk_library/public/foo-stubs.jar"],
stub_srcs: ["sdk_library/public/foo_stub_sources"], stub_srcs: ["sdk_library/public/foo_stub_sources"],

View File

@@ -1192,6 +1192,12 @@ type Import struct {
minSdkVersion android.SdkSpec minSdkVersion android.SdkSpec
} }
var _ PermittedPackagesForUpdatableBootJars = (*Import)(nil)
func (j *Import) PermittedPackagesForUpdatableBootJars() []string {
return j.properties.Permitted_packages
}
func (j *Import) SdkVersion(ctx android.EarlyModuleContext) android.SdkSpec { func (j *Import) SdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
return android.SdkSpecFrom(ctx, String(j.properties.Sdk_version)) return android.SdkSpecFrom(ctx, String(j.properties.Sdk_version))
} }

View File

@@ -1999,6 +1999,12 @@ func sdkLibraryImportFactory() android.Module {
return module return module
} }
var _ PermittedPackagesForUpdatableBootJars = (*SdkLibraryImport)(nil)
func (module *SdkLibraryImport) PermittedPackagesForUpdatableBootJars() []string {
return module.properties.Permitted_packages
}
func (module *SdkLibraryImport) Prebuilt() *android.Prebuilt { func (module *SdkLibraryImport) Prebuilt() *android.Prebuilt {
return &module.prebuilt return &module.prebuilt
} }

View File

@@ -513,6 +513,12 @@ sdk_snapshot {
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
snapshot/hiddenapi/index.csv snapshot/hiddenapi/index.csv
`, rule) `, rule)
// Make sure that the permitted packages from the prebuilts end up in the
// updatable-bcp-packages.txt file.
rule = module.Output("updatable-bcp-packages.txt")
expectedContents := `'mybootlib\nmyothersdklibrary\n'`
android.AssertStringEquals(t, "updatable-bcp-packages.txt", expectedContents, rule.Args["content"])
}), }),
snapshotTestPreparer(checkSnapshotWithSourcePreferred, preparerForSnapshot), snapshotTestPreparer(checkSnapshotWithSourcePreferred, preparerForSnapshot),
snapshotTestPreparer(checkSnapshotPreferredWithSource, preparerForSnapshot), snapshotTestPreparer(checkSnapshotPreferredWithSource, preparerForSnapshot),