From c5f7177af1c6524046e9641fab1a2c272fc25af3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Aug 2022 20:32:35 +0800 Subject: [PATCH 1/2] lizhouze@huawei.com Signed-off-by: unknown --- compiler/main.js | 14 ++++++++++++++ compiler/webpack.config.js | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/main.js b/compiler/main.js index 68374ba..540f4bf 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -66,6 +66,8 @@ function initProjectConfig(projectConfig) { path.resolve(__dirname, 'node_modules/.cache'); projectConfig.aceSoPath = projectConfig.aceSoPath || process.env.aceSoPath; projectConfig.xtsMode = /ets_loader_ark$/.test(__dirname); + projectConfig.localProertiesPath = projectConfig.localProertiesPath || process.env.localProertiesPath + projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath } function loadEntryObj(projectConfig) { @@ -369,6 +371,17 @@ function saveAppResourcePath(appResourcePath, appResourcePathSavePath) { } } +function addSDKBuildDependencies(config) { + if (projectConfig.localProertiesPath && + fs.existsSync(projectConfig.localProertiesPath) && config.cache) { + config.cache.buildDependencies.config.push(projectConfig.localProertiesPath) + } + if (projectConfig.projectProfilePath && + fs.existsSync(projectConfig.projectProfilePath) && config.cache) { + config.cache.buildDependencies.config.push(projectConfig.projectProfilePath) + } +} + const globalProgram = { program: null, watchProgram: null @@ -384,3 +397,4 @@ exports.abilityConfig = abilityConfig; exports.readWorkerFile = readWorkerFile; exports.systemModules = systemModules; exports.checkAppResourcePath = checkAppResourcePath; +exports.addSDKBuildDependencies = addSDKBuildDependencies; diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index 8d5d3f5..a42642b 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -27,7 +27,8 @@ const { loadWorker, abilityConfig, readWorkerFile, - checkAppResourcePath + checkAppResourcePath, + addSDKBuildDependencies } = require('./main'); const { ResultStates } = require('./lib/compile_info'); const { processUISyntax } = require('./lib/process_ui_syntax'); @@ -350,6 +351,7 @@ module.exports = (env, argv) => { const appResourcePath = env.appResource || process.env.appResource; checkAppResourcePath(appResourcePath, config); + addSDKBuildDependencies(config); config.output.library = projectConfig.hashProjectPath; return config; } \ No newline at end of file From e8a035a9282f5e5feb8cbf78fd952c1820af593b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E5=93=A5?= Date: Thu, 25 Aug 2022 03:37:03 +0000 Subject: [PATCH 2/2] update compiler/main.js. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卡哥 --- compiler/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 540f4bf..2d51298 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -66,7 +66,7 @@ function initProjectConfig(projectConfig) { path.resolve(__dirname, 'node_modules/.cache'); projectConfig.aceSoPath = projectConfig.aceSoPath || process.env.aceSoPath; projectConfig.xtsMode = /ets_loader_ark$/.test(__dirname); - projectConfig.localProertiesPath = projectConfig.localProertiesPath || process.env.localProertiesPath + projectConfig.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath } @@ -372,9 +372,9 @@ function saveAppResourcePath(appResourcePath, appResourcePathSavePath) { } function addSDKBuildDependencies(config) { - if (projectConfig.localProertiesPath && - fs.existsSync(projectConfig.localProertiesPath) && config.cache) { - config.cache.buildDependencies.config.push(projectConfig.localProertiesPath) + if (projectConfig.localPropertiesPath && + fs.existsSync(projectConfig.localPropertiesPath) && config.cache) { + config.cache.buildDependencies.config.push(projectConfig.localPropertiesPath) } if (projectConfig.projectProfilePath && fs.existsSync(projectConfig.projectProfilePath) && config.cache) {