diff --git a/aconfig/codegen/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go index 12c2dea3a..8df353d4d 100644 --- a/aconfig/codegen/cc_aconfig_library.go +++ b/aconfig/codegen/cc_aconfig_library.go @@ -40,6 +40,7 @@ type CcAconfigLibraryProperties struct { // 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 + // "force-read-only": to generate force-read-only mode version of the library // an error will be thrown if the mode is not supported Mode *string } diff --git a/aconfig/codegen/cc_aconfig_library_test.go b/aconfig/codegen/cc_aconfig_library_test.go index 3de46267d..c5ff6a18d 100644 --- a/aconfig/codegen/cc_aconfig_library_test.go +++ b/aconfig/codegen/cc_aconfig_library_test.go @@ -29,6 +29,7 @@ var ccCodegenModeTestData = []struct { {"mode: `production`,", "production"}, {"mode: `test`,", "test"}, {"mode: `exported`,", "exported"}, + {"mode: `force-read-only`,", "force-read-only"}, } func TestCCCodegenMode(t *testing.T) { diff --git a/aconfig/codegen/java_aconfig_library.go b/aconfig/codegen/java_aconfig_library.go index c027815db..e6817e0ae 100644 --- a/aconfig/codegen/java_aconfig_library.go +++ b/aconfig/codegen/java_aconfig_library.go @@ -30,7 +30,7 @@ type declarationsTagType struct { var declarationsTag = declarationsTagType{} -var aconfigSupportedModes = []string{"production", "test", "exported"} +var aconfigSupportedModes = []string{"production", "test", "exported", "force-read-only"} type JavaAconfigDeclarationsLibraryProperties struct { // name of the aconfig_declarations module to generate a library for @@ -39,6 +39,7 @@ type JavaAconfigDeclarationsLibraryProperties struct { // 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 + // "force-read-only": to generate force-read-only mode version of the library // an error will be thrown if the mode is not supported Mode *string } diff --git a/aconfig/codegen/java_aconfig_library_test.go b/aconfig/codegen/java_aconfig_library_test.go index 2523abcbc..8d54b5b36 100644 --- a/aconfig/codegen/java_aconfig_library_test.go +++ b/aconfig/codegen/java_aconfig_library_test.go @@ -227,6 +227,10 @@ func TestExportedMode(t *testing.T) { testCodegenMode(t, "mode: `exported`,", "exported") } +func TestForceReadOnlyMode(t *testing.T) { + testCodegenMode(t, "mode: `force-read-only`,", "force-read-only") +} + func TestUnsupportedMode(t *testing.T) { testCodegenModeWithError(t, "mode: `unsupported`,", "mode: \"unsupported\" is not a supported mode") } diff --git a/aconfig/codegen/rust_aconfig_library.go b/aconfig/codegen/rust_aconfig_library.go index 73b6fece2..2ab54b6ab 100644 --- a/aconfig/codegen/rust_aconfig_library.go +++ b/aconfig/codegen/rust_aconfig_library.go @@ -23,6 +23,7 @@ type RustAconfigLibraryProperties struct { // 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 + // "force-read-only": to generate force-read-only mode version of the library // an error will be thrown if the mode is not supported Mode *string } diff --git a/aconfig/codegen/rust_aconfig_library_test.go b/aconfig/codegen/rust_aconfig_library_test.go index c09f70149..60bc9f747 100644 --- a/aconfig/codegen/rust_aconfig_library_test.go +++ b/aconfig/codegen/rust_aconfig_library_test.go @@ -72,6 +72,7 @@ var rustCodegenModeTestData = []struct { {"mode: `production`,", "production"}, {"mode: `test`,", "test"}, {"mode: `exported`,", "exported"}, + {"mode: `force-read-only`,", "force-read-only"}, } func TestRustCodegenMode(t *testing.T) {