Merge changes Ib7ad715d,I3a83b5ed

* changes:
  Remove frameworkResModule from sdkCorePlatform.
  Remove the concept of useDefaultLibs from Soong.
This commit is contained in:
Treehugger Robot
2020-07-01 17:23:46 +00:00
committed by Gerrit Code Review
3 changed files with 19 additions and 19 deletions

View File

@@ -440,16 +440,11 @@ func (j *Javadoc) targetSdkVersion() sdkSpec {
func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) { func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
if ctx.Device() { if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j)) sdkDep := decodeSdkDep(ctx, sdkContext(j))
if sdkDep.useDefaultLibs { if sdkDep.useModule {
ctx.AddVariationDependencies(nil, bootClasspathTag, config.LegacyCorePlatformBootclasspathLibraries...)
ctx.AddVariationDependencies(nil, systemModulesTag, config.LegacyCorePlatformSystemModules)
if sdkDep.hasFrameworkLibs() {
ctx.AddVariationDependencies(nil, libTag, config.FrameworkLibraries...)
}
} else if sdkDep.useModule {
ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.bootclasspath...) ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.bootclasspath...)
ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules) ctx.AddVariationDependencies(nil, systemModulesTag, sdkDep.systemModules)
ctx.AddVariationDependencies(nil, java9LibTag, sdkDep.java9Classpath...) ctx.AddVariationDependencies(nil, java9LibTag, sdkDep.java9Classpath...)
ctx.AddVariationDependencies(nil, libTag, sdkDep.classpath...)
} }
} }

View File

@@ -597,7 +597,7 @@ func IsStaticLibDepTag(depTag blueprint.DependencyTag) bool {
} }
type sdkDep struct { type sdkDep struct {
useModule, useFiles, useDefaultLibs, invalidVersion bool useModule, useFiles, invalidVersion bool
// The modules that will be added to the bootclasspath when targeting 1.8 or lower // The modules that will be added to the bootclasspath when targeting 1.8 or lower
bootclasspath []string bootclasspath []string
@@ -606,7 +606,11 @@ type sdkDep struct {
// modules are to be used. // modules are to be used.
systemModules string systemModules string
// The modules that will be added to the classpath regardless of the Java language level targeted
classpath []string
// The modules that will be added ot the classpath when targeting 1.9 or higher // The modules that will be added ot the classpath when targeting 1.9 or higher
// (normally these will be on the bootclasspath when targeting 1.8 or lower)
java9Classpath []string java9Classpath []string
frameworkResModule string frameworkResModule string
@@ -700,17 +704,14 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
j.linter.deps(ctx) j.linter.deps(ctx)
sdkDep := decodeSdkDep(ctx, sdkContext(j)) sdkDep := decodeSdkDep(ctx, sdkContext(j))
if sdkDep.useDefaultLibs { if sdkDep.useModule {
ctx.AddVariationDependencies(nil, bootClasspathTag, config.LegacyCorePlatformBootclasspathLibraries...)
ctx.AddVariationDependencies(nil, systemModulesTag, config.LegacyCorePlatformSystemModules)
if sdkDep.hasFrameworkLibs() {
ctx.AddVariationDependencies(nil, libTag, config.FrameworkLibraries...)
}
} else if sdkDep.useModule {
ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.bootclasspath...) ctx.AddVariationDependencies(nil, bootClasspathTag, sdkDep.bootclasspath...)
ctx.AddVariationDependencies(nil, java9LibTag, sdkDep.java9Classpath...) ctx.AddVariationDependencies(nil, java9LibTag, sdkDep.java9Classpath...)
ctx.AddVariationDependencies(nil, libTag, sdkDep.classpath...)
if j.deviceProperties.EffectiveOptimizeEnabled() && sdkDep.hasStandardLibs() { if j.deviceProperties.EffectiveOptimizeEnabled() && sdkDep.hasStandardLibs() {
ctx.AddVariationDependencies(nil, proguardRaiseTag, config.LegacyCorePlatformBootclasspathLibraries...) ctx.AddVariationDependencies(nil, proguardRaiseTag, config.LegacyCorePlatformBootclasspathLibraries...)
}
if j.deviceProperties.EffectiveOptimizeEnabled() && sdkDep.hasFrameworkLibs() {
ctx.AddVariationDependencies(nil, proguardRaiseTag, config.FrameworkLibraries...) ctx.AddVariationDependencies(nil, proguardRaiseTag, config.FrameworkLibraries...)
} }
} }

View File

@@ -412,7 +412,10 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext sdkContext) sdkDep
switch sdkVersion.kind { switch sdkVersion.kind {
case sdkPrivate: case sdkPrivate:
return sdkDep{ return sdkDep{
useDefaultLibs: true, useModule: true,
systemModules: config.LegacyCorePlatformSystemModules,
bootclasspath: config.LegacyCorePlatformBootclasspathLibraries,
classpath: config.FrameworkLibraries,
frameworkResModule: "framework-res", frameworkResModule: "framework-res",
} }
case sdkNone: case sdkNone:
@@ -434,9 +437,10 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext sdkContext) sdkDep
} }
case sdkCorePlatform: case sdkCorePlatform:
return sdkDep{ return sdkDep{
useDefaultLibs: true, useModule: true,
frameworkResModule: "framework-res", systemModules: config.LegacyCorePlatformSystemModules,
noFrameworksLibs: true, bootclasspath: config.LegacyCorePlatformBootclasspathLibraries,
noFrameworksLibs: true,
} }
case sdkPublic: case sdkPublic:
return toModule([]string{"android_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx)) return toModule([]string{"android_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx))