From b52fb5ac89d18a15727f58fc5f08d646db20db22 Mon Sep 17 00:00:00 2001 From: tension <1113989231@qq.com> Date: Mon, 28 Jul 2025 15:33:16 +0800 Subject: [PATCH] Delete excessive directory structure Issue: ICOAF1 Signed-off-by: zhangli <1113989231@qq.com> Change-id: ac8af9f45d874c15c7e81ce49b318a52aza4e96cd --- ets2panda/driver/build_system/src/build/base_mode.ts | 5 ++++- .../driver/build_system/src/build/compile_thread_worker.ts | 2 ++ ets2panda/driver/build_system/src/build/compile_worker.ts | 3 ++- ets2panda/util/importPathManager.cpp | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index c208585be1..91bbb70b32 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -235,6 +235,7 @@ export abstract class BaseMode { if (this.isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(fileInfo.filePath); this.logger.printInfo('ets2pandaCmd: ' + ets2pandaCmd.join(' ')); @@ -270,7 +271,7 @@ export abstract class BaseMode { if (this.hasMainModule && (this.byteCodeHar || this.moduleType === OHOS_MODULE_TYPE.SHARED)) { let filePathFromModuleRoot: string = path.relative(this.moduleRootPath, fileInfo.filePath); let declEtsOutputPath: string = changeFileExtension( - path.join(this.declgenV2OutPath as string, this.packageName, filePathFromModuleRoot), + path.join(this.declgenV2OutPath as string, filePathFromModuleRoot), DECL_ETS_SUFFIX ); ensurePathExists(declEtsOutputPath); @@ -325,6 +326,7 @@ export abstract class BaseMode { ensurePathExists(intermediateFilePath); if (this.isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(this.buildConfig.compileFiles[0]); this.logger.printInfo('ets2pandaCmd: ' + ets2pandaCmd.join(' ')); @@ -1381,6 +1383,7 @@ export abstract class BaseMode { if (this.isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(fileInfo.filePath); diff --git a/ets2panda/driver/build_system/src/build/compile_thread_worker.ts b/ets2panda/driver/build_system/src/build/compile_thread_worker.ts index 49644a1a6d..ab98fac0c5 100644 --- a/ets2panda/driver/build_system/src/build/compile_thread_worker.ts +++ b/ets2panda/driver/build_system/src/build/compile_thread_worker.ts @@ -62,6 +62,7 @@ function compileAbc(jobInfo: JobInfo): void { if (isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(fileInfo.filePath); @@ -134,6 +135,7 @@ function compileExternalProgram(jobInfo: JobInfo): void { if (isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(fileInfo.filePath); diff --git a/ets2panda/driver/build_system/src/build/compile_worker.ts b/ets2panda/driver/build_system/src/build/compile_worker.ts index d9f719d3eb..1ae817d7d0 100644 --- a/ets2panda/driver/build_system/src/build/compile_worker.ts +++ b/ets2panda/driver/build_system/src/build/compile_worker.ts @@ -62,6 +62,7 @@ process.on('message', (message: { ]; if (isDebug) { ets2pandaCmd.push('--debug-info'); + ets2pandaCmd.push('--opt-level=0'); } ets2pandaCmd.push(fileInfo.filePath); @@ -86,7 +87,7 @@ process.on('message', (message: { if (buildConfig.hasMainModule && (buildConfig.byteCodeHar || buildConfig.moduleType === OHOS_MODULE_TYPE.SHARED)) { let filePathFromModuleRoot: string = path.relative(buildConfig.moduleRootPath, fileInfo.filePath); let declEtsOutputPath: string = changeFileExtension( - path.join(buildConfig.declgenV2OutPath as string, buildConfig.packageName, filePathFromModuleRoot), + path.join(buildConfig.declgenV2OutPath as string, filePathFromModuleRoot), DECL_ETS_SUFFIX ); ensurePathExists(declEtsOutputPath); diff --git a/ets2panda/util/importPathManager.cpp b/ets2panda/util/importPathManager.cpp index cd665c12da..9b64cc0f4b 100644 --- a/ets2panda/util/importPathManager.cpp +++ b/ets2panda/util/importPathManager.cpp @@ -44,7 +44,7 @@ namespace fs = std::experimental::filesystem; #endif namespace ark::es2panda::util { -constexpr size_t SUPPORTED_INDEX_FILES_SIZE = 3; +constexpr size_t SUPPORTED_INDEX_FILES_SIZE = 4; constexpr size_t SUPPORTED_EXTENSIONS_SIZE = 6; constexpr size_t ALLOWED_EXTENSIONS_SIZE = 8; @@ -366,7 +366,8 @@ std::string ImportPathManager::TryMatchDependencies(std::string_view fixedPath) std::string_view ImportPathManager::DirOrDirWithIndexFile(StringView dir) const { // Supported index files: keep this checking order - std::array supportedIndexFiles = {"index.ets", "index.sts", "index.ts"}; + std::array supportedIndexFiles = {"index.ets", "index.sts", "index.ts", + "index.d.ets"}; for (const auto &indexFile : supportedIndexFiles) { std::string indexFilePath = dir.Mutf8() + ark::os::file::File::GetPathDelim().at(0) + indexFile; if (ark::os::file::File::IsRegularFile(indexFilePath)) { -- Gitee