Update java_api_library prop name
Context - Update java_api_library module's prop name from api_providers to api_contributions to adjust to module rename - Update variables name correspondingly to enhance readability Test: m Change-Id: I93b941a572e04bed6084109d151ba83a82715651
This commit is contained in:
27
java/java.go
27
java/java.go
@@ -1580,8 +1580,8 @@ type JavaApiLibraryProperties struct {
|
||||
// name of the API surface
|
||||
Api_surface *string
|
||||
|
||||
// list of API provider modules that consists this API surface
|
||||
Api_providers []string
|
||||
// list of Java API contribution modules that consists this API surface
|
||||
Api_contributions []string
|
||||
|
||||
// List of flags to be passed to the javac compiler to generate jar file
|
||||
Javacflags []string
|
||||
@@ -1649,12 +1649,12 @@ func (al *ApiLibrary) stubsFlags(ctx android.ModuleContext, cmd *android.RuleBui
|
||||
}
|
||||
}
|
||||
|
||||
var javaApiProviderTag = dependencyTag{name: "java-api-provider"}
|
||||
var javaApiContributionTag = dependencyTag{name: "java-api-contribution"}
|
||||
|
||||
func (al *ApiLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
apiProviders := al.properties.Api_providers
|
||||
for _, apiProviderName := range apiProviders {
|
||||
ctx.AddDependency(ctx.Module(), javaApiProviderTag, apiProviderName)
|
||||
apiContributions := al.properties.Api_contributions
|
||||
for _, apiContributionName := range apiContributions {
|
||||
ctx.AddDependency(ctx.Module(), javaApiContributionTag, apiContributionName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1673,16 +1673,11 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
homeDir := android.PathForModuleOut(ctx, "metalava", "home")
|
||||
|
||||
apiProviders := al.properties.Api_providers
|
||||
srcFiles := make([]android.Path, len(apiProviders))
|
||||
for i, apiProviderName := range apiProviders {
|
||||
apiProvider := ctx.GetDirectDepWithTag(apiProviderName, javaApiProviderTag)
|
||||
if apiProvider == nil {
|
||||
panic(fmt.Errorf("Java API provider module %s not found, called from %s", apiProviderName, al.Name()))
|
||||
}
|
||||
provider := ctx.OtherModuleProvider(apiProvider, JavaApiImportProvider).(JavaApiImportInfo)
|
||||
srcFiles[i] = android.PathForModuleSrc(ctx, provider.ApiFile.String())
|
||||
}
|
||||
var srcFiles []android.Path
|
||||
ctx.VisitDirectDepsWithTag(javaApiContributionTag, func(dep android.Module) {
|
||||
provider := ctx.OtherModuleProvider(dep, JavaApiImportProvider).(JavaApiImportInfo)
|
||||
srcFiles = append(srcFiles, android.PathForModuleSrc(ctx, provider.ApiFile.String()))
|
||||
})
|
||||
|
||||
cmd := metalavaStubCmd(ctx, rule, srcFiles, homeDir)
|
||||
|
||||
|
Reference in New Issue
Block a user