From 000663fe1c3615f2c2b29e90c2b1f1d19b57ad7c Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Fri, 6 Oct 2023 13:55:37 +0300 Subject: [PATCH] fix Qualcomm XMLs that use '/* ... */' multiline header comments These comments aren't supported by AOSP build system. --- src/blobs/copy.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/blobs/copy.ts b/src/blobs/copy.ts index c3daa1c..8365181 100644 --- a/src/blobs/copy.ts +++ b/src/blobs/copy.ts @@ -25,9 +25,27 @@ export async function copyBlobs(entries: Iterable, srcDir: string, de // Some files need patching if (entry.path.endsWith('.xml')) { let xml = await readFile(srcPath) - // Fix Qualcomm "version 2.0" XMLs + // Fix Qualcomm XMLs + let patched if (xml.startsWith(' { + switch (line) { + case '/*': + return '' + default: + return line + } + }) + .join('\n') + } + + if (patched !== undefined) { await fs.writeFile(outPath, patched) continue }