Merge "Remove HideFlaggedApi() related logic and the related product variables" into main
This commit is contained in:
@@ -1965,18 +1965,6 @@ func (c *deviceConfig) CheckVendorSeappViolations() bool {
|
|||||||
return Bool(c.config.productVariables.CheckVendorSeappViolations)
|
return Bool(c.config.productVariables.CheckVendorSeappViolations)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *deviceConfig) NextReleaseHideFlaggedApi() bool {
|
|
||||||
return Bool(c.config.productVariables.NextReleaseHideFlaggedApi)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *deviceConfig) ReleaseExposeFlaggedApi() bool {
|
|
||||||
return Bool(c.config.productVariables.Release_expose_flagged_api)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *deviceConfig) HideFlaggedApis() bool {
|
|
||||||
return c.NextReleaseHideFlaggedApi() && !c.ReleaseExposeFlaggedApi()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *config) GetBuildFlag(name string) (string, bool) {
|
func (c *config) GetBuildFlag(name string) (string, bool) {
|
||||||
val, ok := c.productVariables.BuildFlags[name]
|
val, ok := c.productVariables.BuildFlags[name]
|
||||||
return val, ok
|
return val, ok
|
||||||
|
@@ -491,10 +491,6 @@ type ProductVariables struct {
|
|||||||
// partition images. They should not be read from soong modules.
|
// partition images. They should not be read from soong modules.
|
||||||
PartitionVarsForBazelMigrationOnlyDoNotUse PartitionVariables `json:",omitempty"`
|
PartitionVarsForBazelMigrationOnlyDoNotUse PartitionVariables `json:",omitempty"`
|
||||||
|
|
||||||
NextReleaseHideFlaggedApi *bool `json:",omitempty"`
|
|
||||||
|
|
||||||
Release_expose_flagged_api *bool `json:",omitempty"`
|
|
||||||
|
|
||||||
BuildFlags map[string]string `json:",omitempty"`
|
BuildFlags map[string]string `json:",omitempty"`
|
||||||
|
|
||||||
BuildFromSourceStub *bool `json:",omitempty"`
|
BuildFromSourceStub *bool `json:",omitempty"`
|
||||||
|
@@ -55,13 +55,6 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetalavaAnnotationsWarningsFlags = strings.Join(metalavaAnnotationsWarningsFlags, " ")
|
MetalavaAnnotationsWarningsFlags = strings.Join(metalavaAnnotationsWarningsFlags, " ")
|
||||||
|
|
||||||
metalavaHideFlaggedApis = []string{
|
|
||||||
"--revert-annotation",
|
|
||||||
"android.annotation.FlaggedApi",
|
|
||||||
}
|
|
||||||
|
|
||||||
MetalavaHideFlaggedApis = strings.Join(metalavaHideFlaggedApis, " ")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -73,8 +66,6 @@ func init() {
|
|||||||
|
|
||||||
exportedVars.ExportString("MetalavaAddOpens", MetalavaAddOpens)
|
exportedVars.ExportString("MetalavaAddOpens", MetalavaAddOpens)
|
||||||
|
|
||||||
exportedVars.ExportStringList("MetalavaHideFlaggedApis", metalavaHideFlaggedApis)
|
|
||||||
|
|
||||||
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationsFlags", metalavaAnnotationsFlags)
|
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationsFlags", metalavaAnnotationsFlags)
|
||||||
|
|
||||||
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationWarningsFlags", metalavaAnnotationsWarningsFlags)
|
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationWarningsFlags", metalavaAnnotationsWarningsFlags)
|
||||||
|
@@ -725,9 +725,6 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd.Flag(config.MetalavaFlags)
|
cmd.Flag(config.MetalavaFlags)
|
||||||
if ctx.DeviceConfig().HideFlaggedApis() {
|
|
||||||
cmd.Flag(config.MetalavaHideFlaggedApis)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
@@ -22,8 +22,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
|
|
||||||
"github.com/google/blueprint/proptools"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDroidstubs(t *testing.T) {
|
func TestDroidstubs(t *testing.T) {
|
||||||
@@ -364,38 +362,6 @@ func TestGeneratedApiContributionVisibilityTest(t *testing.T) {
|
|||||||
ctx.ModuleForTests("bar", "android_common")
|
ctx.ModuleForTests("bar", "android_common")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDroidstubsHideFlaggedApi(t *testing.T) {
|
|
||||||
result := android.GroupFixturePreparers(
|
|
||||||
prepareForJavaTest,
|
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
|
||||||
variables.NextReleaseHideFlaggedApi = proptools.BoolPtr(true)
|
|
||||||
variables.Release_expose_flagged_api = proptools.BoolPtr(false)
|
|
||||||
}),
|
|
||||||
android.FixtureMergeMockFs(map[string][]byte{
|
|
||||||
"a/A.java": nil,
|
|
||||||
"a/current.txt": nil,
|
|
||||||
"a/removed.txt": nil,
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
|
||||||
droidstubs {
|
|
||||||
name: "foo",
|
|
||||||
srcs: ["a/A.java"],
|
|
||||||
api_surface: "public",
|
|
||||||
check_api: {
|
|
||||||
current: {
|
|
||||||
api_file: "a/current.txt",
|
|
||||||
removed_api_file: "a/removed.txt",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
|
|
||||||
m := result.ModuleForTests("foo", "android_common")
|
|
||||||
manifest := m.Output("metalava.sbox.textproto")
|
|
||||||
cmdline := String(android.RuleBuilderSboxProtoForTests(t, result.TestContext, manifest).Commands[0].Command)
|
|
||||||
android.AssertStringDoesContain(t, "flagged api hide command not included", cmdline, "--revert-annotation android.annotation.FlaggedApi")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAconfigDeclarations(t *testing.T) {
|
func TestAconfigDeclarations(t *testing.T) {
|
||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
|
Reference in New Issue
Block a user