From 87f87f59ed9472816f6dbee8932503482001befb Mon Sep 17 00:00:00 2001 From: chenyiyuan Date: Tue, 10 Jun 2025 14:58:58 +0800 Subject: [PATCH] Add bchar declgen in collectDependentCompileFiles Signed-off-by: chenyiyuan Change-Id: I195f9d96671a75cb2de3b9bfed3a2113858bf61d --- .../driver/build_system/src/build/base_mode.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index e1d65f97f6..c461fec4b9 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -507,6 +507,10 @@ export abstract class BaseMode { const queue: string[] = []; this.entryFiles.forEach((file: string) => { + // Skip the declaration files when compiling abc + if (file.endsWith(DECL_ETS_SUFFIX)) { + return; + } let hasModule = false; for (const [packageName, moduleInfo] of this.moduleInfos) { if (!file.startsWith(moduleInfo.moduleRootPath)) { @@ -546,6 +550,7 @@ export abstract class BaseMode { return; } }); + this.collectAbcFileFromByteCodeHar(); while (queue.length > 0) { const currentFile = queue.shift()!; @@ -607,17 +612,10 @@ export abstract class BaseMode { return; } this.entryFiles.forEach((file: string) => { - // Skip the declaration files when compiling abc - if (file.endsWith(DECL_ETS_SUFFIX)) { - return; - } for (const [packageName, moduleInfo] of this.moduleInfos) { if (!file.startsWith(moduleInfo.moduleRootPath)) { continue; } - if (moduleInfo.moduleType === OHOS_MODULE_TYPE.HAR && moduleInfo.byteCodeHar) { - return; - } let filePathFromModuleRoot: string = path.relative(moduleInfo.moduleRootPath, file); let filePathInCache: string = path.join(this.cacheDir, moduleInfo.packageName, filePathFromModuleRoot); let abcFilePath: string = path.resolve(changeFileExtension(filePathInCache, ABC_SUFFIX)); @@ -649,7 +647,7 @@ export abstract class BaseMode { protected collectAbcFileFromByteCodeHar(): void { // the abc of the dependent bytecode har needs to be included When compiling hsp/hap // but it's not required when compiling har - if (this.buildConfig.moduleType !== OHOS_MODULE_TYPE.HAR) { + if (this.buildConfig.moduleType === OHOS_MODULE_TYPE.HAR) { return; } for (const [packageName, moduleInfo] of this.moduleInfos) { -- Gitee