diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index 1c05abf17a61007bce3699a812977dc7c861fdd6..dccb49481f89cbbff28832bcd2ae3f123f0b0dc0 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -314,7 +314,8 @@ export abstract class BaseMode { } finally { if (!errorStatus) { // when error occur,wrapper will destroy context. - arktsGlobal.es2panda._DestroyContext(arktsGlobal.compilerContext.peer); + // comment this in 0603 to solve free() invalid pointer + //arktsGlobal.es2panda._DestroyContext(arktsGlobal.compilerContext.peer); } PluginDriver.getInstance().runPluginHook(PluginHook.CLEAN); arkts.destroyConfig(arktsGlobal.config); diff --git a/ets2panda/driver/build_system/src/build/generate_arktsconfig.ts b/ets2panda/driver/build_system/src/build/generate_arktsconfig.ts index edb1224fb7fa0532a24ea30b33f109ea4bb32b32..c34333082c6838d457fccbda28fe7dc00622b6cb 100644 --- a/ets2panda/driver/build_system/src/build/generate_arktsconfig.ts +++ b/ets2panda/driver/build_system/src/build/generate_arktsconfig.ts @@ -32,7 +32,8 @@ import { } from '../utils'; import { BuildConfig, - ModuleInfo + ModuleInfo, + PathsConfig } from '../types'; import { LANGUAGE_VERSION, @@ -252,6 +253,11 @@ export class ArkTSConfigGenerator { } let baseUrl: string = path.resolve(moduleInfo.moduleRootPath, moduleInfo.sourceRoots[0]); + if (buildConfig.paths) { + Object.entries(buildConfig.paths).map(([key, value]) => { + pathSection[key] = value + }); + } let arktsConfig: ArkTSConfigObject = { compilerOptions: { package: moduleInfo.packageName, diff --git a/ets2panda/driver/build_system/src/types.ts b/ets2panda/driver/build_system/src/types.ts index 37745789b4869d5a84fc362249ec1f953a714a5f..613cde8acc8ae6971941e37d90c5748d608b9bbf 100644 --- a/ets2panda/driver/build_system/src/types.ts +++ b/ets2panda/driver/build_system/src/types.ts @@ -18,6 +18,10 @@ export interface PluginsConfig { [pluginName: string]: string; } +export interface PathsConfig { + [pathName: string]: string[]; +} + export interface BuildBaseConfig { buildType: 'build' | 'preview' | 'hotreload' | 'coldreload'; buildMode: 'Debug' | 'Release'; @@ -139,6 +143,7 @@ export interface DependentModuleConfig { export interface BuildConfig extends BuildBaseConfig, DeclgenConfig, LoggerConfig, ModuleConfig, PathConfig, FrameworkConfig { plugins: PluginsConfig; + paths: PathsConfig; // paths config passed from template to generate arktsconfig.json "paths" configs. compileFiles: string[]; dependentModuleList: DependentModuleConfig[]; }