Introduce module type aconfig_declarations_group

In order to easily manage aconfig_declarations modules and their
corresponding codegen modules, this change introduces a new module type
`aconfig_declarations_group`. The module enables listing codegen modules
by language, and correctly depend on the desired output files using
appropriate tags.

e.g. for an aconfig_declarations_group module "some_group", the rdeps of
the module can:
- gather all intermediates cache files of the aconfig_declarations with
  ":some_group" tag.
- gather generated srcjar files of the listed java_aconfig_library
  modules with ":some_group{.srcjars}" tag.

Output tag support for cc modules and rust modules will be added in
future changes.

Test: m nothing --no-skip-soong-tests
Bug: 320492079
Change-Id: I93d737577f8d00198ed91048dd6e81ef238193cb
This commit is contained in:
Jihoon Kang
2024-02-12 19:05:12 +00:00
parent 9923e80b3d
commit 2a43e56b5f
6 changed files with 232 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ package codegen
import (
"fmt"
"android/soong/aconfig"
"android/soong/android"
"android/soong/java"
@@ -118,6 +119,12 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuild
module.AddJarJarRenameRule(declarations.Package+".FakeFeatureFlagsImpl", "")
}
android.SetProvider(ctx, aconfig.CodegenInfoProvider, aconfig.CodegenInfo{
AconfigDeclarations: []string{declarationsModules[0].Name()},
IntermediateCacheOutputPaths: android.Paths{declarations.IntermediateCacheOutputPath},
Srcjars: android.Paths{srcJarPath},
})
return srcJarPath
}