Install classpath protobuf files
This is to support etc/classpaths for filesystem modules. Bug: 337993199 Test: m aosp_cf_system_x86_64 Change-Id: I0d5d3dc8af9646a24c8ae97d4d1418ddb0e5f46b
This commit is contained in:
parent
2d5e7579d4
commit
dd5324938c
3 changed files with 11 additions and 1 deletions
|
@ -151,10 +151,14 @@ func configuredJarListToClasspathJars(ctx android.ModuleContext, configuredJars
|
|||
return jars
|
||||
}
|
||||
|
||||
func (c *ClasspathFragmentBase) outputFilename() string {
|
||||
return strings.ToLower(c.classpathType.String()) + ".pb"
|
||||
}
|
||||
|
||||
func (c *ClasspathFragmentBase) generateClasspathProtoBuildActions(ctx android.ModuleContext, configuredJars android.ConfiguredJarList, jars []classpathJar) {
|
||||
generateProto := proptools.BoolDefault(c.properties.Generate_classpaths_proto, true)
|
||||
if generateProto {
|
||||
outputFilename := strings.ToLower(c.classpathType.String()) + ".pb"
|
||||
outputFilename := c.outputFilename()
|
||||
c.outputFilepath = android.PathForModuleOut(ctx, outputFilename).OutputPath
|
||||
c.installDirPath = android.PathForModuleInstall(ctx, "etc", "classpaths")
|
||||
|
||||
|
@ -181,6 +185,10 @@ func (c *ClasspathFragmentBase) generateClasspathProtoBuildActions(ctx android.M
|
|||
android.SetProvider(ctx, ClasspathFragmentProtoContentInfoProvider, classpathProtoInfo)
|
||||
}
|
||||
|
||||
func (c *ClasspathFragmentBase) installClasspathProto(ctx android.ModuleContext) android.InstallPath {
|
||||
return ctx.InstallFile(c.installDirPath, c.outputFilename(), c.outputFilepath)
|
||||
}
|
||||
|
||||
func writeClasspathsTextproto(ctx android.ModuleContext, output android.WritablePath, jars []classpathJar) {
|
||||
var content strings.Builder
|
||||
|
||||
|
|
|
@ -221,6 +221,7 @@ func (b *platformBootclasspathModule) generateClasspathProtoBuildActions(ctx and
|
|||
// ART and platform boot jars must have a corresponding entry in DEX2OATBOOTCLASSPATH
|
||||
classpathJars := configuredJarListToClasspathJars(ctx, configuredJars, BOOTCLASSPATH, DEX2OATBOOTCLASSPATH)
|
||||
b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
|
||||
b.classpathFragmentBase().installClasspathProto(ctx)
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
|
||||
|
|
|
@ -69,6 +69,7 @@ func (p *platformSystemServerClasspathModule) GenerateAndroidBuildActions(ctx an
|
|||
configuredJars = configuredJars.AppendList(&standaloneConfiguredJars)
|
||||
classpathJars = append(classpathJars, standaloneClasspathJars...)
|
||||
p.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
|
||||
p.classpathFragmentBase().installClasspathProto(ctx)
|
||||
}
|
||||
|
||||
func (p *platformSystemServerClasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
|
||||
|
|
Loading…
Reference in a new issue