Loading java/java.go +8 −0 Original line number Diff line number Diff line Loading @@ -536,7 +536,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { ctx.PropertyErrorf("sdk_version", `system_modules is required to be set when sdk_version is "none", did you mean "core_platform"`) } else if *j.deviceProperties.System_modules != "none" { // Add the system modules to both the system modules and bootclasspath. ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules) ctx.AddVariationDependencies(nil, bootClasspathTag, *j.deviceProperties.System_modules) } if ctx.ModuleName() == "android_stubs_current" || ctx.ModuleName() == "android_system_stubs_current" || Loading Loading @@ -849,6 +851,12 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { } default: switch tag { case bootClasspathTag: // If a system modules dependency has been added to the bootclasspath // then add its libs to the bootclasspath. sm := module.(*SystemModules) deps.bootClasspath = append(deps.bootClasspath, sm.headerJars...) case systemModulesTag: if deps.systemModules != nil { panic("Found two system module dependencies") Loading java/sdk_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ func TestClasspath(t *testing.T) { name: "nostdlib system_modules", properties: `sdk_version: "none", system_modules: "core-platform-api-stubs-system-modules"`, system: "core-platform-api-stubs-system-modules", bootclasspath: []string{`""`}, bootclasspath: []string{"core-platform-api-stubs-system-modules-lib"}, classpath: []string{}, }, { Loading java/system_modules.go +5 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,9 @@ type SystemModules struct { properties SystemModulesProperties // The aggregated header jars from all jars specified in the libs property. // Used when system module is added as a dependency to bootclasspath. headerJars android.Paths outputDir android.Path outputDeps android.Paths } Loading @@ -118,6 +121,8 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte jars = append(jars, dep.HeaderJars()...) }) system.headerJars = jars system.outputDir, system.outputDeps = TransformJarsToSystemModules(ctx, "java.base", jars) } Loading java/testing.go +7 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,13 @@ func GatherRequiredDepsForTest() string { for _, extra := range systemModules { bp += fmt.Sprintf(` java_system_modules { name: "%s", name: "%[1]s", libs: ["%[1]s-lib"], } java_library { name: "%[1]s-lib", sdk_version: "none", system_modules: "none", } `, extra) } Loading Loading
java/java.go +8 −0 Original line number Diff line number Diff line Loading @@ -536,7 +536,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { ctx.PropertyErrorf("sdk_version", `system_modules is required to be set when sdk_version is "none", did you mean "core_platform"`) } else if *j.deviceProperties.System_modules != "none" { // Add the system modules to both the system modules and bootclasspath. ctx.AddVariationDependencies(nil, systemModulesTag, *j.deviceProperties.System_modules) ctx.AddVariationDependencies(nil, bootClasspathTag, *j.deviceProperties.System_modules) } if ctx.ModuleName() == "android_stubs_current" || ctx.ModuleName() == "android_system_stubs_current" || Loading Loading @@ -849,6 +851,12 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { } default: switch tag { case bootClasspathTag: // If a system modules dependency has been added to the bootclasspath // then add its libs to the bootclasspath. sm := module.(*SystemModules) deps.bootClasspath = append(deps.bootClasspath, sm.headerJars...) case systemModulesTag: if deps.systemModules != nil { panic("Found two system module dependencies") Loading
java/sdk_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ func TestClasspath(t *testing.T) { name: "nostdlib system_modules", properties: `sdk_version: "none", system_modules: "core-platform-api-stubs-system-modules"`, system: "core-platform-api-stubs-system-modules", bootclasspath: []string{`""`}, bootclasspath: []string{"core-platform-api-stubs-system-modules-lib"}, classpath: []string{}, }, { Loading
java/system_modules.go +5 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,9 @@ type SystemModules struct { properties SystemModulesProperties // The aggregated header jars from all jars specified in the libs property. // Used when system module is added as a dependency to bootclasspath. headerJars android.Paths outputDir android.Path outputDeps android.Paths } Loading @@ -118,6 +121,8 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte jars = append(jars, dep.HeaderJars()...) }) system.headerJars = jars system.outputDir, system.outputDeps = TransformJarsToSystemModules(ctx, "java.base", jars) } Loading
java/testing.go +7 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,13 @@ func GatherRequiredDepsForTest() string { for _, extra := range systemModules { bp += fmt.Sprintf(` java_system_modules { name: "%s", name: "%[1]s", libs: ["%[1]s-lib"], } java_library { name: "%[1]s-lib", sdk_version: "none", system_modules: "none", } `, extra) } Loading