Merge "Rename updatable-library to apex-library" am: fe74791982 am: 32c14d4177

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1938477

Change-Id: I417b0f59d8deb6303953d047229b7937d4b449ee
This commit is contained in:
Treehugger Robot
2022-01-06 19:17:23 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 4 deletions

View File

@@ -2579,11 +2579,11 @@ func (module *sdkLibraryXml) permissionsContents(ctx android.ModuleContext) stri
implicitUntilAttr := formattedOptionalSdkLevelAttribute(ctx, "on-bootclasspath-before", module.properties.On_bootclasspath_before) implicitUntilAttr := formattedOptionalSdkLevelAttribute(ctx, "on-bootclasspath-before", module.properties.On_bootclasspath_before)
minSdkAttr := formattedOptionalSdkLevelAttribute(ctx, "min-device-sdk", module.properties.Min_device_sdk) minSdkAttr := formattedOptionalSdkLevelAttribute(ctx, "min-device-sdk", module.properties.Min_device_sdk)
maxSdkAttr := formattedOptionalSdkLevelAttribute(ctx, "max-device-sdk", module.properties.Max_device_sdk) maxSdkAttr := formattedOptionalSdkLevelAttribute(ctx, "max-device-sdk", module.properties.Max_device_sdk)
// <library> is understood in all android versions whereas <updatable-library> is only understood from API T (and ignored before that). // <library> is understood in all android versions whereas <apex-library> is only understood from API T (and ignored before that).
// similarly, min_device_sdk is only understood from T. So if a library is using that, we need to use the updatable-library to make sure this library is not loaded before T // similarly, min_device_sdk is only understood from T. So if a library is using that, we need to use the apex-library to make sure this library is not loaded before T
var libraryTag string var libraryTag string
if module.properties.Min_device_sdk != nil { if module.properties.Min_device_sdk != nil {
libraryTag = ` <updatable-library\n` libraryTag = ` <apex-library\n`
} else { } else {
libraryTag = ` <library\n` libraryTag = ` <library\n`
} }

View File

@@ -338,7 +338,7 @@ func TestJavaSdkLibrary_UpdatableLibrary_usesNewTag(t *testing.T) {
`) `)
// test that updatability attributes are passed on correctly // test that updatability attributes are passed on correctly
fooUpdatable := result.ModuleForTests("foo.xml", "android_common").Rule("java_sdk_xml") fooUpdatable := result.ModuleForTests("foo.xml", "android_common").Rule("java_sdk_xml")
android.AssertStringDoesContain(t, "foo.xml java_sdk_xml command", fooUpdatable.RuleParams.Command, `<updatable-library`) android.AssertStringDoesContain(t, "foo.xml java_sdk_xml command", fooUpdatable.RuleParams.Command, `<apex-library`)
android.AssertStringDoesNotContain(t, "foo.xml java_sdk_xml command", fooUpdatable.RuleParams.Command, `<library`) android.AssertStringDoesNotContain(t, "foo.xml java_sdk_xml command", fooUpdatable.RuleParams.Command, `<library`)
} }