Merge "Make ruleToGenerateHiddenAPIStubFlagsFile build rule" am: 49c91f32b2
am: 3a5056f429
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745333 Change-Id: I3bb3957639442ee0e30e15d7abe230feea23547e
This commit is contained in:
@@ -232,11 +232,11 @@ func hiddenAPIRetrieveDexJarBuildPath(ctx android.ModuleContext, module android.
|
|||||||
return dexJar
|
return dexJar
|
||||||
}
|
}
|
||||||
|
|
||||||
// ruleToGenerateHiddenAPIStubFlagsFile creates a rule to create a hidden API stub flags file.
|
// buildRuleToGenerateHiddenAPIStubFlagsFile creates a rule to create a hidden API stub flags file.
|
||||||
//
|
//
|
||||||
// The rule is initialized but not built so that the caller can modify it and select an appropriate
|
// The rule is initialized but not built so that the caller can modify it and select an appropriate
|
||||||
// name.
|
// name.
|
||||||
func ruleToGenerateHiddenAPIStubFlagsFile(ctx android.BuilderContext, outputPath android.WritablePath, bootDexJars android.Paths, input HiddenAPIFlagInput) *android.RuleBuilder {
|
func buildRuleToGenerateHiddenAPIStubFlagsFile(ctx android.BuilderContext, name, desc string, outputPath android.WritablePath, bootDexJars android.Paths, input HiddenAPIFlagInput) {
|
||||||
// Singleton rule which applies hiddenapi on all boot class path dex files.
|
// Singleton rule which applies hiddenapi on all boot class path dex files.
|
||||||
rule := android.NewRuleBuilder(pctx, ctx)
|
rule := android.NewRuleBuilder(pctx, ctx)
|
||||||
|
|
||||||
@@ -277,7 +277,8 @@ func ruleToGenerateHiddenAPIStubFlagsFile(ctx android.BuilderContext, outputPath
|
|||||||
command.FlagWithOutput("--out-api-flags=", tempPath)
|
command.FlagWithOutput("--out-api-flags=", tempPath)
|
||||||
|
|
||||||
commitChangeForRestat(rule, tempPath, outputPath)
|
commitChangeForRestat(rule, tempPath, outputPath)
|
||||||
return rule
|
|
||||||
|
rule.Build(name, desc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HiddenAPIFlagFileProperties contains paths to the flag files that can be used to augment the
|
// HiddenAPIFlagFileProperties contains paths to the flag files that can be used to augment the
|
||||||
@@ -792,8 +793,7 @@ func hiddenAPIRulesForBootclasspathFragment(ctx android.ModuleContext, contents
|
|||||||
|
|
||||||
// Generate the stub-flags.csv.
|
// Generate the stub-flags.csv.
|
||||||
stubFlagsCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "stub-flags.csv")
|
stubFlagsCSV := android.PathForModuleOut(ctx, hiddenApiSubDir, "stub-flags.csv")
|
||||||
rule := ruleToGenerateHiddenAPIStubFlagsFile(ctx, stubFlagsCSV, bootDexInfoByModule.bootDexJars(), input)
|
buildRuleToGenerateHiddenAPIStubFlagsFile(ctx, "modularHiddenAPIStubFlagsFile", "modular hiddenapi stub flags", stubFlagsCSV, bootDexInfoByModule.bootDexJars(), input)
|
||||||
rule.Build("modularHiddenAPIStubFlagsFile", "modular hiddenapi stub flags")
|
|
||||||
|
|
||||||
// Extract the classes jars from the contents.
|
// Extract the classes jars from the contents.
|
||||||
classesJars := extractClassesJarsFromModules(contents)
|
classesJars := extractClassesJarsFromModules(contents)
|
||||||
|
@@ -303,7 +303,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
|
|||||||
// the fragments will have already provided the flags that are needed.
|
// the fragments will have already provided the flags that are needed.
|
||||||
classesJars := monolithicInfo.ClassesJars
|
classesJars := monolithicInfo.ClassesJars
|
||||||
|
|
||||||
// Create the input to pass to ruleToGenerateHiddenAPIStubFlagsFile
|
// Create the input to pass to buildRuleToGenerateHiddenAPIStubFlagsFile
|
||||||
input := newHiddenAPIFlagInput()
|
input := newHiddenAPIFlagInput()
|
||||||
|
|
||||||
// Gather stub library information from the dependencies on modules provided by
|
// Gather stub library information from the dependencies on modules provided by
|
||||||
@@ -315,8 +315,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android.
|
|||||||
|
|
||||||
// Generate the monolithic stub-flags.csv file.
|
// Generate the monolithic stub-flags.csv file.
|
||||||
stubFlags := hiddenAPISingletonPaths(ctx).stubFlags
|
stubFlags := hiddenAPISingletonPaths(ctx).stubFlags
|
||||||
rule := ruleToGenerateHiddenAPIStubFlagsFile(ctx, stubFlags, bootDexJarByModule.bootDexJars(), input)
|
buildRuleToGenerateHiddenAPIStubFlagsFile(ctx, "platform-bootclasspath-monolithic-hiddenapi-stub-flags", "monolithic hidden API stub flags", stubFlags, bootDexJarByModule.bootDexJars(), input)
|
||||||
rule.Build("platform-bootclasspath-monolithic-hiddenapi-stub-flags", "monolithic hidden API stub flags")
|
|
||||||
|
|
||||||
// Generate the annotation-flags.csv file from all the module annotations.
|
// Generate the annotation-flags.csv file from all the module annotations.
|
||||||
annotationFlags := android.PathForModuleOut(ctx, "hiddenapi-monolithic", "annotation-flags-from-classes.csv")
|
annotationFlags := android.PathForModuleOut(ctx, "hiddenapi-monolithic", "annotation-flags-from-classes.csv")
|
||||||
|
Reference in New Issue
Block a user