diff options
author | 2023-11-16 17:05:47 -0800 | |
---|---|---|
committer | 2023-11-28 12:37:02 -0800 | |
commit | eae7b36699477c9c781669f553a7c085e415ac1e (patch) | |
tree | 7c19e74a9068e7f638060497f079cdca6ae473d8 /aconfig | |
parent | 62093cf7fc83d4d002e9b802a5f6292bf7954744 (diff) |
Add container property to aconfig_declarations.
Bug: 311155208
Test: Unit test
Change-Id: I7b187138856d0144203961e82b6dad5e2f8eed9d
Diffstat (limited to 'aconfig')
-rw-r--r-- | aconfig/Android.bp | 9 | ||||
-rw-r--r-- | aconfig/aconfig_declarations.go | 56 | ||||
-rw-r--r-- | aconfig/aconfig_declarations_test.go | 4 | ||||
-rw-r--r-- | aconfig/all_aconfig_declarations.go | 6 | ||||
-rw-r--r-- | aconfig/codegen/Android.bp | 32 | ||||
-rw-r--r-- | aconfig/codegen/cc_aconfig_library.go (renamed from aconfig/cc_aconfig_library.go) | 7 | ||||
-rw-r--r-- | aconfig/codegen/cc_aconfig_library_test.go (renamed from aconfig/cc_aconfig_library_test.go) | 2 | ||||
-rw-r--r-- | aconfig/codegen/init.go | 83 | ||||
-rw-r--r-- | aconfig/codegen/java_aconfig_library.go (renamed from aconfig/java_aconfig_library.go) | 9 | ||||
-rw-r--r-- | aconfig/codegen/java_aconfig_library_test.go (renamed from aconfig/java_aconfig_library_test.go) | 42 | ||||
-rw-r--r-- | aconfig/codegen/rust_aconfig_library.go (renamed from aconfig/rust_aconfig_library.go) | 5 | ||||
-rw-r--r-- | aconfig/codegen/rust_aconfig_library_test.go (renamed from aconfig/rust_aconfig_library_test.go) | 2 | ||||
-rw-r--r-- | aconfig/codegen/testing.go | 25 | ||||
-rw-r--r-- | aconfig/init.go | 51 |
14 files changed, 240 insertions, 93 deletions
diff --git a/aconfig/Android.bp b/aconfig/Android.bp index faa4ddbb6..04de9198a 100644 --- a/aconfig/Android.bp +++ b/aconfig/Android.bp @@ -12,28 +12,19 @@ bootstrap_go_package { "soong", "soong-android", "soong-bazel", - "soong-android", - "soong-java", - "soong-rust", ], srcs: [ "aconfig_declarations.go", "aconfig_values.go", "aconfig_value_set.go", "all_aconfig_declarations.go", - "cc_aconfig_library.go", "init.go", - "java_aconfig_library.go", "testing.go", - "rust_aconfig_library.go", ], testSrcs: [ "aconfig_declarations_test.go", "aconfig_values_test.go", "aconfig_value_set_test.go", - "java_aconfig_library_test.go", - "cc_aconfig_library_test.go", - "rust_aconfig_library_test.go", ], pluginFor: ["soong_build"], } diff --git a/aconfig/aconfig_declarations.go b/aconfig/aconfig_declarations.go index 897f8925a..e662f1da4 100644 --- a/aconfig/aconfig_declarations.go +++ b/aconfig/aconfig_declarations.go @@ -38,6 +38,9 @@ type DeclarationsModule struct { // Values from TARGET_RELEASE / RELEASE_ACONFIG_VALUE_SETS Values []string `blueprint:"mutated"` + + // Container(system/vendor/apex) that this module belongs to + Container string } intermediatePath android.WritablePath @@ -69,6 +72,8 @@ func (module *DeclarationsModule) DepsMutator(ctx android.BottomUpMutatorContext if len(module.properties.Package) == 0 { ctx.PropertyErrorf("package", "missing package property") } + // TODO(b/311155208): Add mandatory check for container after all pre-existing + // ones are changed. // Add a dependency on the aconfig_value_sets defined in // RELEASE_ACONFIG_VALUE_SETS, and add any aconfig_values that @@ -110,12 +115,21 @@ func optionalVariable(prefix string, value string) string { } // Provider published by aconfig_value_set -type declarationsProviderData struct { +type DeclarationsProviderData struct { Package string + Container string IntermediatePath android.WritablePath } -var declarationsProviderKey = blueprint.NewProvider(declarationsProviderData{}) +var DeclarationsProviderKey = blueprint.NewProvider(DeclarationsProviderData{}) + +// This is used to collect the aconfig declarations info on the transitive closure, +// the data is keyed on the container. +type TransitiveDeclarationsInfo struct { + AconfigFiles map[string]*android.DepSet[android.Path] +} + +var TransitiveDeclarationsInfoProvider = blueprint.NewProvider(TransitiveDeclarationsInfo{}) func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag @@ -156,13 +170,49 @@ func (module *DeclarationsModule) GenerateAndroidBuildActions(ctx android.Module }, }) - ctx.SetProvider(declarationsProviderKey, declarationsProviderData{ + ctx.SetProvider(DeclarationsProviderKey, DeclarationsProviderData{ Package: module.properties.Package, + Container: module.properties.Container, IntermediatePath: intermediatePath, }) } +func CollectTransitiveAconfigFiles(ctx android.ModuleContext, transitiveAconfigFiles *map[string]*android.DepSet[android.Path]) { + if *transitiveAconfigFiles == nil { + *transitiveAconfigFiles = make(map[string]*android.DepSet[android.Path]) + } + ctx.VisitDirectDeps(func(module android.Module) { + if dep := ctx.OtherModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData); dep.IntermediatePath != nil { + aconfigMap := make(map[string]*android.DepSet[android.Path]) + aconfigMap[dep.Container] = android.NewDepSet(android.POSTORDER, []android.Path{dep.IntermediatePath}, nil) + mergeTransitiveAconfigFiles(aconfigMap, *transitiveAconfigFiles) + return + } + if dep := ctx.OtherModuleProvider(module, TransitiveDeclarationsInfoProvider).(TransitiveDeclarationsInfo); len(dep.AconfigFiles) > 0 { + mergeTransitiveAconfigFiles(dep.AconfigFiles, *transitiveAconfigFiles) + } + }) + + ctx.SetProvider(TransitiveDeclarationsInfoProvider, TransitiveDeclarationsInfo{ + AconfigFiles: *transitiveAconfigFiles, + }) +} + +func mergeTransitiveAconfigFiles(from, to map[string]*android.DepSet[android.Path]) { + for fromKey, fromValue := range from { + if fromValue == nil { + continue + } + toValue, ok := to[fromKey] + if !ok { + to[fromKey] = fromValue + } else { + to[fromKey] = android.NewDepSet(android.POSTORDER, toValue.ToList(), []*android.DepSet[android.Path]{fromValue}) + } + } +} + type bazelAconfigDeclarationsAttributes struct { Srcs bazel.LabelListAttribute Package string diff --git a/aconfig/aconfig_declarations_test.go b/aconfig/aconfig_declarations_test.go index e0d8f7d5a..e6bd87cd5 100644 --- a/aconfig/aconfig_declarations_test.go +++ b/aconfig/aconfig_declarations_test.go @@ -26,6 +26,7 @@ func TestAconfigDeclarations(t *testing.T) { aconfig_declarations { name: "module_name", package: "com.example.package", + container: "com.android.foo", srcs: [ "foo.aconfig", "bar.aconfig", @@ -37,8 +38,9 @@ func TestAconfigDeclarations(t *testing.T) { module := result.ModuleForTests("module_name", "").Module().(*DeclarationsModule) // Check that the provider has the right contents - depData := result.ModuleProvider(module, declarationsProviderKey).(declarationsProviderData) + depData := result.ModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData) android.AssertStringEquals(t, "package", depData.Package, "com.example.package") + android.AssertStringEquals(t, "container", depData.Container, "com.android.foo") if !strings.HasSuffix(depData.IntermediatePath.String(), "/intermediate.pb") { t.Errorf("Missing intermediates path in provider: %s", depData.IntermediatePath.String()) } diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go index 6096c6c0b..7ccb81a37 100644 --- a/aconfig/all_aconfig_declarations.go +++ b/aconfig/all_aconfig_declarations.go @@ -37,17 +37,17 @@ func (this *allAconfigDeclarationsSingleton) GenerateBuildActions(ctx android.Si // Find all of the aconfig_declarations modules var cacheFiles android.Paths ctx.VisitAllModules(func(module android.Module) { - if !ctx.ModuleHasProvider(module, declarationsProviderKey) { + if !ctx.ModuleHasProvider(module, DeclarationsProviderKey) { return } - decl := ctx.ModuleProvider(module, declarationsProviderKey).(declarationsProviderData) + decl := ctx.ModuleProvider(module, DeclarationsProviderKey).(DeclarationsProviderData) cacheFiles = append(cacheFiles, decl.IntermediatePath) }) // Generate build action for aconfig this.intermediatePath = android.PathForIntermediates(ctx, "all_aconfig_declarations.pb") ctx.Build(pctx, android.BuildParams{ - Rule: allDeclarationsRule, + Rule: AllDeclarationsRule, Inputs: cacheFiles, Output: this.intermediatePath, Description: "all_aconfig_declarations", diff --git a/aconfig/codegen/Android.bp b/aconfig/codegen/Android.bp new file mode 100644 index 000000000..494f7e693 --- /dev/null +++ b/aconfig/codegen/Android.bp @@ -0,0 +1,32 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +bootstrap_go_package { + name: "soong-aconfig-codegen", + pkgPath: "android/soong/aconfig/codegen", + deps: [ + "blueprint", + "blueprint-pathtools", + "sbox_proto", + "soong", + "soong-aconfig", + "soong-android", + "soong-bazel", + "soong-java", + "soong-rust", + ], + srcs: [ + "cc_aconfig_library.go", + "init.go", + "java_aconfig_library.go", + "rust_aconfig_library.go", + "testing.go", + ], + testSrcs: [ + "java_aconfig_library_test.go", + "cc_aconfig_library_test.go", + "rust_aconfig_library_test.go", + ], + pluginFor: ["soong_build"], +} diff --git a/aconfig/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go index 210a58105..7b68844e9 100644 --- a/aconfig/cc_aconfig_library.go +++ b/aconfig/codegen/cc_aconfig_library.go @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package aconfig +package codegen import ( + "android/soong/aconfig" "android/soong/android" "android/soong/bazel" "android/soong/cc" @@ -92,7 +93,7 @@ func (this *CcAconfigLibraryCallbacks) GeneratorSources(ctx cc.ModuleContext) cc if len(declarationsModules) != 1 { panic(fmt.Errorf("Exactly one aconfig_declarations property required")) } - declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData) + declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData) // Figure out the generated file paths. This has to match aconfig's codegen_cpp.rs. this.generatedDir = android.PathForModuleGen(ctx) @@ -122,7 +123,7 @@ func (this *CcAconfigLibraryCallbacks) GeneratorBuildActions(ctx cc.ModuleContex if len(declarationsModules) != 1 { panic(fmt.Errorf("Exactly one aconfig_declarations property required")) } - declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData) + declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData) mode := proptools.StringDefault(this.properties.Mode, "production") if !isModeSupported(mode) { diff --git a/aconfig/cc_aconfig_library_test.go b/aconfig/codegen/cc_aconfig_library_test.go index ba2725059..0c8a96936 100644 --- a/aconfig/cc_aconfig_library_test.go +++ b/aconfig/codegen/cc_aconfig_library_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package aconfig +package codegen import ( "fmt" diff --git a/aconfig/codegen/init.go b/aconfig/codegen/init.go new file mode 100644 index 000000000..0bff9d2af --- /dev/null +++ b/aconfig/codegen/init.go @@ -0,0 +1,83 @@ +// Copyright 2023 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codegen + +import ( + "android/soong/android" + + "github.com/google/blueprint" +) + +var ( + pctx = android.NewPackageContext("android/soong/aconfig/codegen") + + // For java_aconfig_library: Generate java library + javaRule = pctx.AndroidStaticRule("java_aconfig_library", + blueprint.RuleParams{ + Command: `rm -rf ${out}.tmp` + + ` && mkdir -p ${out}.tmp` + + ` && ${aconfig} create-java-lib` + + ` --mode ${mode}` + + ` --cache ${in}` + + ` --out ${out}.tmp` + + ` && $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` + + ` && rm -rf ${out}.tmp`, + CommandDeps: []string{ + "$aconfig", + "$soong_zip", + }, + Restat: true, + }, "mode") + + // For cc_aconfig_library: Generate C++ library + cppRule = pctx.AndroidStaticRule("cc_aconfig_library", + blueprint.RuleParams{ + Command: `rm -rf ${gendir}` + + ` && mkdir -p ${gendir}` + + ` && ${aconfig} create-cpp-lib` + + ` --mode ${mode}` + + ` --cache ${in}` + + ` --out ${gendir}`, + CommandDeps: []string{ + "$aconfig", + }, + }, "gendir", "mode") + + // For rust_aconfig_library: Generate Rust library + rustRule = pctx.AndroidStaticRule("rust_aconfig_library", + blueprint.RuleParams{ + Command: `rm -rf ${gendir}` + + ` && mkdir -p ${gendir}` + + ` && ${aconfig} create-rust-lib` + + ` --mode ${mode}` + + ` --cache ${in}` + + ` --out ${gendir}`, + CommandDeps: []string{ + "$aconfig", + }, + }, "gendir", "mode") +) + +func init() { + RegisterBuildComponents(android.InitRegistrationContext) + pctx.HostBinToolVariable("aconfig", "aconfig") + pctx.HostBinToolVariable("soong_zip", "soong_zip") +} + +func RegisterBuildComponents(ctx android.RegistrationContext) { + ctx.RegisterModuleType("cc_aconfig_library", CcAconfigLibraryFactory) + ctx.RegisterModuleType("java_aconfig_library", JavaDeclarationsLibraryFactory) + ctx.RegisterModuleType("rust_aconfig_library", RustAconfigLibraryFactory) +} diff --git a/aconfig/java_aconfig_library.go b/aconfig/codegen/java_aconfig_library.go index eedb3c358..e2fb15bc7 100644 --- a/aconfig/java_aconfig_library.go +++ b/aconfig/codegen/java_aconfig_library.go @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package aconfig +package codegen import ( "fmt" + "android/soong/aconfig" "android/soong/android" "android/soong/bazel" "android/soong/java" @@ -73,7 +74,7 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuild if len(declarationsModules) != 1 { panic(fmt.Errorf("Exactly one aconfig_declarations property required")) } - declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData) + declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData) // Generate the action to build the srcjar srcJarPath := android.PathForModuleGen(ctx, ctx.ModuleName()+".srcjar") @@ -93,10 +94,6 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuild }, }) - // Tell the java module about the .aconfig files, so they can be propagated up the dependency chain. - // TODO: It would be nice to have that propagation code here instead of on java.Module and java.JavaInfo. - module.AddAconfigIntermediate(declarations.IntermediatePath) - return srcJarPath } diff --git a/aconfig/java_aconfig_library_test.go b/aconfig/codegen/java_aconfig_library_test.go index a803672db..cbfdc2179 100644 --- a/aconfig/java_aconfig_library_test.go +++ b/aconfig/codegen/java_aconfig_library_test.go @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package aconfig +package codegen import ( "fmt" - "strings" "testing" "android/soong/android" @@ -34,14 +33,25 @@ func runJavaAndroidMkTest(t *testing.T, bp string) { ExtendWithErrorHandler(android.FixtureExpectsNoErrors). RunTestWithBp(t, bp+` aconfig_declarations { - name: "my_aconfig_declarations", + name: "my_aconfig_declarations_foo", package: "com.example.package", srcs: ["foo.aconfig"], } java_aconfig_library { - name: "my_java_aconfig_library", - aconfig_declarations: "my_aconfig_declarations", + name: "my_java_aconfig_library_foo", + aconfig_declarations: "my_aconfig_declarations_foo", + } + + aconfig_declarations { + name: "my_aconfig_declarations_bar", + package: "com.example.package", + srcs: ["bar.aconfig"], + } + + java_aconfig_library { + name: "my_java_aconfig_library_bar", + aconfig_declarations: "my_aconfig_declarations_bar", } `) @@ -50,10 +60,9 @@ func runJavaAndroidMkTest(t *testing.T, bp string) { entry := android.AndroidMkEntriesForTest(t, result.TestContext, module)[0] makeVar := entry.EntryMap["LOCAL_ACONFIG_FILES"] - android.AssertIntEquals(t, "len(LOCAL_ACONFIG_FILES)", 1, len(makeVar)) - if !strings.HasSuffix(makeVar[0], "intermediate.pb") { - t.Errorf("LOCAL_ACONFIG_FILES should end with /intermediates.pb, instead it is: %s", makeVar[0]) - } + android.AssertIntEquals(t, "len(LOCAL_ACONFIG_FILES)", 2, len(makeVar)) + android.EnsureListContainsSuffix(t, makeVar, "my_aconfig_declarations_foo/intermediate.pb") + android.EnsureListContainsSuffix(t, makeVar, "my_aconfig_declarations_bar/intermediate.pb") } func TestAndroidMkJavaLibrary(t *testing.T) { @@ -64,7 +73,8 @@ func TestAndroidMkJavaLibrary(t *testing.T) { "src/foo.java", ], static_libs: [ - "my_java_aconfig_library", + "my_java_aconfig_library_foo", + "my_java_aconfig_library_bar", ], platform_apis: true, } @@ -81,7 +91,8 @@ func TestAndroidMkAndroidApp(t *testing.T) { "src/foo.java", ], static_libs: [ - "my_java_aconfig_library", + "my_java_aconfig_library_foo", + "my_java_aconfig_library_bar", ], platform_apis: true, } @@ -98,7 +109,8 @@ func TestAndroidMkBinary(t *testing.T) { "src/foo.java", ], static_libs: [ - "my_java_aconfig_library", + "my_java_aconfig_library_foo", + "my_java_aconfig_library_bar", ], platform_apis: true, main_class: "foo", @@ -116,7 +128,8 @@ func TestAndroidMkAndroidLibrary(t *testing.T) { "src/foo.java", ], static_libs: [ - "my_java_aconfig_library", + "my_java_aconfig_library_foo", + "my_java_aconfig_library_bar", ], platform_apis: true, } @@ -134,7 +147,8 @@ func TestAndroidMkBinaryThatLinksAgainstAar(t *testing.T) { "src/foo.java", ], static_libs: [ - "my_java_aconfig_library", + "my_java_aconfig_library_foo", + "my_java_aconfig_library_bar", ], platform_apis: true, } diff --git a/aconfig/rust_aconfig_library.go b/aconfig/codegen/rust_aconfig_library.go index 265685e6f..3525de19a 100644 --- a/aconfig/rust_aconfig_library.go +++ b/aconfig/codegen/rust_aconfig_library.go @@ -1,8 +1,9 @@ -package aconfig +package codegen import ( "fmt" + "android/soong/aconfig" "android/soong/android" "android/soong/rust" @@ -64,7 +65,7 @@ func (a *aconfigDecorator) GenerateSource(ctx rust.ModuleContext, deps rust.Path if len(declarationsModules) != 1 { panic(fmt.Errorf("Exactly one aconfig_declarations property required")) } - declarations := ctx.OtherModuleProvider(declarationsModules[0], declarationsProviderKey).(declarationsProviderData) + declarations := ctx.OtherModuleProvider(declarationsModules[0], aconfig.DeclarationsProviderKey).(aconfig.DeclarationsProviderData) mode := proptools.StringDefault(a.Properties.Mode, "production") if !isModeSupported(mode) { diff --git a/aconfig/rust_aconfig_library_test.go b/aconfig/codegen/rust_aconfig_library_test.go index 3aeab7622..c09f70149 100644 --- a/aconfig/rust_aconfig_library_test.go +++ b/aconfig/codegen/rust_aconfig_library_test.go @@ -1,4 +1,4 @@ -package aconfig +package codegen import ( "fmt" diff --git a/aconfig/codegen/testing.go b/aconfig/codegen/testing.go new file mode 100644 index 000000000..3e1c22eb9 --- /dev/null +++ b/aconfig/codegen/testing.go @@ -0,0 +1,25 @@ +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package codegen + +import ( + "android/soong/aconfig" + "android/soong/android" +) + +var PrepareForTestWithAconfigBuildComponents = android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) { + ctx.RegisterModuleType("aconfig_declarations", aconfig.DeclarationsFactory) + RegisterBuildComponents(ctx) +}) diff --git a/aconfig/init.go b/aconfig/init.go index 626e66d0f..79bf0027b 100644 --- a/aconfig/init.go +++ b/aconfig/init.go @@ -40,54 +40,8 @@ var ( Restat: true, }, "release_version", "package", "declarations", "values", "default-permission") - // For java_aconfig_library: Generate java library - javaRule = pctx.AndroidStaticRule("java_aconfig_library", - blueprint.RuleParams{ - Command: `rm -rf ${out}.tmp` + - ` && mkdir -p ${out}.tmp` + - ` && ${aconfig} create-java-lib` + - ` --mode ${mode}` + - ` --cache ${in}` + - ` --out ${out}.tmp` + - ` && $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` + - ` && rm -rf ${out}.tmp`, - CommandDeps: []string{ - "$aconfig", - "$soong_zip", - }, - Restat: true, - }, "mode") - - // For cc_aconfig_library: Generate C++ library - cppRule = pctx.AndroidStaticRule("cc_aconfig_library", - blueprint.RuleParams{ - Command: `rm -rf ${gendir}` + - ` && mkdir -p ${gendir}` + - ` && ${aconfig} create-cpp-lib` + - ` --mode ${mode}` + - ` --cache ${in}` + - ` --out ${gendir}`, - CommandDeps: []string{ - "$aconfig", - }, - }, "gendir", "mode") - - // For rust_aconfig_library: Generate Rust library - rustRule = pctx.AndroidStaticRule("rust_aconfig_library", - blueprint.RuleParams{ - Command: `rm -rf ${gendir}` + - ` && mkdir -p ${gendir}` + - ` && ${aconfig} create-rust-lib` + - ` --mode ${mode}` + - ` --cache ${in}` + - ` --out ${gendir}`, - CommandDeps: []string{ - "$aconfig", - }, - }, "gendir", "mode") - // For all_aconfig_declarations: Combine all parsed_flags proto files - allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", + AllDeclarationsRule = pctx.AndroidStaticRule("All_aconfig_declarations_dump", blueprint.RuleParams{ Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`, CommandDeps: []string{ @@ -106,8 +60,5 @@ func RegisterBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("aconfig_declarations", DeclarationsFactory) ctx.RegisterModuleType("aconfig_values", ValuesFactory) ctx.RegisterModuleType("aconfig_value_set", ValueSetFactory) - ctx.RegisterModuleType("cc_aconfig_library", CcAconfigLibraryFactory) - ctx.RegisterModuleType("java_aconfig_library", JavaDeclarationsLibraryFactory) - ctx.RegisterModuleType("rust_aconfig_library", RustAconfigLibraryFactory) ctx.RegisterParallelSingletonType("all_aconfig_declarations", AllAconfigDeclarationsFactory) } |