summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zi Wang <mrziwang@google.com> 2023-11-13 16:01:13 -0800
committer Zi Wang <mrziwang@google.com> 2023-11-13 16:01:13 -0800
commitd72e2dbbff68d2bc911e2dbed25ef9cb86e04dda (patch)
treeab6cc9b17c89204281d22e434d354a035521e71d
parent6f9522e4a8676a853e201c046eb5513b89c4a821 (diff)
Remove "Test" prop from xx_aconfig_library build rules
Test: CI Bug: 309990433 Change-Id: Id78f65d4083571f310686589a18cabe13bbd5d62
-rw-r--r--aconfig/cc_aconfig_library.go12
-rw-r--r--aconfig/cc_aconfig_library_test.go2
-rw-r--r--aconfig/java_aconfig_library.go11
-rw-r--r--aconfig/java_aconfig_library_test.go6
-rw-r--r--aconfig/rust_aconfig_library.go12
-rw-r--r--aconfig/rust_aconfig_library_test.go2
6 files changed, 1 insertions, 44 deletions
diff --git a/aconfig/cc_aconfig_library.go b/aconfig/cc_aconfig_library.go
index 8aa696bf1..210a58105 100644
--- a/aconfig/cc_aconfig_library.go
+++ b/aconfig/cc_aconfig_library.go
@@ -38,10 +38,6 @@ type CcAconfigLibraryProperties struct {
// name of the aconfig_declarations module to generate a library for
Aconfig_declarations string
- // whether to generate test mode version of the library
- // TODO: remove "Test" property when "Mode" can be used in all the branches
- Test *bool
-
// default mode is "production", the other accepted modes are:
// "test": to generate test mode version of the library
// "exported": to generate exported mode version of the library
@@ -128,17 +124,11 @@ func (this *CcAconfigLibraryCallbacks) GeneratorBuildActions(ctx cc.ModuleContex
}
declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
- if this.properties.Mode != nil && this.properties.Test != nil {
- ctx.PropertyErrorf("test", "test prop should not be specified when mode prop is set")
- }
mode := proptools.StringDefault(this.properties.Mode, "production")
if !isModeSupported(mode) {
ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
}
- // TODO: remove "Test" property
- if proptools.Bool(this.properties.Test) {
- mode = "test"
- }
+
ctx.Build(pctx, android.BuildParams{
Rule: cppRule,
Input: declarations.IntermediatePath,
diff --git a/aconfig/cc_aconfig_library_test.go b/aconfig/cc_aconfig_library_test.go
index 9a819e59e..ba2725059 100644
--- a/aconfig/cc_aconfig_library_test.go
+++ b/aconfig/cc_aconfig_library_test.go
@@ -71,8 +71,6 @@ var incorrectCCCodegenModeTestData = []struct {
setting, expectedErr string
}{
{"mode: `unsupported`,", "mode: \"unsupported\" is not a supported mode"},
- // TODO: remove this test case when test prop is removed
- {"mode: `test`, test: true", "test prop should not be specified when mode prop is set"},
}
func TestIncorrectCCCodegenMode(t *testing.T) {
diff --git a/aconfig/java_aconfig_library.go b/aconfig/java_aconfig_library.go
index b6c90fc5f..eedb3c358 100644
--- a/aconfig/java_aconfig_library.go
+++ b/aconfig/java_aconfig_library.go
@@ -36,10 +36,6 @@ type JavaAconfigDeclarationsLibraryProperties struct {
// name of the aconfig_declarations module to generate a library for
Aconfig_declarations string
- // whether to generate test mode version of the library
- // TODO: remove "Test" property when "Mode" can be used in all the branches
- Test *bool
-
// default mode is "production", the other accepted modes are:
// "test": to generate test mode version of the library
// "exported": to generate exported mode version of the library
@@ -82,17 +78,10 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuild
// Generate the action to build the srcjar
srcJarPath := android.PathForModuleGen(ctx, ctx.ModuleName()+".srcjar")
- if callbacks.properties.Mode != nil && callbacks.properties.Test != nil {
- ctx.PropertyErrorf("test", "test prop should not be specified when mode prop is set")
- }
mode := proptools.StringDefault(callbacks.properties.Mode, "production")
if !isModeSupported(mode) {
ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
}
- // TODO: remove "Test" property
- if proptools.Bool(callbacks.properties.Test) {
- mode = "test"
- }
ctx.Build(pctx, android.BuildParams{
Rule: javaRule,
diff --git a/aconfig/java_aconfig_library_test.go b/aconfig/java_aconfig_library_test.go
index 05532e701..a803672db 100644
--- a/aconfig/java_aconfig_library_test.go
+++ b/aconfig/java_aconfig_library_test.go
@@ -217,9 +217,3 @@ func TestExportedMode(t *testing.T) {
func TestUnsupportedMode(t *testing.T) {
testCodegenModeWithError(t, "mode: `unsupported`,", "mode: \"unsupported\" is not a supported mode")
}
-
-// TODO: remove this test case when test prop is removed
-func TestBothModeAndTestAreSet(t *testing.T) {
- testCodegenModeWithError(t, "mode: `test`, test: true",
- "test prop should not be specified when mode prop is set")
-}
diff --git a/aconfig/rust_aconfig_library.go b/aconfig/rust_aconfig_library.go
index 43078b651..265685e6f 100644
--- a/aconfig/rust_aconfig_library.go
+++ b/aconfig/rust_aconfig_library.go
@@ -20,10 +20,6 @@ type RustAconfigLibraryProperties struct {
// name of the aconfig_declarations module to generate a library for
Aconfig_declarations string
- // whether to generate test mode version of the library
- // TODO: remove "Test" property when "Mode" can be used in all the branches
- Test *bool
-
// default mode is "production", the other accepted modes are:
// "test": to generate test mode version of the library
// "exported": to generate exported mode version of the library
@@ -70,19 +66,11 @@ func (a *aconfigDecorator) GenerateSource(ctx rust.ModuleContext, deps rust.Path
}
declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData)
- if a.Properties.Mode != nil && a.Properties.Test != nil {
- ctx.PropertyErrorf("test", "test prop should not be specified when mode prop is set")
- }
mode := proptools.StringDefault(a.Properties.Mode, "production")
if !isModeSupported(mode) {
ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
}
- // TODO: remove "Test" property
- if proptools.Bool(a.Properties.Test) {
- mode = "test"
- }
-
ctx.Build(pctx, android.BuildParams{
Rule: rustRule,
Input: declarations.IntermediatePath,
diff --git a/aconfig/rust_aconfig_library_test.go b/aconfig/rust_aconfig_library_test.go
index 5e630b517..3aeab7622 100644
--- a/aconfig/rust_aconfig_library_test.go
+++ b/aconfig/rust_aconfig_library_test.go
@@ -119,8 +119,6 @@ var incorrectRustCodegenModeTestData = []struct {
setting, expectedErr string
}{
{"mode: `unsupported`,", "mode: \"unsupported\" is not a supported mode"},
- // TODO: remove this test case when test prop is removed
- {"mode: `test`, test: true", "test prop should not be specified when mode prop is set"},
}
func TestIncorrectRustCodegenMode(t *testing.T) {