From bd8325b2ab8363f39c3ef427445a86e0640f4517 Mon Sep 17 00:00:00 2001 From: lihao550 Date: Fri, 11 Jul 2025 22:39:40 +0800 Subject: [PATCH] fix getMainModuleInfo Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICLSFS Signed-off-by: lihao Change-Id: I186c583992e567f17649cc38279ae3b6da38c01d --- ets2panda/driver/build_system/src/build/base_mode.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index 465492b1e76..2d7fc10ea86 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -511,18 +511,18 @@ export abstract class BaseMode { const mainModuleInfo = this.dependentModuleList.find((module: DependentModuleConfig) => module.packageName === this.packageName); return { isMainModule: this.hasMainModule, - packageName: this.packageName, - moduleRootPath: this.moduleRootPath, - moduleType: this.moduleType, + packageName: mainModuleInfo?.packageName ?? this.packageName, + moduleRootPath: mainModuleInfo?.modulePath ?? this.moduleRootPath, + moduleType: mainModuleInfo?.moduleType ?? this.moduleType, sourceRoots: this.sourceRoots, entryFile: '', arktsConfigFile: path.resolve(this.cacheDir, this.packageName, ARKTSCONFIG_JSON_FILE), dynamicDepModuleInfos: new Map(), staticDepModuleInfos: new Map(), compileFileInfos: [], - declgenV1OutPath: this.declgenV1OutPath, - declgenV2OutPath: this.declgenV2OutPath, - declgenBridgeCodePath: this.declgenBridgeCodePath, + declgenV1OutPath: mainModuleInfo?.declgenV1OutPath ?? this.declgenV1OutPath, + declgenV2OutPath: mainModuleInfo?.declgenV2OutPath ?? this.declgenV2OutPath, + declgenBridgeCodePath: mainModuleInfo?.declgenBridgeCodePath ?? this.declgenBridgeCodePath, byteCodeHar: this.byteCodeHar, language: mainModuleInfo?.language ?? LANGUAGE_VERSION.ARKTS_1_2, declFilesPath: mainModuleInfo?.declFilesPath, -- Gitee