soong: Add support for RRO modules and omitting namespace block

This commit is contained in:
Danny Lin 2021-11-11 16:27:53 -08:00
parent 0c5c2ee78b
commit ea260df6d3

View file

@ -81,6 +81,10 @@ export interface DspModule {
sub_dir?: string sub_dir?: string
} }
export interface RroModule {
theme?: string
}
export interface SoongNamespace { export interface SoongNamespace {
imports: Array<string> imports: Array<string>
} }
@ -98,7 +102,8 @@ export type SoongModuleSpecific = {
EtcModule | EtcModule |
EtcXmlModule | EtcXmlModule |
DspModule | DspModule |
SoongNamespace SoongNamespace |
RroModule
) )
export type SoongModule = { export type SoongModule = {
@ -117,8 +122,10 @@ export type SoongModule = {
} & SoongModuleSpecific } & SoongModuleSpecific
export interface SoongBlueprint { export interface SoongBlueprint {
imports: Array<string> noNamespace?: boolean
modules: IterableIterator<SoongModule> imports?: Array<string>
modules: Iterable<SoongModule>
} }
function getRelativeInstallPath(entry: BlobEntry, pathParts: Array<string>, installDir: string) { function getRelativeInstallPath(entry: BlobEntry, pathParts: Array<string>, installDir: string) {
@ -324,10 +331,12 @@ export function serializeBlueprint(bp: SoongBlueprint) {
let serializedModules = [] let serializedModules = []
// Declare namespace // Declare namespace
serializedModules.push(serializeModule({ if (!bp.noNamespace) {
_type: 'soong_namespace', serializedModules.push(serializeModule({
imports: bp.imports, _type: 'soong_namespace',
})) ...(bp.imports != undefined && { imports: bp.imports })
}))
}
for (let module of bp.modules) { for (let module of bp.modules) {
let serialized = serializeModule(module) let serialized = serializeModule(module)