Merge "Update platform_apis error message" am: a7f0c39214
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1893228 Change-Id: I7d8d4b5fc89657bc544206b0f3be868604b49456
This commit is contained in:
@@ -144,14 +144,14 @@ func TestPlatformAPIs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
testJavaError(t, "platform_apis must be true when sdk_version is empty.", `
|
testJavaError(t, "This module has conflicting settings. sdk_version is empty, which means that this module is build against platform APIs. However platform_apis is not set to true", `
|
||||||
android_app {
|
android_app {
|
||||||
name: "bar",
|
name: "bar",
|
||||||
srcs: ["b.java"],
|
srcs: ["b.java"],
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
testJavaError(t, "platform_apis must be false when sdk_version is not empty.", `
|
testJavaError(t, "This module has conflicting settings. sdk_version is not empty, which means this module cannot use platform APIs. However platform_apis is set to true.", `
|
||||||
android_app {
|
android_app {
|
||||||
name: "bar",
|
name: "bar",
|
||||||
srcs: ["b.java"],
|
srcs: ["b.java"],
|
||||||
|
@@ -510,9 +510,9 @@ func (j *Module) checkPlatformAPI(ctx android.ModuleContext) {
|
|||||||
usePlatformAPI := proptools.Bool(j.deviceProperties.Platform_apis)
|
usePlatformAPI := proptools.Bool(j.deviceProperties.Platform_apis)
|
||||||
sdkVersionSpecified := sc.SdkVersion(ctx).Specified()
|
sdkVersionSpecified := sc.SdkVersion(ctx).Specified()
|
||||||
if usePlatformAPI && sdkVersionSpecified {
|
if usePlatformAPI && sdkVersionSpecified {
|
||||||
ctx.PropertyErrorf("platform_apis", "platform_apis must be false when sdk_version is not empty.")
|
ctx.PropertyErrorf("platform_apis", "This module has conflicting settings. sdk_version is not empty, which means this module cannot use platform APIs. However platform_apis is set to true.")
|
||||||
} else if !usePlatformAPI && !sdkVersionSpecified {
|
} else if !usePlatformAPI && !sdkVersionSpecified {
|
||||||
ctx.PropertyErrorf("platform_apis", "platform_apis must be true when sdk_version is empty.")
|
ctx.PropertyErrorf("platform_apis", "This module has conflicting settings. sdk_version is empty, which means that this module is build against platform APIs. However platform_apis is not set to true")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user