From d2e3fcd50129b78ee279b221681cf35c81fe329e Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 7 Nov 2021 18:07:07 -0800 Subject: [PATCH] soong: Add support for namespace imports --- src/build/soong.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/build/soong.ts b/src/build/soong.ts index 5b50986..bf43588 100644 --- a/src/build/soong.ts +++ b/src/build/soong.ts @@ -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')} ` }