Loading java/hiddenapi_singleton.go +1 −35 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ func hiddenAPISingletonFactory() android.Singleton { } type hiddenAPISingleton struct { flags, metadata android.Path flags android.Path } // hiddenAPI singleton rules Loading Loading @@ -144,24 +144,18 @@ func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext) // These rules depend on files located in frameworks/base, skip them if running in a tree that doesn't have them. if ctx.Config().FrameworksBaseDirExists(ctx) { h.flags = flagsRule(ctx) h.metadata = metadataRule(ctx) } else { h.flags = emptyFlagsRule(ctx) } } // Export paths to Make. INTERNAL_PLATFORM_HIDDENAPI_FLAGS is used by Make rules in art/ and cts/. // Both paths are used to call dist-for-goals. func (h *hiddenAPISingleton) MakeVars(ctx android.MakeVarsContext) { if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") { return } ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", h.flags.String()) if h.metadata != nil { ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA", h.metadata.String()) } } // stubFlagsRule creates the rule to build hiddenapi-stub-flags.txt out of dex jars from stub modules and boot image Loading Loading @@ -354,34 +348,6 @@ func emptyFlagsRule(ctx android.SingletonContext) android.Path { return outputPath } // metadataRule creates a rule to build hiddenapi-unsupported.csv out of the metadata.csv files generated for boot image // modules. func metadataRule(ctx android.SingletonContext) android.Path { var metadataCSV android.Paths ctx.VisitAllModules(func(module android.Module) { if h, ok := module.(hiddenAPIIntf); ok { if csv := h.metadataCSV(); csv != nil { metadataCSV = append(metadataCSV, csv) } } }) rule := android.NewRuleBuilder(pctx, ctx) outputPath := hiddenAPISingletonPaths(ctx).metadata rule.Command(). BuiltTool("merge_csv"). Flag("--key_field signature"). FlagWithOutput("--output=", outputPath). Inputs(metadataCSV) rule.Build("hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata") return outputPath } // commitChangeForRestat adds a command to a rule that updates outputPath from tempPath if they are different. It // also marks the rule as restat and marks the tempPath as a temporary file that should not be considered an output of // the rule. Loading java/platform_bootclasspath.go +20 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android. ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, augmentationInfo) b.generateHiddenAPIIndexRules(ctx, hiddenAPISupportingModules) b.generatedHiddenAPIMetadataRules(ctx, hiddenAPISupportingModules) } func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) { Loading @@ -358,3 +359,22 @@ func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.Mo Inputs(indexes) rule.Build("platform-bootclasspath-monolithic-hiddenapi-index", "monolithic hidden API index") } func (b *platformBootclasspathModule) generatedHiddenAPIMetadataRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) { metadataCSVFiles := android.Paths{} for _, module := range modules { metadataCSVFiles = append(metadataCSVFiles, module.metadataCSV()) } rule := android.NewRuleBuilder(pctx, ctx) outputPath := hiddenAPISingletonPaths(ctx).metadata rule.Command(). BuiltTool("merge_csv"). Flag("--key_field signature"). FlagWithOutput("--output=", outputPath). Inputs(metadataCSVFiles) rule.Build("platform-bootclasspath-monolithic-hiddenapi-metadata", "monolithic hidden API metadata") } java/platform_bootclasspath_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ func TestPlatformBootclasspath_Dist(t *testing.T) { android.AssertStringEquals(t, "platform dist goals call", "$(call dist-for-goals,droidcore,out/soong/hiddenapi/hiddenapi-flags.csv:hiddenapi-flags.csv)\n", android.StringRelativeToTop(result.Config, goals[1])) } func TestPlatformBootclasspath_HiddenAPIMonolithicIndexFile(t *testing.T) { func TestPlatformBootclasspath_HiddenAPIMonolithicFiles(t *testing.T) { result := android.GroupFixturePreparers( hiddenApiFixtureFactory, PrepareForTestWithJavaSdkLibraryFiles, Loading Loading
java/hiddenapi_singleton.go +1 −35 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ func hiddenAPISingletonFactory() android.Singleton { } type hiddenAPISingleton struct { flags, metadata android.Path flags android.Path } // hiddenAPI singleton rules Loading Loading @@ -144,24 +144,18 @@ func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext) // These rules depend on files located in frameworks/base, skip them if running in a tree that doesn't have them. if ctx.Config().FrameworksBaseDirExists(ctx) { h.flags = flagsRule(ctx) h.metadata = metadataRule(ctx) } else { h.flags = emptyFlagsRule(ctx) } } // Export paths to Make. INTERNAL_PLATFORM_HIDDENAPI_FLAGS is used by Make rules in art/ and cts/. // Both paths are used to call dist-for-goals. func (h *hiddenAPISingleton) MakeVars(ctx android.MakeVarsContext) { if ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") { return } ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_FLAGS", h.flags.String()) if h.metadata != nil { ctx.Strict("INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA", h.metadata.String()) } } // stubFlagsRule creates the rule to build hiddenapi-stub-flags.txt out of dex jars from stub modules and boot image Loading Loading @@ -354,34 +348,6 @@ func emptyFlagsRule(ctx android.SingletonContext) android.Path { return outputPath } // metadataRule creates a rule to build hiddenapi-unsupported.csv out of the metadata.csv files generated for boot image // modules. func metadataRule(ctx android.SingletonContext) android.Path { var metadataCSV android.Paths ctx.VisitAllModules(func(module android.Module) { if h, ok := module.(hiddenAPIIntf); ok { if csv := h.metadataCSV(); csv != nil { metadataCSV = append(metadataCSV, csv) } } }) rule := android.NewRuleBuilder(pctx, ctx) outputPath := hiddenAPISingletonPaths(ctx).metadata rule.Command(). BuiltTool("merge_csv"). Flag("--key_field signature"). FlagWithOutput("--output=", outputPath). Inputs(metadataCSV) rule.Build("hiddenAPIGreylistMetadataFile", "hiddenapi greylist metadata") return outputPath } // commitChangeForRestat adds a command to a rule that updates outputPath from tempPath if they are different. It // also marks the rule as restat and marks the tempPath as a temporary file that should not be considered an output of // the rule. Loading
java/platform_bootclasspath.go +20 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ func (b *platformBootclasspathModule) generateHiddenAPIBuildActions(ctx android. ruleToGenerateHiddenApiFlags(ctx, outputPath, baseFlagsPath, moduleSpecificFlagsPaths, augmentationInfo) b.generateHiddenAPIIndexRules(ctx, hiddenAPISupportingModules) b.generatedHiddenAPIMetadataRules(ctx, hiddenAPISupportingModules) } func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) { Loading @@ -358,3 +359,22 @@ func (b *platformBootclasspathModule) generateHiddenAPIIndexRules(ctx android.Mo Inputs(indexes) rule.Build("platform-bootclasspath-monolithic-hiddenapi-index", "monolithic hidden API index") } func (b *platformBootclasspathModule) generatedHiddenAPIMetadataRules(ctx android.ModuleContext, modules []hiddenAPISupportingModule) { metadataCSVFiles := android.Paths{} for _, module := range modules { metadataCSVFiles = append(metadataCSVFiles, module.metadataCSV()) } rule := android.NewRuleBuilder(pctx, ctx) outputPath := hiddenAPISingletonPaths(ctx).metadata rule.Command(). BuiltTool("merge_csv"). Flag("--key_field signature"). FlagWithOutput("--output=", outputPath). Inputs(metadataCSVFiles) rule.Build("platform-bootclasspath-monolithic-hiddenapi-metadata", "monolithic hidden API metadata") }
java/platform_bootclasspath_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ func TestPlatformBootclasspath_Dist(t *testing.T) { android.AssertStringEquals(t, "platform dist goals call", "$(call dist-for-goals,droidcore,out/soong/hiddenapi/hiddenapi-flags.csv:hiddenapi-flags.csv)\n", android.StringRelativeToTop(result.Config, goals[1])) } func TestPlatformBootclasspath_HiddenAPIMonolithicIndexFile(t *testing.T) { func TestPlatformBootclasspath_HiddenAPIMonolithicFiles(t *testing.T) { result := android.GroupFixturePreparers( hiddenApiFixtureFactory, PrepareForTestWithJavaSdkLibraryFiles, Loading