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

Commit 541ebaad authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge "API: Add baseline file for API check" am: 2bfc6bf8 am: 991093b0

am: 58e83b9c

Change-Id: I77ddaaab96d91aedd2211c17eabbcf983b7f5107
parents a447b0d3 58e83b9c
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@ type ApiToCheck struct {
	// :module syntax).
	Removed_api_file *string `android:"path"`

	// If not blank, path to the baseline txt file for approved API check violations.
	Baseline_file *string `android:"path"`

	// Arguments to the apicheck tool.
	Args *string
}
@@ -1506,6 +1509,8 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {

		apiFile := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Current.Api_file))
		removedApiFile := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Current.Removed_api_file))
		baselineFile := android.OptionalPathForModuleSrc(ctx, d.properties.Check_api.Current.Baseline_file)
		updatedBaselineOutput := android.PathForModuleOut(ctx, "current_baseline.txt")

		d.checkCurrentApiTimestamp = android.PathForModuleOut(ctx, "check_current_api.timestamp")

@@ -1526,6 +1531,11 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
		d.inclusionAnnotationsFlags(ctx, cmd)
		d.mergeAnnoDirFlags(ctx, cmd)

		if baselineFile.Valid() {
			cmd.FlagWithInput("--baseline ", baselineFile.Path())
			cmd.FlagWithOutput("--update-baseline ", updatedBaselineOutput)
		}

		zipSyncCleanupCmd(rule, srcJarDir)

		msg := fmt.Sprintf(`\n******************************\n`+
@@ -1584,6 +1594,8 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {

		apiFile := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Last_released.Api_file))
		removedApiFile := android.PathForModuleSrc(ctx, String(d.properties.Check_api.Last_released.Removed_api_file))
		baselineFile := android.OptionalPathForModuleSrc(ctx, d.properties.Check_api.Last_released.Baseline_file)
		updatedBaselineOutput := android.PathForModuleOut(ctx, "last_released_baseline.txt")

		d.checkLastReleasedApiTimestamp = android.PathForModuleOut(ctx, "check_last_released_api.timestamp")

@@ -1606,6 +1618,11 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {

		d.mergeAnnoDirFlags(ctx, cmd)

		if baselineFile.Valid() {
			cmd.FlagWithInput("--baseline ", baselineFile.Path())
			cmd.FlagWithOutput("--update-baseline ", updatedBaselineOutput)
		}

		zipSyncCleanupCmd(rule, srcJarDir)

		msg := `\n******************************\n` +