Loading aconfig/codegen/cc_aconfig_library.go +10 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,11 @@ var ccDeclarationsTag = ccDeclarationsTagType{} const baseLibDep = "server_configurable_flags" const libBaseDep = "libbase" const libLogDep = "liblog" const libAconfigStorageReadApiCcDep = "libaconfig_storage_read_api_cc" const libAconfigStorageProtosCcDep = "libaconfig_storage_protos_cc" type CcAconfigLibraryProperties struct { // name of the aconfig_declarations module to generate a library for Aconfig_declarations string Loading Loading @@ -82,6 +87,11 @@ func (this *CcAconfigLibraryCallbacks) GeneratorDeps(ctx cc.DepsContext, deps cc // Add a dependency for the aconfig flags base library if it is not forced read only if mode != "force-read-only" { deps.SharedLibs = append(deps.SharedLibs, baseLibDep) deps.SharedLibs = append(deps.SharedLibs, libBaseDep) deps.SharedLibs = append(deps.SharedLibs, libLogDep) deps.SharedLibs = append(deps.SharedLibs, libAconfigStorageReadApiCcDep) deps.SharedLibs = append(deps.SharedLibs, libAconfigStorageProtosCcDep) } // TODO: It'd be really nice if we could reexport this library and not make everyone do it. Loading aconfig/codegen/cc_aconfig_library_test.go +65 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,26 @@ func testCCCodegenModeHelper(t *testing.T, bpMode string, ruleMode string) { srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "liblog", srcs: ["liblog.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } cc_aconfig_library { name: "my_cc_aconfig_library", aconfig_declarations: "my_aconfig_declarations", Loading Loading @@ -100,6 +120,27 @@ func testIncorrectCCCodegenModeHelper(t *testing.T, bpMode string, err string) { srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "liblog", srcs: ["liblog.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } cc_aconfig_library { name: "my_cc_aconfig_library", aconfig_declarations: "my_aconfig_declarations", Loading Loading @@ -152,6 +193,30 @@ func TestAndroidMkCcLibrary(t *testing.T) { srcs: ["server_configurable_flags.cc"], vendor_available: true, } cc_library { name: "libbase", srcs: ["libbase.cc"], vendor_available: true, } cc_library { name: "liblog", srcs: ["liblog.cc"], vendor_available: true, } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], vendor_available: true, } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], vendor_available: true, } ` result := android.GroupFixturePreparers( PrepareForTestWithAconfigBuildComponents, Loading apex/aconfig_test.go +36 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,18 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_bar", package: "com.example.package", Loading Loading @@ -410,6 +422,18 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_foo", package: "com.example.package", Loading Loading @@ -460,6 +484,18 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_foo", package: "com.example.package", Loading apex/apex_test.go +12 −0 Original line number Diff line number Diff line Loading @@ -10691,6 +10691,18 @@ func TestAconfigFilesJavaAndCcDeps(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } `) mod := ctx.ModuleForTests("myapex", "android_common_myapex") Loading Loading
aconfig/codegen/cc_aconfig_library.go +10 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,11 @@ var ccDeclarationsTag = ccDeclarationsTagType{} const baseLibDep = "server_configurable_flags" const libBaseDep = "libbase" const libLogDep = "liblog" const libAconfigStorageReadApiCcDep = "libaconfig_storage_read_api_cc" const libAconfigStorageProtosCcDep = "libaconfig_storage_protos_cc" type CcAconfigLibraryProperties struct { // name of the aconfig_declarations module to generate a library for Aconfig_declarations string Loading Loading @@ -82,6 +87,11 @@ func (this *CcAconfigLibraryCallbacks) GeneratorDeps(ctx cc.DepsContext, deps cc // Add a dependency for the aconfig flags base library if it is not forced read only if mode != "force-read-only" { deps.SharedLibs = append(deps.SharedLibs, baseLibDep) deps.SharedLibs = append(deps.SharedLibs, libBaseDep) deps.SharedLibs = append(deps.SharedLibs, libLogDep) deps.SharedLibs = append(deps.SharedLibs, libAconfigStorageReadApiCcDep) deps.SharedLibs = append(deps.SharedLibs, libAconfigStorageProtosCcDep) } // TODO: It'd be really nice if we could reexport this library and not make everyone do it. Loading
aconfig/codegen/cc_aconfig_library_test.go +65 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,26 @@ func testCCCodegenModeHelper(t *testing.T, bpMode string, ruleMode string) { srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "liblog", srcs: ["liblog.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } cc_aconfig_library { name: "my_cc_aconfig_library", aconfig_declarations: "my_aconfig_declarations", Loading Loading @@ -100,6 +120,27 @@ func testIncorrectCCCodegenModeHelper(t *testing.T, bpMode string, err string) { srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "liblog", srcs: ["liblog.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } cc_aconfig_library { name: "my_cc_aconfig_library", aconfig_declarations: "my_aconfig_declarations", Loading Loading @@ -152,6 +193,30 @@ func TestAndroidMkCcLibrary(t *testing.T) { srcs: ["server_configurable_flags.cc"], vendor_available: true, } cc_library { name: "libbase", srcs: ["libbase.cc"], vendor_available: true, } cc_library { name: "liblog", srcs: ["liblog.cc"], vendor_available: true, } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], vendor_available: true, } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], vendor_available: true, } ` result := android.GroupFixturePreparers( PrepareForTestWithAconfigBuildComponents, Loading
apex/aconfig_test.go +36 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,18 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_bar", package: "com.example.package", Loading Loading @@ -410,6 +422,18 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_foo", package: "com.example.package", Loading Loading @@ -460,6 +484,18 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } aconfig_declarations { name: "my_aconfig_declarations_foo", package: "com.example.package", Loading
apex/apex_test.go +12 −0 Original line number Diff line number Diff line Loading @@ -10691,6 +10691,18 @@ func TestAconfigFilesJavaAndCcDeps(t *testing.T) { name: "server_configurable_flags", srcs: ["server_configurable_flags.cc"], } cc_library { name: "libbase", srcs: ["libbase.cc"], } cc_library { name: "libaconfig_storage_read_api_cc", srcs: ["libaconfig_storage_read_api_cc.cc"], } cc_library { name: "libaconfig_storage_protos_cc", srcs: ["libaconfig_storage_protos_cc.cc"], } `) mod := ctx.ModuleForTests("myapex", "android_common_myapex") Loading