Merge "Make prebuilt_apex report an error if no apex file is found" am: 846ce57a00
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665740 Change-Id: Ifa76e593f32b529fa7993bb6a63c978b2cd0b92e
This commit is contained in:
@@ -4316,6 +4316,14 @@ func TestPrebuilt(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPrebuiltMissingSrc(t *testing.T) {
|
||||||
|
testApexError(t, `module "myapex" variant "android_common".*: prebuilt_apex does not support "arm64_armv8-a"`, `
|
||||||
|
prebuilt_apex {
|
||||||
|
name: "myapex",
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func TestPrebuiltFilenameOverride(t *testing.T) {
|
func TestPrebuiltFilenameOverride(t *testing.T) {
|
||||||
ctx := testApex(t, `
|
ctx := testApex(t, `
|
||||||
prebuilt_apex {
|
prebuilt_apex {
|
||||||
|
@@ -152,14 +152,17 @@ func (p *ApexFileProperties) prebuiltApexSelector(ctx android.BaseModuleContext,
|
|||||||
src = String(p.Arch.X86.Src)
|
src = String(p.Arch.X86.Src)
|
||||||
case android.X86_64:
|
case android.X86_64:
|
||||||
src = String(p.Arch.X86_64.Src)
|
src = String(p.Arch.X86_64.Src)
|
||||||
default:
|
|
||||||
ctx.OtherModuleErrorf(prebuilt, "prebuilt_apex does not support %q", multiTargets[0].Arch.String())
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
if src == "" {
|
if src == "" {
|
||||||
src = String(p.Src)
|
src = String(p.Src)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if src == "" {
|
||||||
|
ctx.OtherModuleErrorf(prebuilt, "prebuilt_apex does not support %q", multiTargets[0].Arch.String())
|
||||||
|
// Drop through to return an empty string as the src (instead of nil) to avoid the prebuilt
|
||||||
|
// logic from reporting a more general, less useful message.
|
||||||
|
}
|
||||||
|
|
||||||
return []string{src}
|
return []string{src}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user