Move monolithic stub flags generation to platform_bootclasspath
As part of that this change: * Moves code that will be common to platform_bootclasspath and bootclasspath_fragment from hiddenapi_singleton.go into hiddenapi_modular.go. * Fixes the tests in hiddenapi_singleton_test.go but intentionally does not rename them or move them into a more appropriate place so as to make it easier to see the differences. A TODO has been added and these will be cleaned up in a follow up change. Bug: 179354495 Test: verified that the monolithic out/soong/hiddenapi/... files are unchanged by this change Change-Id: I680e4dab2e6bdf4a655fa9f255c195175904667e
This commit is contained in:
@@ -140,6 +140,8 @@ func (b *platformBootclasspathModule) OutputFiles(tag string) (android.Paths, er
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
b.hiddenAPIDepsMutator(ctx)
|
||||
|
||||
if SkipDexpreoptBootJars(ctx) {
|
||||
return
|
||||
}
|
||||
@@ -149,6 +151,16 @@ func (b *platformBootclasspathModule) DepsMutator(ctx android.BottomUpMutatorCon
|
||||
dexpreopt.RegisterToolDeps(ctx)
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) hiddenAPIDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
|
||||
return
|
||||
}
|
||||
|
||||
// Add dependencies onto the stub lib modules.
|
||||
sdkKindToStubLibModules := hiddenAPIComputeMonolithicStubLibModules(ctx.Config())
|
||||
hiddenAPIAddStubLibDependencies(ctx, sdkKindToStubLibModules)
|
||||
}
|
||||
|
||||
func platformBootclasspathDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
m := ctx.Module()
|
||||
if p, ok := m.(*platformBootclasspathModule); ok {
|
||||
@@ -353,10 +365,24 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
|
||||
baseFlagsPath := hiddenAPISingletonPaths(ctx).stubFlags
|
||||
ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, flagFileInfo)
|
||||
|
||||
b.generateHiddenAPIStubFlagsRules(ctx, hiddenAPISupportingModules)
|
||||
b.generateHiddenAPIIndexRules(ctx, hiddenAPISupportingModules)
|
||||
b.generatedHiddenAPIMetadataRules(ctx, hiddenAPISupportingModules)
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) generateHiddenAPIStubFlagsRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) {
|
||||
bootDexJars := android.Paths{}
|
||||
for _, module := range modules {
|
||||
bootDexJars = append(bootDexJars, module.bootDexJar())
|
||||
}
|
||||
|
||||
sdkKindToStubPaths := hiddenAPIGatherStubLibDexJarPaths(ctx)
|
||||
|
||||
outputPath := hiddenAPISingletonPaths(ctx).stubFlags
|
||||
rule := ruleToGenerateHiddenAPIStubFlagsFile(ctx, outputPath, bootDexJars, sdkKindToStubPaths)
|
||||
rule.Build("platform-bootclasspath-monolithic-hiddenapi-stub-flags", "monolithic hidden API stub flags")
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) {
|
||||
indexes := android.Paths{}
|
||||
for _, module := range modules {
|
||||
|
Reference in New Issue
Block a user