mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-20 19:47:44 -04:00
@@ -380,6 +380,37 @@ function loadModuleInfo(projectConfig, envArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkAppResourcePath(appResourcePath, config) {
|
||||
if (appResourcePath) {
|
||||
const appResourcePathSavePath = path.resolve(projectConfig.cachePath, 'resource_path.txt');
|
||||
saveAppResourcePath(appResourcePath, appResourcePathSavePath);
|
||||
readAppResource(resources, appResourcePath);
|
||||
if (fs.existsSync(appResourcePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePath);
|
||||
}
|
||||
if (fs.existsSync(appResourcePathSavePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePathSavePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveAppResourcePath(appResourcePath, appResourcePathSavePath) {
|
||||
if (!projectConfig.xtsMode) {
|
||||
let isSave = false;
|
||||
if (fs.existsSync(appResourcePathSavePath)) {
|
||||
const saveContent = fs.readFileSync(appResourcePathSavePath);
|
||||
if (appResourcePath !== saveContent) {
|
||||
isSave = true;
|
||||
}
|
||||
} else {
|
||||
isSave = true;
|
||||
}
|
||||
if (isSave) {
|
||||
fs.writeFileSync(appResourcePathSavePath, appResourcePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const globalProgram = {
|
||||
program: null,
|
||||
watchProgram: null
|
||||
@@ -396,3 +427,4 @@ exports.readWorkerFile = readWorkerFile;
|
||||
exports.abilityPagesFullPath = abilityPagesFullPath;
|
||||
exports.loadModuleInfo = loadModuleInfo;
|
||||
exports.systemModules = systemModules;
|
||||
exports.checkAppResourcePath = checkAppResourcePath;
|
||||
|
||||
@@ -24,12 +24,11 @@ const buildPipeServer = require('./server/build_pipe_server');
|
||||
const {
|
||||
projectConfig,
|
||||
loadEntryObj,
|
||||
readAppResource,
|
||||
resources,
|
||||
loadWorker,
|
||||
abilityConfig,
|
||||
readWorkerFile,
|
||||
loadModuleInfo
|
||||
loadModuleInfo,
|
||||
checkAppResourcePath
|
||||
} = require('./main');
|
||||
const { ResultStates } = require('./lib/compile_info');
|
||||
const { processUISyntax } = require('./lib/process_ui_syntax');
|
||||
@@ -379,12 +378,7 @@ module.exports = (env, argv) => {
|
||||
}
|
||||
|
||||
const appResourcePath = env.appResource || process.env.appResource;
|
||||
if (appResourcePath) {
|
||||
readAppResource(resources, appResourcePath);
|
||||
if (fs.existsSync(appResourcePath) && config.cache) {
|
||||
config.cache.buildDependencies.config.push(appResourcePath)
|
||||
}
|
||||
}
|
||||
checkAppResourcePath(appResourcePath, config);
|
||||
config.output.library = projectConfig.hashProjectPath;
|
||||
return config;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user