Merge "APEX can use any Prebuilt libraries"
This commit is contained in:
@@ -250,7 +250,11 @@ var ccSnapshotAction snapshot.GenerateSnapshotAction = func(s snapshot.SnapshotS
|
|||||||
for _, path := range m.VintfFragments() {
|
for _, path := range m.VintfFragments() {
|
||||||
prop.VintfFragments = append(prop.VintfFragments, filepath.Join("configs", path.Base()))
|
prop.VintfFragments = append(prop.VintfFragments, filepath.Join("configs", path.Base()))
|
||||||
}
|
}
|
||||||
prop.MinSdkVersion = m.MinSdkVersion()
|
if m.IsPrebuilt() {
|
||||||
|
prop.MinSdkVersion = "apex_inherit"
|
||||||
|
} else {
|
||||||
|
prop.MinSdkVersion = m.MinSdkVersion()
|
||||||
|
}
|
||||||
|
|
||||||
// install config files. ignores any duplicates.
|
// install config files. ignores any duplicates.
|
||||||
for _, path := range append(m.InitRc(), m.VintfFragments()...) {
|
for _, path := range append(m.InitRc(), m.VintfFragments()...) {
|
||||||
|
@@ -23,6 +23,17 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func checkJsonContents(t *testing.T, ctx android.TestingSingleton, jsonPath string, key string, value string) {
|
||||||
|
jsonOut := ctx.MaybeOutput(jsonPath)
|
||||||
|
if jsonOut.Rule == nil {
|
||||||
|
t.Errorf("%q expected but not found", jsonPath)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !strings.Contains(jsonOut.Args["content"], fmt.Sprintf("%q:%q", key, value)) {
|
||||||
|
t.Errorf("%q must include %q:%q but it only has %v", jsonPath, key, value, jsonOut.Args["content"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestVendorSnapshotCapture(t *testing.T) {
|
func TestVendorSnapshotCapture(t *testing.T) {
|
||||||
bp := `
|
bp := `
|
||||||
cc_library {
|
cc_library {
|
||||||
@@ -52,6 +63,7 @@ func TestVendorSnapshotCapture(t *testing.T) {
|
|||||||
name: "libvendor_available",
|
name: "libvendor_available",
|
||||||
vendor_available: true,
|
vendor_available: true,
|
||||||
nocrt: true,
|
nocrt: true,
|
||||||
|
min_sdk_version: "29",
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_library_headers {
|
cc_library_headers {
|
||||||
@@ -155,6 +167,9 @@ func TestVendorSnapshotCapture(t *testing.T) {
|
|||||||
filepath.Join(staticDir, "libvendor_available.a.json"),
|
filepath.Join(staticDir, "libvendor_available.a.json"),
|
||||||
filepath.Join(staticDir, "libvendor_available.cfi.a.json"))
|
filepath.Join(staticDir, "libvendor_available.cfi.a.json"))
|
||||||
|
|
||||||
|
checkJsonContents(t, snapshotSingleton, filepath.Join(staticDir, "libb.a.json"), "MinSdkVersion", "apex_inherit")
|
||||||
|
checkJsonContents(t, snapshotSingleton, filepath.Join(staticDir, "libvendor_available.a.json"), "MinSdkVersion", "29")
|
||||||
|
|
||||||
// For binary executables, all vendor:true and vendor_available modules are captured.
|
// For binary executables, all vendor:true and vendor_available modules are captured.
|
||||||
if archType == "arm64" {
|
if archType == "arm64" {
|
||||||
binaryVariant := fmt.Sprintf("android_vendor.29_%s_%s", archType, archVariant)
|
binaryVariant := fmt.Sprintf("android_vendor.29_%s_%s", archType, archVariant)
|
||||||
|
Reference in New Issue
Block a user