!991 fix sdk change bug

Merge pull request !991 from 卡哥/master
This commit is contained in:
openharmony_ci
2022-08-25 06:27:12 +00:00
committed by Gitee
2 changed files with 17 additions and 1 deletions
+14
View File
@@ -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.localPropertiesPath = projectConfig.localPropertiesPath || process.env.localPropertiesPath
projectConfig.projectProfilePath = projectConfig.projectProfilePath || process.env.projectProfilePath
}
function loadEntryObj(projectConfig) {
@@ -411,6 +413,17 @@ function saveAppResourcePath(appResourcePath, appResourcePathSavePath) {
}
}
function addSDKBuildDependencies(config) {
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) {
config.cache.buildDependencies.config.push(projectConfig.projectProfilePath)
}
}
const globalProgram = {
program: null,
watchProgram: null
@@ -428,3 +441,4 @@ exports.abilityPagesFullPath = abilityPagesFullPath;
exports.loadModuleInfo = loadModuleInfo;
exports.systemModules = systemModules;
exports.checkAppResourcePath = checkAppResourcePath;
exports.addSDKBuildDependencies = addSDKBuildDependencies;
+3 -1
View File
@@ -28,7 +28,8 @@ const {
abilityConfig,
readWorkerFile,
loadModuleInfo,
checkAppResourcePath
checkAppResourcePath,
addSDKBuildDependencies
} = require('./main');
const { ResultStates } = require('./lib/compile_info');
const { processUISyntax } = require('./lib/process_ui_syntax');
@@ -384,6 +385,7 @@ module.exports = (env, argv) => {
const appResourcePath = env.appResource || process.env.appResource;
checkAppResourcePath(appResourcePath, config);
addSDKBuildDependencies(config);
config.output.library = projectConfig.hashProjectPath;
return config;
}