summaryrefslogtreecommitdiff
path: root/java/classpath_fragment.go
diff options
context:
space:
mode:
author satayev <satayev@google.com> 2021-05-17 22:40:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-05-17 22:40:08 +0000
commitf1d8819d7df17ab5d168f7d9d638c98b32da5765 (patch)
tree220cc651ec9ebed5ffe9d6dd2bbfcb9c65c31019 /java/classpath_fragment.go
parent3d3a2218a61ddd5078cbab9a3138a0cb20e131fa (diff)
parent333a1732b17887260f2290ffacffffeff760eee5 (diff)
Merge changes I8e8e8b01,Ifb1f54d5,I9986e64f
* changes: Add systemserverclasspath_fragments property to apex. Add "contents" property to systemserverclasspath_fragment. Move classpaths.proto related info into a separate provider.
Diffstat (limited to 'java/classpath_fragment.go')
-rw-r--r--java/classpath_fragment.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/java/classpath_fragment.go b/java/classpath_fragment.go
index 7422fa2d5..740809093 100644
--- a/java/classpath_fragment.go
+++ b/java/classpath_fragment.go
@@ -18,6 +18,7 @@ package java
import (
"fmt"
+ "github.com/google/blueprint"
"strings"
"android/soong/android"
@@ -120,6 +121,12 @@ func (c *ClasspathFragmentBase) generateClasspathProtoBuildActions(ctx android.M
FlagWithOutput("--output=", c.outputFilepath)
rule.Build("classpath_fragment", "Compiling "+c.outputFilepath.String())
+
+ classpathProtoInfo := ClasspathFragmentProtoContentInfo{
+ ClasspathFragmentProtoInstallDir: c.installDirPath,
+ ClasspathFragmentProtoOutput: c.outputFilepath,
+ }
+ ctx.SetProvider(ClasspathFragmentProtoContentInfoProvider, classpathProtoInfo)
}
func writeClasspathsJson(ctx android.ModuleContext, output android.WritablePath, jars []classpathJar) {
@@ -157,3 +164,23 @@ func (c *ClasspathFragmentBase) androidMkEntries() []android.AndroidMkEntries {
},
}}
}
+
+var ClasspathFragmentProtoContentInfoProvider = blueprint.NewProvider(ClasspathFragmentProtoContentInfo{})
+
+type ClasspathFragmentProtoContentInfo struct {
+ // ClasspathFragmentProtoOutput is an output path for the generated classpaths.proto config of this module.
+ //
+ // The file should be copied to a relevant place on device, see ClasspathFragmentProtoInstallDir
+ // for more details.
+ ClasspathFragmentProtoOutput android.OutputPath
+
+ // ClasspathFragmentProtoInstallDir contains information about on device location for the generated classpaths.proto file.
+ //
+ // The path encodes expected sub-location within partitions, i.e. etc/classpaths/<proto-file>,
+ // for ClasspathFragmentProtoOutput. To get sub-location, instead of the full output / make path
+ // use android.InstallPath#Rel().
+ //
+ // This is only relevant for APEX modules as they perform their own installation; while regular
+ // system files are installed via ClasspathFragmentBase#androidMkEntries().
+ ClasspathFragmentProtoInstallDir android.InstallPath
+}