diff options
author | 2024-08-12 18:23:59 +0000 | |
---|---|---|
committer | 2024-08-12 22:50:19 +0000 | |
commit | 663e4508dc4fe228696ede997d5fca24e4c1431e (patch) | |
tree | 9b7af2c4054009b226b492484224bc598f4d7ae8 /java | |
parent | 703c2e3d64aff7950a8485a2c46fe15b0f91d89e (diff) |
Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
Diffstat (limited to 'java')
-rw-r--r-- | java/aar_test.go | 2 | ||||
-rw-r--r-- | java/bootclasspath_fragment_test.go | 4 | ||||
-rw-r--r-- | java/code_metadata_test.go | 2 | ||||
-rw-r--r-- | java/dexpreopt_bootjars.go | 2 | ||||
-rw-r--r-- | java/dexpreopt_config_testing.go | 2 | ||||
-rw-r--r-- | java/java_test.go | 10 | ||||
-rw-r--r-- | java/jdeps.go | 2 | ||||
-rw-r--r-- | java/lint.go | 2 | ||||
-rw-r--r-- | java/sdk.go | 2 | ||||
-rw-r--r-- | java/sdk_library_test.go | 2 | ||||
-rw-r--r-- | java/system_modules_test.go | 2 | ||||
-rw-r--r-- | java/test_spec_test.go | 2 | ||||
-rw-r--r-- | java/testing.go | 4 |
13 files changed, 19 insertions, 19 deletions
diff --git a/java/aar_test.go b/java/aar_test.go index ebad310ab..877e2c7d6 100644 --- a/java/aar_test.go +++ b/java/aar_test.go @@ -53,7 +53,7 @@ func TestAarImportProducesJniPackages(t *testing.T) { appMod := ctx.Module(tc.name, "android_common") appTestMod := ctx.ModuleForTests(tc.name, "android_common") - info, ok := android.SingletonModuleProvider(ctx, appMod, JniPackageProvider) + info, ok := android.OtherModuleProvider(ctx, appMod, JniPackageProvider) if !ok { t.Errorf("expected android_library_import to have JniPackageProvider") } diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go index d72417afa..60f1a50e1 100644 --- a/java/bootclasspath_fragment_test.go +++ b/java/bootclasspath_fragment_test.go @@ -273,7 +273,7 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) { `) fragment := result.Module("myfragment", "android_common") - info, _ := android.SingletonModuleProvider(result, fragment, HiddenAPIInfoProvider) + info, _ := android.OtherModuleProvider(result, fragment, HiddenAPIInfoProvider) stubsJar := "out/soong/.intermediates/mystublib/android_common/dex/mystublib.jar" @@ -457,7 +457,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) { // Make sure that the library exports hidden API properties for use by the bootclasspath_fragment. library := result.Module("mynewlibrary", "android_common") - info, _ := android.SingletonModuleProvider(result, library, hiddenAPIPropertyInfoProvider) + info, _ := android.OtherModuleProvider(result, library, hiddenAPIPropertyInfoProvider) android.AssertArrayString(t, "split packages", []string{"sdklibrary", "newlibrary"}, info.SplitPackages) android.AssertArrayString(t, "package prefixes", []string{"newlibrary.all.mine"}, info.PackagePrefixes) android.AssertArrayString(t, "single packages", []string{"newlibrary.mine"}, info.SinglePackages) diff --git a/java/code_metadata_test.go b/java/code_metadata_test.go index 99b1f5226..9dc9a2262 100644 --- a/java/code_metadata_test.go +++ b/java/code_metadata_test.go @@ -29,7 +29,7 @@ func TestCodeMetadata(t *testing.T) { module := result.ModuleForTests("module-name", "") // Check that the provider has the right contents - data, _ := android.SingletonModuleProvider(result, module.Module(), soongTesting.CodeMetadataProviderKey) + data, _ := android.OtherModuleProvider(result, module.Module(), soongTesting.CodeMetadataProviderKey) if !strings.HasSuffix( data.IntermediatePath.String(), "/intermediateCodeMetadata.pb", ) { diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index 56e007bbf..a81ab8316 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -1341,7 +1341,7 @@ func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) { image := d.defaultBootImage if image != nil { - if profileInstallInfo, ok := android.SingletonModuleProvider(ctx, d, profileInstallInfoProvider); ok { + if profileInstallInfo, ok := android.OtherModuleProvider(ctx, d, profileInstallInfoProvider); ok { ctx.Strict("DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED", profileInstallInfo.profileInstalls.String()) if profileInstallInfo.profileLicenseMetadataFile.Valid() { ctx.Strict("DEXPREOPT_IMAGE_PROFILE_LICENSE_METADATA", profileInstallInfo.profileLicenseMetadataFile.String()) diff --git a/java/dexpreopt_config_testing.go b/java/dexpreopt_config_testing.go index 104829f5f..37c54b915 100644 --- a/java/dexpreopt_config_testing.go +++ b/java/dexpreopt_config_testing.go @@ -1237,7 +1237,7 @@ func nestedCheckBootImageConfig(t *testing.T, result *android.TestResult, imageC if !mutated { dexBootJarModule := result.ModuleForTests("dex_bootjars", "android_common") - profileInstallInfo, _ := android.SingletonModuleProvider(result, dexBootJarModule.Module(), profileInstallInfoProvider) + profileInstallInfo, _ := android.OtherModuleProvider(result, dexBootJarModule.Module(), profileInstallInfoProvider) assertInstallsEqual(t, "profileInstalls", expected.profileInstalls, profileInstallInfo.profileInstalls) android.AssertStringEquals(t, "profileLicenseMetadataFile", expected.profileLicenseMetadataFile, profileInstallInfo.profileLicenseMetadataFile.RelativeToTop().String()) } diff --git a/java/java_test.go b/java/java_test.go index 86bfe9fe4..477a0b385 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1100,7 +1100,7 @@ func TestJavaImport(t *testing.T) { source := ctx.ModuleForTests("source_library", "android_common") sourceJar := source.Output("javac/source_library.jar") sourceHeaderJar := source.Output("turbine-combined/source_library.jar") - sourceJavaInfo, _ := android.SingletonModuleProvider(ctx, source.Module(), JavaInfoProvider) + sourceJavaInfo, _ := android.OtherModuleProvider(ctx, source.Module(), JavaInfoProvider) // The source library produces separate implementation and header jars android.AssertPathsRelativeToTopEquals(t, "source library implementation jar", @@ -1110,7 +1110,7 @@ func TestJavaImport(t *testing.T) { importWithNoDeps := ctx.ModuleForTests("import_with_no_deps", "android_common") importWithNoDepsJar := importWithNoDeps.Output("combined/import_with_no_deps.jar") - importWithNoDepsJavaInfo, _ := android.SingletonModuleProvider(ctx, importWithNoDeps.Module(), JavaInfoProvider) + importWithNoDepsJavaInfo, _ := android.OtherModuleProvider(ctx, importWithNoDeps.Module(), JavaInfoProvider) // An import with no deps produces a single jar used as both the header and implementation jar. android.AssertPathsRelativeToTopEquals(t, "import with no deps implementation jar", @@ -1123,7 +1123,7 @@ func TestJavaImport(t *testing.T) { importWithSourceDeps := ctx.ModuleForTests("import_with_source_deps", "android_common") importWithSourceDepsJar := importWithSourceDeps.Output("combined/import_with_source_deps.jar") importWithSourceDepsHeaderJar := importWithSourceDeps.Output("turbine-combined/import_with_source_deps.jar") - importWithSourceDepsJavaInfo, _ := android.SingletonModuleProvider(ctx, importWithSourceDeps.Module(), JavaInfoProvider) + importWithSourceDepsJavaInfo, _ := android.OtherModuleProvider(ctx, importWithSourceDeps.Module(), JavaInfoProvider) // An import with source deps produces separate header and implementation jars. android.AssertPathsRelativeToTopEquals(t, "import with source deps implementation jar", @@ -1137,7 +1137,7 @@ func TestJavaImport(t *testing.T) { importWithImportDeps := ctx.ModuleForTests("import_with_import_deps", "android_common") importWithImportDepsJar := importWithImportDeps.Output("combined/import_with_import_deps.jar") - importWithImportDepsJavaInfo, _ := android.SingletonModuleProvider(ctx, importWithImportDeps.Module(), JavaInfoProvider) + importWithImportDepsJavaInfo, _ := android.OtherModuleProvider(ctx, importWithImportDeps.Module(), JavaInfoProvider) // An import with only import deps produces a single jar used as both the header and implementation jar. android.AssertPathsRelativeToTopEquals(t, "import with import deps implementation jar", @@ -2274,7 +2274,7 @@ func TestTransitiveSrcFiles(t *testing.T) { } `) c := ctx.ModuleForTests("c", "android_common").Module() - javaInfo, _ := android.SingletonModuleProvider(ctx, c, JavaInfoProvider) + javaInfo, _ := android.OtherModuleProvider(ctx, c, JavaInfoProvider) transitiveSrcFiles := android.Paths(javaInfo.TransitiveSrcFiles.ToList()) android.AssertArrayString(t, "unexpected jar deps", []string{"b.java", "c.java"}, transitiveSrcFiles.Strings()) } diff --git a/java/jdeps.go b/java/jdeps.go index 340026318..e856b37ee 100644 --- a/java/jdeps.go +++ b/java/jdeps.go @@ -89,7 +89,7 @@ func (j *jdepsGeneratorSingleton) GenerateBuildActions(ctx android.SingletonCont dpInfo.Classes = append(dpInfo.Classes, data.Class) } - if dep, ok := android.SingletonModuleProvider(ctx, module, JavaInfoProvider); ok { + if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok { dpInfo.Installed_paths = append(dpInfo.Installed_paths, dep.ImplementationJars.Strings()...) } dpInfo.Classes = android.FirstUniqueStrings(dpInfo.Classes) diff --git a/java/lint.go b/java/lint.go index 2eea07d31..6782adc5f 100644 --- a/java/lint.go +++ b/java/lint.go @@ -650,7 +650,7 @@ func (l *lintSingleton) generateLintReportZips(ctx android.SingletonContext) { } if apex, ok := m.(android.ApexModule); ok && apex.NotAvailableForPlatform() { - apexInfo, _ := android.SingletonModuleProvider(ctx, m, android.ApexInfoProvider) + apexInfo, _ := android.OtherModuleProvider(ctx, m, android.ApexInfoProvider) if apexInfo.IsForPlatform() { // There are stray platform variants of modules in apexes that are not available for // the platform, and they sometimes can't be built. Don't depend on them. diff --git a/java/sdk.go b/java/sdk.go index 4ef4ee251..dd198ac57 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -278,7 +278,7 @@ func createFrameworkAidl(stubsModules []string, path android.WritablePath, ctx a ctx.VisitAllModules(func(module android.Module) { // Collect dex jar paths for the modules listed above. - if j, ok := android.SingletonModuleProvider(ctx, module, JavaInfoProvider); ok { + if j, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok { name := ctx.ModuleName(module) if i := android.IndexList(name, stubsModules); i != -1 { stubsJars[i] = j.HeaderJars diff --git a/java/sdk_library_test.go b/java/sdk_library_test.go index 368eca7f2..52d4af0fd 100644 --- a/java/sdk_library_test.go +++ b/java/sdk_library_test.go @@ -130,7 +130,7 @@ func TestJavaSdkLibrary(t *testing.T) { result.ModuleForTests("foo.api.system.28", "") result.ModuleForTests("foo.api.test.28", "") - exportedComponentsInfo, _ := android.SingletonModuleProvider(result, foo.Module(), android.ExportedComponentsInfoProvider) + exportedComponentsInfo, _ := android.OtherModuleProvider(result, foo.Module(), android.ExportedComponentsInfoProvider) expectedFooExportedComponents := []string{ "foo-removed.api.combined.public.latest", "foo-removed.api.combined.system.latest", diff --git a/java/system_modules_test.go b/java/system_modules_test.go index 1a8d0b5d5..b05b0e497 100644 --- a/java/system_modules_test.go +++ b/java/system_modules_test.go @@ -25,7 +25,7 @@ func getModuleHeaderJarsAsRelativeToTopPaths(result *android.TestResult, moduleN paths := []string{} for _, moduleName := range moduleNames { module := result.Module(moduleName, "android_common") - info, _ := android.SingletonModuleProvider(result, module, JavaInfoProvider) + info, _ := android.OtherModuleProvider(result, module, JavaInfoProvider) paths = append(paths, info.HeaderJars.RelativeToTop().Strings()...) } return paths diff --git a/java/test_spec_test.go b/java/test_spec_test.go index 4144dad69..f0a5fdb4b 100644 --- a/java/test_spec_test.go +++ b/java/test_spec_test.go @@ -32,7 +32,7 @@ func TestTestSpec(t *testing.T) { module := result.ModuleForTests("module-name", "") // Check that the provider has the right contents - data, _ := android.SingletonModuleProvider(result, module.Module(), soongTesting.TestSpecProviderKey) + data, _ := android.OtherModuleProvider(result, module.Module(), soongTesting.TestSpecProviderKey) if !strings.HasSuffix( data.IntermediatePath.String(), "/intermediateTestSpecMetadata.pb", ) { diff --git a/java/testing.go b/java/testing.go index a99baf8a2..e1bf5376e 100644 --- a/java/testing.go +++ b/java/testing.go @@ -632,7 +632,7 @@ func CheckPlatformBootclasspathModules(t *testing.T, result *android.TestResult, func CheckClasspathFragmentProtoContentInfoProvider(t *testing.T, result *android.TestResult, generated bool, contents, outputFilename, installDir string) { t.Helper() p := result.Module("platform-bootclasspath", "android_common").(*platformBootclasspathModule) - info, _ := android.SingletonModuleProvider(result, p, ClasspathFragmentProtoContentInfoProvider) + info, _ := android.OtherModuleProvider(result, p, ClasspathFragmentProtoContentInfoProvider) android.AssertBoolEquals(t, "classpath proto generated", generated, info.ClasspathFragmentProtoGenerated) android.AssertStringEquals(t, "classpath proto contents", contents, info.ClasspathFragmentProtoContents.String()) @@ -652,7 +652,7 @@ func ApexNamePairsFromModules(ctx *android.TestContext, modules []android.Module func apexNamePairFromModule(ctx *android.TestContext, module android.Module) string { name := module.Name() var apex string - apexInfo, _ := android.SingletonModuleProvider(ctx, module, android.ApexInfoProvider) + apexInfo, _ := android.OtherModuleProvider(ctx, module, android.ApexInfoProvider) if apexInfo.IsForPlatform() { apex = "platform" } else { |