soong: Add support for namespace imports

This commit is contained in:
Danny Lin 2021-11-07 18:07:07 -08:00
parent e78b08f85f
commit d2e3fcd501

View file

@ -94,8 +94,11 @@ export type SoongModuleSpecific = {
)
export type SoongModule = {
name: string
owner: string
// TODO: make these more strict while accommodating SoongNamespace
name?: string
owner?: string
// Partition keys
system_ext_specific?: boolean
product_specific?: boolean
soc_specific?: boolean
@ -303,7 +306,10 @@ export function serializeBlueprint(bp: SoongBlueprint) {
let serializedModules = []
// Declare namespace
serializedModules.push(serializeModule({
_type: 'soong_namespace',
imports: bp.imports,
}))
for (let module of bp.modules) {
let serialized = serializeModule(module)
@ -312,10 +318,6 @@ export function serializeBlueprint(bp: SoongBlueprint) {
return `// Generated by adevtool; do not edit
soong_namespace {
imports: []
}
${serializedModules.join('\n\n')}
`
}