awtk/tools/idl_gen/index.js
2022-06-25 16:53:06 +08:00

25 lines
605 B
JavaScript

const fs = require('fs');
const path = require('path');
const IDLGen = require('./idl_gen.js');
let defDirlist = undefined;
let outputIDL = 'idl.json';
let sourcesPath = path.normalize(path.join(__dirname, '../../src'));
if(process.argv.length > 2) {
outputIDL = process.argv[2];
}
if(process.argv.length > 3) {
sourcesPath = process.argv[3];
}
if(process.argv.length > 4) {
defDirlist = process.argv[4];
}
if(sourcesPath === '-h' || sourcesPath === '--help') {
console.log('Usage: node index.js outputIDL sourcesPath');
process.exit(0);
}
IDLGen.gen(sourcesPath, outputIDL, defDirlist);