summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-02-17 14:55:06 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2020-02-17 19:47:05 +0000
commit47cbfcdd3ee3db89e27dff59b0a8f377e94d46ef (patch)
tree9ab4da04a81bf567f0ca26b24a5c223dc357c66f
parent954b29728db00a55c9ec366ef8c7a2fdd0329583 (diff)
Add system server jars expressed in make in the system server classpath.
This was missed in: https://android-review.googlesource.com/c/platform/build/soong/+/1180134 Test: lunch and build ARC, check SYSTEMSERVERCLASSPATH Bug: 148944771 Bug: 141785760 Bug: 140451054 Change-Id: I619aee5441f7233010067a6c780e978f38ba7796
-rw-r--r--java/dexpreopt_config.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 96f8042a0..28f56d24a 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -15,6 +15,7 @@
package java
import (
+ "fmt"
"path/filepath"
"strings"
@@ -29,14 +30,29 @@ func systemServerClasspath(ctx android.MakeVarsContext) []string {
return ctx.Config().OnceStringSlice(systemServerClasspathKey, func() []string {
global := dexpreopt.GetGlobalConfig(ctx)
var systemServerClasspathLocations []string
- for _, m := range *DexpreoptedSystemServerJars(ctx.Config()) {
+ var dexpreoptJars = *DexpreoptedSystemServerJars(ctx.Config())
+ // 1) The jars that are dexpreopted.
+ for _, m := range dexpreoptJars {
systemServerClasspathLocations = append(systemServerClasspathLocations,
filepath.Join("/system/framework", m+".jar"))
}
+ // 2) The jars that are from an updatable apex.
for _, m := range global.UpdatableSystemServerJars {
systemServerClasspathLocations = append(systemServerClasspathLocations,
dexpreopt.GetJarLocationFromApexJarPair(m))
}
+ // 3) The jars from make (which are not updatable, not preopted).
+ for _, m := range dexpreopt.NonUpdatableSystemServerJars(ctx, global) {
+ if !android.InList(m, dexpreoptJars) {
+ systemServerClasspathLocations = append(systemServerClasspathLocations,
+ filepath.Join("/system/framework", m+".jar"))
+ }
+ }
+ if len(systemServerClasspathLocations) != len(global.SystemServerJars)+len(global.UpdatableSystemServerJars) {
+ panic(fmt.Errorf("Wrong number of system server jars, got %d, expected %d",
+ len(systemServerClasspathLocations),
+ len(global.SystemServerJars)+len(global.UpdatableSystemServerJars)))
+ }
return systemServerClasspathLocations
})
}