mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-08-27 11:11:17 -04:00
houhaoyu@huawei.com 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) {
|
function generateTargetFile(filePath, output) {
|
||||||
const files = [];
|
const files = [];
|
||||||
const globalTsFile = path.resolve(filePath, '../../global.d.ts');
|
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');
|
const middleTsFile = path.resolve(filePath, 'middle_class.d.ts');
|
||||||
if (fs.existsSync(globalTsFile)) {
|
if (fs.existsSync(globalTsFile)) {
|
||||||
files.push(globalTsFile);
|
files.push(globalTsFile);
|
||||||
}
|
}
|
||||||
|
if (fs.existsSync(featureAbilityPath)) {
|
||||||
|
files.push(featureAbilityPath);
|
||||||
|
}
|
||||||
readFile(filePath, files);
|
readFile(filePath, files);
|
||||||
if (!fs.existsSync(output)) {
|
if (!fs.existsSync(output)) {
|
||||||
mkDir(output);
|
mkDir(output);
|
||||||
@@ -59,7 +63,7 @@ function generateTargetFile(filePath, output) {
|
|||||||
files.forEach((item) => {
|
files.forEach((item) => {
|
||||||
let content = fs.readFileSync(item, 'utf8');
|
let content = fs.readFileSync(item, 'utf8');
|
||||||
const fileName = path.resolve(output, path.basename(item));
|
const fileName = path.resolve(output, path.basename(item));
|
||||||
if (item === globalTsFile) {
|
if (item === globalTsFile || item === featureAbilityPath) {
|
||||||
content = license + '\n\n' + processsFile(content, fileName, true);
|
content = license + '\n\n' + processsFile(content, fileName, true);
|
||||||
}
|
}
|
||||||
fs.writeFile(fileName, content, err => {
|
fs.writeFile(fileName, content, err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user