Loading dexpreopt/config.go +4 −6 Original line number Diff line number Diff line Loading @@ -39,10 +39,9 @@ type GlobalConfig struct { ProfileDir string // directory to find profiles in BootJars []string // modules for jars that form the boot class path UpdatableBootJars []string // jars within apex that form the boot class path ArtApexJars []string // modules for jars that are in the ART APEX ProductUpdatableBootModules []string ProductUpdatableBootLocations []string SystemServerJars []string // jars that form the system server SystemServerApps []string // apps that are loaded into system server Loading Loading @@ -281,9 +280,8 @@ func GlobalConfigForTests(ctx android.PathContext) GlobalConfig { DisableGenerateProfile: false, ProfileDir: "", BootJars: nil, UpdatableBootJars: nil, ArtApexJars: nil, ProductUpdatableBootModules: nil, ProductUpdatableBootLocations: nil, SystemServerJars: nil, SystemServerApps: nil, UpdatableSystemServerJars: nil, Loading dexpreopt/dexpreopt.go +6 −0 Original line number Diff line number Diff line Loading @@ -554,6 +554,12 @@ func SplitApexJarPair(apexJarValue string) (string, string) { return apexJarPair[0], apexJarPair[1] } // Expected format for apexJarValue = <apex name>:<jar name> func GetJarLocationFromApexJarPair(apexJarValue string) (string) { apex, jar := SplitApexJarPair(apexJarValue) return filepath.Join("/apex", apex, "javalib", jar + ".jar") } func contains(l []string, s string) bool { for _, e := range l { if e == s { Loading java/dexpreopt_config.go +16 −4 Original line number Diff line number Diff line Loading @@ -78,9 +78,8 @@ func systemServerClasspath(ctx android.PathContext) []string { filepath.Join("/system/framework", m+".jar")) } for _, m := range global.UpdatableSystemServerJars { apex, jar := dexpreopt.SplitApexJarPair(m) systemServerClasspathLocations = append(systemServerClasspathLocations, filepath.Join("/apex", apex, "javalib", jar+".jar")) dexpreopt.GetJarLocationFromApexJarPair(m)) } return systemServerClasspathLocations }) Loading Loading @@ -111,6 +110,15 @@ func stemOf(moduleName string) string { return moduleName } func getJarsFromApexJarPairs(apexJarPairs []string) []string { modules := make([]string, len(apexJarPairs)) for i, p := range apexJarPairs { _, jar := dexpreopt.SplitApexJarPair(p) modules[i] = jar } return modules } // Construct a variant of the global config for dexpreopted bootclasspath jars. The variants differ // in the list of input jars (libcore, framework, or both), in the naming scheme for the dexpreopt // files (ART recognizes "apex" names as special), and whether to include a zip archive. Loading @@ -134,7 +142,7 @@ func getBootImageConfig(ctx android.PathContext, key android.OnceKey, name strin } if !artApexJarsOnly { nonFrameworkModules := concat(artModules, global.ProductUpdatableBootModules) nonFrameworkModules := concat(artModules, getJarsFromApexJarPairs(global.UpdatableBootJars)) frameworkModules := android.RemoveListFromList(global.BootJars, nonFrameworkModules) imageModules = concat(imageModules, frameworkModules) Loading Loading @@ -218,7 +226,11 @@ func defaultBootclasspath(ctx android.PathContext) []string { return ctx.Config().OnceStringSlice(defaultBootclasspathKey, func() []string { global := dexpreoptGlobalConfig(ctx) image := defaultBootImageConfig(ctx) bootclasspath := append(copyOf(image.dexLocations), global.ProductUpdatableBootLocations...) updatableBootclasspath := make([]string, len(global.UpdatableBootJars)) for i, p := range global.UpdatableBootJars { updatableBootclasspath[i] = dexpreopt.GetJarLocationFromApexJarPair(p) } bootclasspath := append(copyOf(image.dexLocations), updatableBootclasspath...) return bootclasspath }) } Loading Loading
dexpreopt/config.go +4 −6 Original line number Diff line number Diff line Loading @@ -39,10 +39,9 @@ type GlobalConfig struct { ProfileDir string // directory to find profiles in BootJars []string // modules for jars that form the boot class path UpdatableBootJars []string // jars within apex that form the boot class path ArtApexJars []string // modules for jars that are in the ART APEX ProductUpdatableBootModules []string ProductUpdatableBootLocations []string SystemServerJars []string // jars that form the system server SystemServerApps []string // apps that are loaded into system server Loading Loading @@ -281,9 +280,8 @@ func GlobalConfigForTests(ctx android.PathContext) GlobalConfig { DisableGenerateProfile: false, ProfileDir: "", BootJars: nil, UpdatableBootJars: nil, ArtApexJars: nil, ProductUpdatableBootModules: nil, ProductUpdatableBootLocations: nil, SystemServerJars: nil, SystemServerApps: nil, UpdatableSystemServerJars: nil, Loading
dexpreopt/dexpreopt.go +6 −0 Original line number Diff line number Diff line Loading @@ -554,6 +554,12 @@ func SplitApexJarPair(apexJarValue string) (string, string) { return apexJarPair[0], apexJarPair[1] } // Expected format for apexJarValue = <apex name>:<jar name> func GetJarLocationFromApexJarPair(apexJarValue string) (string) { apex, jar := SplitApexJarPair(apexJarValue) return filepath.Join("/apex", apex, "javalib", jar + ".jar") } func contains(l []string, s string) bool { for _, e := range l { if e == s { Loading
java/dexpreopt_config.go +16 −4 Original line number Diff line number Diff line Loading @@ -78,9 +78,8 @@ func systemServerClasspath(ctx android.PathContext) []string { filepath.Join("/system/framework", m+".jar")) } for _, m := range global.UpdatableSystemServerJars { apex, jar := dexpreopt.SplitApexJarPair(m) systemServerClasspathLocations = append(systemServerClasspathLocations, filepath.Join("/apex", apex, "javalib", jar+".jar")) dexpreopt.GetJarLocationFromApexJarPair(m)) } return systemServerClasspathLocations }) Loading Loading @@ -111,6 +110,15 @@ func stemOf(moduleName string) string { return moduleName } func getJarsFromApexJarPairs(apexJarPairs []string) []string { modules := make([]string, len(apexJarPairs)) for i, p := range apexJarPairs { _, jar := dexpreopt.SplitApexJarPair(p) modules[i] = jar } return modules } // Construct a variant of the global config for dexpreopted bootclasspath jars. The variants differ // in the list of input jars (libcore, framework, or both), in the naming scheme for the dexpreopt // files (ART recognizes "apex" names as special), and whether to include a zip archive. Loading @@ -134,7 +142,7 @@ func getBootImageConfig(ctx android.PathContext, key android.OnceKey, name strin } if !artApexJarsOnly { nonFrameworkModules := concat(artModules, global.ProductUpdatableBootModules) nonFrameworkModules := concat(artModules, getJarsFromApexJarPairs(global.UpdatableBootJars)) frameworkModules := android.RemoveListFromList(global.BootJars, nonFrameworkModules) imageModules = concat(imageModules, frameworkModules) Loading Loading @@ -218,7 +226,11 @@ func defaultBootclasspath(ctx android.PathContext) []string { return ctx.Config().OnceStringSlice(defaultBootclasspathKey, func() []string { global := dexpreoptGlobalConfig(ctx) image := defaultBootImageConfig(ctx) bootclasspath := append(copyOf(image.dexLocations), global.ProductUpdatableBootLocations...) updatableBootclasspath := make([]string, len(global.UpdatableBootJars)) for i, p := range global.UpdatableBootJars { updatableBootclasspath[i] = dexpreopt.GetJarLocationFromApexJarPair(p) } bootclasspath := append(copyOf(image.dexLocations), updatableBootclasspath...) return bootclasspath }) } Loading