From 013485bd832075821f01a2a737b14647baab3835 Mon Sep 17 00:00:00 2001 From: satayev Date: Thu, 6 May 2021 23:38:10 +0100 Subject: 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 --- java/systemserver_classpath_fragment.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'java/systemserver_classpath_fragment.go') 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) } -- cgit v1.2.3-59-g8ed1b