Add no-op systemserverclasspath_fragment module.

This would allow to start introducing these modules for apexes that
contribute to SYSTEMSERVERCLASSPATH.

In follow up, it will be evolved:
- platform_systemserverclasspath would have "fragments" property to
  list all individual systemserverclasspath_fragments;
- systemserverclasspath_fragment would have "contents" property to list
  contibuting java libs;
- systemserverclasspath_fragment would generate non-empty
  classpaths.proto config within individual apexes.

Bug: 180105615
Test: m nothing
Merged-In: Ibaaa3fae5f1eab9a41ceecc1214a53be6bbc8ba6
Change-Id: Ibaaa3fae5f1eab9a41ceecc1214a53be6bbc8ba6
(cherry picked from commit aa86bac2b01f7565f1ea8ec7c88308ef5ed6e7e2)
This commit is contained in:
satayev 2021-05-13 19:01:52 +01:00 committed by Paul Duffin
parent 6c6dde04bd
commit 0cf6de5ca9
1 changed files with 29 additions and 7 deletions

View File

@ -24,8 +24,8 @@ func init() {
} }
func registerSystemserverClasspathBuildComponents(ctx android.RegistrationContext) { func registerSystemserverClasspathBuildComponents(ctx android.RegistrationContext) {
// TODO(satayev): add systemserver_classpath_fragment module
ctx.RegisterModuleType("platform_systemserverclasspath", platformSystemServerClasspathFactory) ctx.RegisterModuleType("platform_systemserverclasspath", platformSystemServerClasspathFactory)
ctx.RegisterModuleType("systemserverclasspath_fragment", systemServerClasspathFactory)
} }
type platformSystemServerClasspathModule struct { type platformSystemServerClasspathModule struct {
@ -41,18 +41,18 @@ func platformSystemServerClasspathFactory() android.Module {
return m return m
} }
func (b *platformSystemServerClasspathModule) AndroidMkEntries() (entries []android.AndroidMkEntries) { func (p *platformSystemServerClasspathModule) AndroidMkEntries() (entries []android.AndroidMkEntries) {
return b.classpathFragmentBase().androidMkEntries() return p.classpathFragmentBase().androidMkEntries()
} }
func (b *platformSystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { func (p *platformSystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
configuredJars := configuredJarListToClasspathJars(ctx, b.ClasspathFragmentToConfiguredJarList(ctx), b.classpathType) configuredJars := configuredJarListToClasspathJars(ctx, p.ClasspathFragmentToConfiguredJarList(ctx), p.classpathType)
b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars) p.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars)
} }
var platformSystemServerClasspathKey = android.NewOnceKey("platform_systemserverclasspath") var platformSystemServerClasspathKey = android.NewOnceKey("platform_systemserverclasspath")
func (b *platformSystemServerClasspathModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList { func (p *platformSystemServerClasspathModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList {
return ctx.Config().Once(platformSystemServerClasspathKey, func() interface{} { return ctx.Config().Once(platformSystemServerClasspathKey, func() interface{} {
global := dexpreopt.GetGlobalConfig(ctx) global := dexpreopt.GetGlobalConfig(ctx)
@ -65,3 +65,25 @@ func (b *platformSystemServerClasspathModule) ClasspathFragmentToConfiguredJarLi
return jars return jars
}).(android.ConfiguredJarList) }).(android.ConfiguredJarList)
} }
type systemServerClasspathModule struct {
android.ModuleBase
ClasspathFragmentBase
}
func systemServerClasspathFactory() android.Module {
m := &systemServerClasspathModule{}
initClasspathFragment(m, SYSTEMSERVERCLASSPATH)
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
return m
}
func (s *systemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
s.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJarListToClasspathJars(ctx, s.ClasspathFragmentToConfiguredJarList(ctx)))
}
func (s *systemServerClasspathModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList {
// TODO(satayev): populate with actual content
return android.EmptyConfiguredJarList()
}