clean up build
This commit is contained in:
parent
f94792b9ec
commit
7e9c08e591
1
.github/workflows/nodejs.yml
vendored
1
.github/workflows/nodejs.yml
vendored
@ -17,7 +17,6 @@ jobs:
|
|||||||
- name: npm install, build, and test
|
- name: npm install, build, and test
|
||||||
run: |
|
run: |
|
||||||
npm i
|
npm i
|
||||||
npm run build
|
|
||||||
npm test
|
npm test
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
28
bin/build.js
28
bin/build.js
@ -1,9 +1,23 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs-extra');
|
||||||
|
const cp = require('child_process');
|
||||||
const llparse = require('llparse');
|
const llparse = require('llparse');
|
||||||
const llparseDot = require('llparse-dot');
|
|
||||||
|
const gyp = cb => {
|
||||||
|
console.log('build');
|
||||||
|
const proc = cp.spawn('node-gyp', ['configure', 'build']);
|
||||||
|
proc.stderr.on('data', data => {
|
||||||
|
console.error(data.toString());
|
||||||
|
});
|
||||||
|
proc.on('close', (cb || (() => {
|
||||||
|
console.log('done');
|
||||||
|
})));
|
||||||
|
};
|
||||||
|
|
||||||
|
const generate = cb => {
|
||||||
|
// const llparseDot = require('llparse-dot');
|
||||||
|
|
||||||
const prj = 'vcd_parser';
|
const prj = 'vcd_parser';
|
||||||
const p = new llparse.LLParse(prj);
|
const p = new llparse.LLParse(prj);
|
||||||
@ -210,16 +224,18 @@ simulationId
|
|||||||
.match(spaces, idSpan.end(simulation))
|
.match(spaces, idSpan.end(simulation))
|
||||||
.skipTo(simulationId);
|
.skipTo(simulationId);
|
||||||
|
|
||||||
// Build
|
|
||||||
|
|
||||||
const artifacts = p.build(declaration);
|
const artifacts = p.build(declaration);
|
||||||
|
|
||||||
fs.writeFileSync(prj + '.h', artifacts.header);
|
fs.writeFileSync(prj + '.h', artifacts.header);
|
||||||
// fs.writeFileSync('verilog_preprocessor.bc', artifacts.bitcode);
|
// fs.writeFileSync('verilog_preprocessor.bc', artifacts.bitcode);
|
||||||
fs.writeFileSync(prj + '.c', artifacts.c);
|
fs.writeFileSync(prj + '.c', artifacts.c);
|
||||||
|
|
||||||
const dot = new llparseDot.Dot();
|
// const dot = new llparseDot.Dot();
|
||||||
|
// fs.writeFileSync(prj + '.dot', dot.build(declaration));
|
||||||
|
|
||||||
fs.writeFileSync(prj + '.dot', dot.build(declaration));
|
cb();
|
||||||
|
};
|
||||||
|
|
||||||
|
generate(gyp);
|
||||||
|
|
||||||
/* eslint camelcase: 0 */
|
/* eslint camelcase: 0 */
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "eslint bin lib && nyc -r=text -r=lcov mocha",
|
"test": "eslint bin lib && nyc -r=text -r=lcov mocha",
|
||||||
"build": "node bin/build.js && node-gyp rebuild"
|
"install": "node bin/build.js",
|
||||||
|
"prepare": "node bin/build.js"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"*.c",
|
"*.c",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user