From 82c832e81ef2bb088d4bf023470a496f548a4ffa Mon Sep 17 00:00:00 2001 From: wuhailong Date: Thu, 6 Jun 2024 10:59:37 +0800 Subject: [PATCH] Fixed the problem that incremental compilation of tshar does not generate ts files Signed-off-by: wuhailong Change-Id: Ib733998cc2556c7f6d54475d53e1d8c2c80d8107 --- compiler/src/ark_utils.ts | 4 ++-- compiler/src/fast_build/ark_compiler/cache.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index ba34eb6f1..5162a53f2 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -186,7 +186,7 @@ function processPackageDir(params: Object): string { } } - logger.error(red,'ArkTS:ERROR Failed to resolve OhmUrl.\n' + + logger.error(red, 'ArkTS:ERROR Failed to resolve OhmUrl.\n' + `Error Message: Failed to get a resolved OhmUrl for "${originalFilePath}" imported by "${importerFile}".\n` + `Solutions: > Check whether the module which ${originalFilePath} belongs to is correctly configured.` + '> Check the corresponding file name is correct(including case-sensitivity).', reset); @@ -219,7 +219,7 @@ function processPackageDir(params: Object): string { } } - logger.error(red,'ArkTS:ERROR Failed to resolve OhmUrl.\n' + + logger.error(red, 'ArkTS:ERROR Failed to resolve OhmUrl.\n' + `Error Message: Failed to get a resolved OhmUrl for "${originalFilePath}" imported by "${importerFile}".\n` + `Solutions: > Check whether the module which ${originalFilePath} belongs to is correctly configured.` + '> Check the corresponding file name is correct(including case-sensitivity).', reset); diff --git a/compiler/src/fast_build/ark_compiler/cache.ts b/compiler/src/fast_build/ark_compiler/cache.ts index c30d65b65..7698ed35e 100644 --- a/compiler/src/fast_build/ark_compiler/cache.ts +++ b/compiler/src/fast_build/ark_compiler/cache.ts @@ -28,7 +28,7 @@ import { let disableCache: boolean = false; export function checkArkCompilerCacheInfo(rollupObject: Object): void { disableCache = false; - const metaInfo: string = getMetaInfo(rollupObject.share.projectConfig); + const metaInfo: string = getMetaInfo(rollupObject.share.projectConfig, rollupObject.share.arkProjectConfig); const lastMetaInfo: string = rollupObject.cache.get(ARK_COMPILER_META_INFO); if (!lastMetaInfo || metaInfo !== lastMetaInfo || isMockConfigModified(rollupObject)) { rollupObject.cache.set(IS_CACHE_INVALID, true); @@ -37,7 +37,7 @@ export function checkArkCompilerCacheInfo(rollupObject: Object): void { rollupObject.cache.set(ARK_COMPILER_META_INFO, metaInfo); } -function getMetaInfo(projectConfig: Object): string { +function getMetaInfo(projectConfig: Object, arkProjectConfig: Object): string { let metaInfoArr: string[] = []; // user selects the compiled API version information const compileSdkVersion: string = projectConfig.compileSdkVersion ? @@ -55,6 +55,11 @@ function getMetaInfo(projectConfig: Object): string { projectConfig.etsLoaderReleaseType : 'null_sdkReleaseType'; metaInfoArr.push(compileSdkVersion, compatibleSdkVersion, runtimeOS, sdkPath, sdkVersion, sdkReleaseType); + if (projectConfig.compileHar) { + const useTsHar: string = arkProjectConfig.useTsHar; + metaInfoArr.push(useTsHar); + } + if (projectConfig.compileMode === ESMODULE) { const bundleName: string = projectConfig.bundleName ? projectConfig.bundleName : 'null_bundleName'; const allModuleNameHash: string = projectConfig.allModuleNameHash ? projectConfig.allModuleNameHash : -- Gitee