summaryrefslogtreecommitdiff
path: root/java/systemserver_classpath_fragment.go
diff options
context:
space:
mode:
authorsatayev <satayev@google.com>2021-05-06 23:38:10 +0100
committersatayev <satayev@google.com>2021-05-07 16:31:07 +0100
commit013485bd832075821f01a2a737b14647baab3835 (patch)
tree33bd84e0f78ab7fa2407abec670969642372b2c2 /java/systemserver_classpath_fragment.go
parent95e9c5bbfa8a1a46433183830a2429ac83979d33 (diff)
Declare ConfiguredJarList in specific fragment implementations.
Each specific classpath_fragment module knows what jars must be part of the corresponding classpaths.proto config. Note that bootclasspath_fragment does not implement classpath_fragment yet, thus all boot jars and all system server jars go into corresponding platform classpaths. Bug: 180105615 Test: m && launch_cvd; atest CtsClasspathsTestCases Change-Id: I6a8c7b0a5d17d62e790a441b8e2c5c1a816e7f30
Diffstat (limited to 'java/systemserver_classpath_fragment.go')
-rw-r--r--java/systemserver_classpath_fragment.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go
index 3f8a0836f..82cdb8926 100644
--- a/java/systemserver_classpath_fragment.go
+++ b/java/systemserver_classpath_fragment.go
@@ -16,6 +16,7 @@ package java
import (
"android/soong/android"
+ "android/soong/dexpreopt"
)
func init() {
@@ -45,6 +46,22 @@ func (b *platformSystemServerClasspathModule) AndroidMkEntries() (entries []andr
}
func (b *platformSystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- // TODO(satayev): split apex jars into separate configs.
- b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx)
+ configuredJars := configuredJarListToClasspathJars(ctx, b.ClasspathFragmentToConfiguredJarList(ctx), b.classpathType)
+ b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars)
+}
+
+var platformSystemServerClasspathKey = android.NewOnceKey("platform_systemserverclasspath")
+
+func (b *platformSystemServerClasspathModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList {
+ return ctx.Config().Once(platformSystemServerClasspathKey, func() interface{} {
+ global := dexpreopt.GetGlobalConfig(ctx)
+
+ jars := global.SystemServerJars
+
+ // TODO(satayev): split apex jars into separate configs.
+ for i := 0; i < global.UpdatableSystemServerJars.Len(); i++ {
+ jars = jars.Append(global.UpdatableSystemServerJars.Apex(i), global.UpdatableSystemServerJars.Jar(i))
+ }
+ return jars
+ }).(android.ConfiguredJarList)
}