mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-19 16:43:34 -04:00
add featureAbility Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: I19ad2057a33a533533d3836af6a2c175483d2817
This commit is contained in:
@@ -34,10 +34,14 @@ generateTargetFile(process.argv[2], process.argv[3]);
|
||||
function generateTargetFile(filePath, output) {
|
||||
const files = [];
|
||||
const globalTsFile = path.resolve(filePath, '../../global.d.ts');
|
||||
const featureAbilityPath = path.resolve(filePath, '../../../common/full/featureability.d.ts');
|
||||
const middleTsFile = path.resolve(filePath, 'middle_class.d.ts');
|
||||
if (fs.existsSync(globalTsFile)) {
|
||||
files.push(globalTsFile);
|
||||
}
|
||||
if (fs.existsSync(featureAbilityPath)) {
|
||||
files.push(featureAbilityPath);
|
||||
}
|
||||
readFile(filePath, files);
|
||||
if (!fs.existsSync(output)) {
|
||||
mkDir(output);
|
||||
@@ -59,7 +63,7 @@ function generateTargetFile(filePath, output) {
|
||||
files.forEach((item) => {
|
||||
let content = fs.readFileSync(item, 'utf8');
|
||||
const fileName = path.resolve(output, path.basename(item));
|
||||
if (item === globalTsFile) {
|
||||
if (item === globalTsFile || item === featureAbilityPath) {
|
||||
content = license + '\n\n' + processsFile(content, fileName, true);
|
||||
}
|
||||
fs.writeFile(fileName, content, err => {
|
||||
|
||||
Reference in New Issue
Block a user