Remove unnecessary constraint on previous_api
The constraint requires the previous_api property to be specified unless validating nullness. However, there is no reason within the Soong code why that should be. The only use of previous_api is as the argument to the metalava --migrate-nullness option which is only added when previous_api is specified. So, there is no reason in the Soong code for the constraint. Metalava also does not require the --migrate-nullness option to be specified unless validating nullness. So, there is no reason in metalava for the constraint. It is therefore safe to remove the constraint. Bug: 142113521 Test: m checkbuild Change-Id: I189071e215e928fdf43a39a03d540732743b7a32
This commit is contained in:
@@ -1325,13 +1325,8 @@ func (d *Droidstubs) annotationsFlags(ctx android.ModuleContext, cmd *android.Ru
|
|||||||
validatingNullability :=
|
validatingNullability :=
|
||||||
strings.Contains(d.Javadoc.args, "--validate-nullability-from-merged-stubs") ||
|
strings.Contains(d.Javadoc.args, "--validate-nullability-from-merged-stubs") ||
|
||||||
String(d.properties.Validate_nullability_from_list) != ""
|
String(d.properties.Validate_nullability_from_list) != ""
|
||||||
|
|
||||||
migratingNullability := String(d.properties.Previous_api) != ""
|
migratingNullability := String(d.properties.Previous_api) != ""
|
||||||
|
|
||||||
if !(migratingNullability || validatingNullability) {
|
|
||||||
ctx.PropertyErrorf("previous_api",
|
|
||||||
"has to be non-empty if annotations was enabled (unless validating nullability)")
|
|
||||||
}
|
|
||||||
|
|
||||||
if migratingNullability {
|
if migratingNullability {
|
||||||
previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api))
|
previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api))
|
||||||
cmd.FlagWithInput("--migrate-nullness ", previousApi)
|
cmd.FlagWithInput("--migrate-nullness ", previousApi)
|
||||||
|
Reference in New Issue
Block a user