From ea260df6d3c80da2d999a7937b2d8ce8dd1f3947 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Thu, 11 Nov 2021 16:27:53 -0800 Subject: [PATCH] soong: Add support for RRO modules and omitting namespace block --- src/build/soong.ts | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/build/soong.ts b/src/build/soong.ts index 531836f..12314a1 100644 --- a/src/build/soong.ts +++ b/src/build/soong.ts @@ -81,6 +81,10 @@ export interface DspModule { sub_dir?: string } +export interface RroModule { + theme?: string +} + export interface SoongNamespace { imports: Array } @@ -98,7 +102,8 @@ export type SoongModuleSpecific = { EtcModule | EtcXmlModule | DspModule | - SoongNamespace + SoongNamespace | + RroModule ) export type SoongModule = { @@ -117,8 +122,10 @@ export type SoongModule = { } & SoongModuleSpecific export interface SoongBlueprint { - imports: Array - modules: IterableIterator + noNamespace?: boolean + imports?: Array + + modules: Iterable } function getRelativeInstallPath(entry: BlobEntry, pathParts: Array, installDir: string) { @@ -324,10 +331,12 @@ export function serializeBlueprint(bp: SoongBlueprint) { let serializedModules = [] // Declare namespace - serializedModules.push(serializeModule({ - _type: 'soong_namespace', - imports: bp.imports, - })) + if (!bp.noNamespace) { + serializedModules.push(serializeModule({ + _type: 'soong_namespace', + ...(bp.imports != undefined && { imports: bp.imports }) + })) + } for (let module of bp.modules) { let serialized = serializeModule(module)