diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index c208585be1336a5715ff9c94976c59c4610408a4..91bbb70b32cfec201e412de5a2e3a2c7a75d205f 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 49644a1a6db1d0c9e2c79a468765f33728b6982d..ab98fac0c5d670bfd9c6c71e6474745e7e00e192 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 d9f719d3eb8b8abf84170b9983cfe4667b82f497..1ae817d7d03b710f5eedc669d1713972c75c6aa8 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 cd665c12da6a7f6e995c6f16c202b332674c4035..9b64cc0f4be8977b0141df578c5881374dad3050 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)) {