Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13a9dd60 authored by Paul Duffin's avatar Paul Duffin
Browse files

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
parent 1f38237c
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1325,13 +1325,8 @@ func (d *Droidstubs) annotationsFlags(ctx android.ModuleContext, cmd *android.Ru
		validatingNullability :=
			strings.Contains(d.Javadoc.args, "--validate-nullability-from-merged-stubs") ||
				String(d.properties.Validate_nullability_from_list) != ""
		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)")
		}

		migratingNullability := String(d.properties.Previous_api) != ""
		if migratingNullability {
			previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api))
			cmd.FlagWithInput("--migrate-nullness ", previousApi)