summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
author mrziwang <mrziwang@google.com> 2024-06-27 09:58:58 -0700
committer mrziwang <mrziwang@google.com> 2024-06-27 14:23:52 -0700
commit444762b467f5e859a1496079d04ab19496fa0ac2 (patch)
tree2a9575522dbe629c5876e3870bc0dc2240a9b967 /java/platform_bootclasspath.go
parentc78f893938adc74a763260eb49d2256e550e8dd2 (diff)
Use OutputFilesProvider on platformBootclasspathModule
In the context of incremental soong, the output files inter-module-communication will be through OutputFilesProvider. The OutputFileProducer interface will be deprecated. Test: CI Bug: 339477385 Change-Id: I2a5317ae92a11df0a2cb9f803121d03e16859cb2
Diffstat (limited to 'java/platform_bootclasspath.go')
-rw-r--r--java/platform_bootclasspath.go32
1 files changed, 7 insertions, 25 deletions
diff --git a/java/platform_bootclasspath.go b/java/platform_bootclasspath.go
index 8d4cf6823..38553a61b 100644
--- a/java/platform_bootclasspath.go
+++ b/java/platform_bootclasspath.go
@@ -15,8 +15,6 @@
package java
import (
- "fmt"
-
"android/soong/android"
"android/soong/dexpreopt"
)
@@ -57,9 +55,6 @@ type platformBootclasspathModule struct {
// Path to the monolithic hiddenapi-unsupported.csv file.
hiddenAPIMetadataCSV android.OutputPath
-
- // Path to a srcjar containing all the transitive sources of the bootclasspath.
- srcjar android.OutputPath
}
type platformBootclasspathProperties struct {
@@ -76,8 +71,6 @@ func platformBootclasspathFactory() android.SingletonModule {
return m
}
-var _ android.OutputFileProducer = (*platformBootclasspathModule)(nil)
-
func (b *platformBootclasspathModule) AndroidMkEntries() (entries []android.AndroidMkEntries) {
entries = append(entries, android.AndroidMkEntries{
Class: "FAKE",
@@ -89,22 +82,6 @@ func (b *platformBootclasspathModule) AndroidMkEntries() (entries []android.Andr
return
}
-// Make the hidden API files available from the platform-bootclasspath module.
-func (b *platformBootclasspathModule) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "hiddenapi-flags.csv":
- return android.Paths{b.hiddenAPIFlagsCSV}, nil
- case "hiddenapi-index.csv":
- return android.Paths{b.hiddenAPIIndexCSV}, nil
- case "hiddenapi-metadata.csv":
- return android.Paths{b.hiddenAPIMetadataCSV}, nil
- case ".srcjar":
- return android.Paths{b.srcjar}, nil
- }
-
- return nil, fmt.Errorf("unknown tag %s", tag)
-}
-
func (b *platformBootclasspathModule) DepsMutator(ctx android.BottomUpMutatorContext) {
// Create a dependency on all_apex_contributions to determine the selected mainline module
ctx.AddDependency(ctx.Module(), apexContributionsMetadataDepTag, "all_apex_contributions")
@@ -198,8 +175,8 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
}
jarArgs := resourcePathsToJarArgs(transitiveSrcFiles)
jarArgs = append(jarArgs, "-srcjar") // Move srcfiles to the right package
- b.srcjar = android.PathForModuleOut(ctx, ctx.ModuleName()+"-transitive.srcjar").OutputPath
- TransformResourcesToJar(ctx, b.srcjar, jarArgs, transitiveSrcFiles)
+ srcjar := android.PathForModuleOut(ctx, ctx.ModuleName()+"-transitive.srcjar").OutputPath
+ TransformResourcesToJar(ctx, srcjar, jarArgs, transitiveSrcFiles)
// Gather all the fragments dependencies.
b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag)
@@ -213,6 +190,11 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
bootDexJarByModule := b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments)
buildRuleForBootJarsPackageCheck(ctx, bootDexJarByModule)
+
+ ctx.SetOutputFiles(android.Paths{b.hiddenAPIFlagsCSV}, "hiddenapi-flags.csv")
+ ctx.SetOutputFiles(android.Paths{b.hiddenAPIIndexCSV}, "hiddenapi-index.csv")
+ ctx.SetOutputFiles(android.Paths{b.hiddenAPIMetadataCSV}, "hiddenapi-metadata.csv")
+ ctx.SetOutputFiles(android.Paths{srcjar}, ".srcjar")
}
// Generate classpaths.proto config