Merge "Remove apex10000_private variants" am: 9c58a3628b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2062048 Change-Id: I1d14281b9c06996840610724fbe3429bc7489478 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -113,9 +113,6 @@ func (i ApexInfo) mergedName(ctx PathContext) string {
|
|||||||
for _, sdk := range i.RequiredSdks {
|
for _, sdk := range i.RequiredSdks {
|
||||||
name += "_" + sdk.Name + "_" + sdk.Version
|
name += "_" + sdk.Name + "_" + sdk.Version
|
||||||
}
|
}
|
||||||
if i.UsePlatformApis {
|
|
||||||
name += "_private"
|
|
||||||
}
|
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,10 +543,9 @@ func mergeApexVariations(ctx PathContext, apexInfos []ApexInfo) (merged []ApexIn
|
|||||||
merged[index].InApexModules = append(merged[index].InApexModules, apexInfo.InApexModules...)
|
merged[index].InApexModules = append(merged[index].InApexModules, apexInfo.InApexModules...)
|
||||||
merged[index].ApexContents = append(merged[index].ApexContents, apexInfo.ApexContents...)
|
merged[index].ApexContents = append(merged[index].ApexContents, apexInfo.ApexContents...)
|
||||||
merged[index].Updatable = merged[index].Updatable || apexInfo.Updatable
|
merged[index].Updatable = merged[index].Updatable || apexInfo.Updatable
|
||||||
if merged[index].UsePlatformApis != apexInfo.UsePlatformApis {
|
// Platform APIs is allowed for this module only when all APEXes containing
|
||||||
panic(fmt.Errorf("variants having different UsePlatformApis can't be merged"))
|
// the module are with `use_platform_apis: true`.
|
||||||
}
|
merged[index].UsePlatformApis = merged[index].UsePlatformApis && apexInfo.UsePlatformApis
|
||||||
merged[index].UsePlatformApis = apexInfo.UsePlatformApis
|
|
||||||
} else {
|
} else {
|
||||||
seen[mergedName] = len(merged)
|
seen[mergedName] = len(merged)
|
||||||
apexInfo.ApexVariationName = mergedName
|
apexInfo.ApexVariationName = mergedName
|
||||||
|
@@ -118,17 +118,30 @@ func Test_mergeApexVariations(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "don't merge different UsePlatformApis",
|
name: "merge different UsePlatformApis but don't allow using platform api",
|
||||||
in: []ApexInfo{
|
in: []ApexInfo{
|
||||||
{"foo", FutureApiLevel, false, false, nil, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex},
|
{"foo", FutureApiLevel, false, false, nil, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex},
|
||||||
{"bar", FutureApiLevel, false, true, nil, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex},
|
{"bar", FutureApiLevel, false, true, nil, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex},
|
||||||
},
|
},
|
||||||
wantMerged: []ApexInfo{
|
wantMerged: []ApexInfo{
|
||||||
{"apex10000_private", FutureApiLevel, false, true, nil, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex},
|
{"apex10000", FutureApiLevel, false, false, nil, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex},
|
||||||
{"apex10000", FutureApiLevel, false, false, nil, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex},
|
|
||||||
},
|
},
|
||||||
wantAliases: [][2]string{
|
wantAliases: [][2]string{
|
||||||
{"bar", "apex10000_private"},
|
{"bar", "apex10000"},
|
||||||
|
{"foo", "apex10000"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "merge same UsePlatformApis and allow using platform api",
|
||||||
|
in: []ApexInfo{
|
||||||
|
{"foo", FutureApiLevel, false, true, nil, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex},
|
||||||
|
{"bar", FutureApiLevel, false, true, nil, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex},
|
||||||
|
},
|
||||||
|
wantMerged: []ApexInfo{
|
||||||
|
{"apex10000", FutureApiLevel, false, true, nil, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex},
|
||||||
|
},
|
||||||
|
wantAliases: [][2]string{
|
||||||
|
{"bar", "apex10000"},
|
||||||
{"foo", "apex10000"},
|
{"foo", "apex10000"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -1036,10 +1036,10 @@ func TestApexCanUsePrivateApis(t *testing.T) {
|
|||||||
|
|
||||||
// Ensure that we are using non-stub variants of mylib2 and libfoo.shared_from_rust (because
|
// Ensure that we are using non-stub variants of mylib2 and libfoo.shared_from_rust (because
|
||||||
// of the platform_apis: true)
|
// of the platform_apis: true)
|
||||||
mylibLdFlags := ctx.ModuleForTests("mylib", "android_arm64_armv8-a_shared_apex10000_private").Rule("ld").Args["libFlags"]
|
mylibLdFlags := ctx.ModuleForTests("mylib", "android_arm64_armv8-a_shared_apex10000").Rule("ld").Args["libFlags"]
|
||||||
ensureNotContains(t, mylibLdFlags, "mylib2/android_arm64_armv8-a_shared_current/mylib2.so")
|
ensureNotContains(t, mylibLdFlags, "mylib2/android_arm64_armv8-a_shared_current/mylib2.so")
|
||||||
ensureContains(t, mylibLdFlags, "mylib2/android_arm64_armv8-a_shared/mylib2.so")
|
ensureContains(t, mylibLdFlags, "mylib2/android_arm64_armv8-a_shared/mylib2.so")
|
||||||
rustDeps := ctx.ModuleForTests("foo.rust", "android_arm64_armv8-a_apex10000_private").Rule("rustc").Args["linkFlags"]
|
rustDeps := ctx.ModuleForTests("foo.rust", "android_arm64_armv8-a_apex10000").Rule("rustc").Args["linkFlags"]
|
||||||
ensureNotContains(t, rustDeps, "libfoo.shared_from_rust/android_arm64_armv8-a_shared_current/libfoo.shared_from_rust.so")
|
ensureNotContains(t, rustDeps, "libfoo.shared_from_rust/android_arm64_armv8-a_shared_current/libfoo.shared_from_rust.so")
|
||||||
ensureContains(t, rustDeps, "libfoo.shared_from_rust/android_arm64_armv8-a_shared/libfoo.shared_from_rust.so")
|
ensureContains(t, rustDeps, "libfoo.shared_from_rust/android_arm64_armv8-a_shared/libfoo.shared_from_rust.so")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user