diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 2bd39b6..2d59df0 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -221,6 +221,8 @@ export class ResultStates { if (!(fs.existsSync(parent) && !fs.statSync(parent).isFile())) { mkDir(parent); } + } else { + info = fs.readFileSync(projectConfig.aceSoPath, 'utf-8') + '\n'; } fs.writeFileSync(projectConfig.aceSoPath, info + Array.from(useOSFiles).join('\n')); } diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 3cfecb0..900d679 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -76,7 +76,7 @@ export function createLanguageService(rootFileNames: string[]): ts.LanguageServi } if (/(? { return item.replace(new RegExp('\\b' + STRUCT + '\\b', 'g'), `${CLASS} `); - }), false, fileResolvePath)); + }))); const sourceFile: ts.SourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); visitAllNode(sourceFile, defaultName, asName, path.dirname(fileResolvePath), log); diff --git a/compiler/src/result_process.ts b/compiler/src/result_process.ts index dd05dbe..fe96bf2 100644 --- a/compiler/src/result_process.ts +++ b/compiler/src/result_process.ts @@ -35,7 +35,7 @@ import { abilityConfig } from '../main'; module.exports = function resultProcess(source: string, map: any): void { process.env.compiler = BUILD_OFF; - source = processSystemApi(source, true, this.resourcePath); + source = processSystemApi(source, true); if (/\.ets$/.test(this.resourcePath)) { componentInfo.id = 0; propertyCollection.clear(); diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 50c985f..246ecc3 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -715,7 +715,7 @@ export function sourceReplace(source: string, sourcePath: string): ReplaceResult const log: LogInfo[] = []; content = preprocessExtend(content); // process @system. - content = processSystemApi(content); + content = processSystemApi(content, false, sourcePath); return { content: content, @@ -735,7 +735,7 @@ export function preprocessExtend(content: string, extendCollection?: Set }); } -export function processSystemApi(content: string, isProcessWhiteList: boolean = false, sourcePath: string): string { +export function processSystemApi(content: string, isProcessWhiteList: boolean = false, sourcePath?: string): string { let REG_SYSTEM: RegExp; if (isProcessWhiteList) { REG_SYSTEM =