Better cross-platform support for building bb-server frontend
parent
931bb56378
commit
252a761005
|
@ -42,8 +42,7 @@ task generateProtobufBundle(type: NpmTask) {
|
|||
// We need do this in doFirst since getProtoFiles won't find all subprojects
|
||||
// until after configuration is complete
|
||||
def protoFiles = getProtoFiles()
|
||||
setEnvironment([PROTO_FILES: protoFiles.join(" ")]);
|
||||
generateProtobufBundle.args = ['run', 'protoc']
|
||||
generateProtobufBundle.args = ['run', 'protoc', '--' ] + protoFiles;
|
||||
}
|
||||
|
||||
dependsOn npm_install
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env node
|
||||
const { execFileSync } = require('child_process');
|
||||
|
||||
const bundlejs = 'src/app/bundle.js'
|
||||
const bundlets = 'src/app/bundle.d.ts'
|
||||
|
||||
var pbjs_args = [
|
||||
'-t', 'static-module', '-w', 'commonjs', '-o', bundlejs
|
||||
].concat(process.argv.slice(2));
|
||||
|
||||
console.log("Running pbjs " + pbjs_args.join(" "));
|
||||
var out = execFileSync('pbjs', pbjs_args);
|
||||
console.log("" + out);
|
||||
|
||||
var pbts_args = [
|
||||
'-o', bundlets, bundlejs
|
||||
];
|
||||
|
||||
console.log("Running pbts " + pbts_args.join(" "));
|
||||
out = execFileSync('pbts', pbts_args);
|
||||
console.log("" + out);
|
|
@ -10,7 +10,7 @@
|
|||
"lint": "ng e2e",
|
||||
"pbts": "pbts",
|
||||
"pbjs": "pbjs",
|
||||
"protoc" : "pbjs -t static-module -w commonjs -o src/app/bundle.js $PROTO_FILES && pbts -o src/app/bundle.d.ts src/app/bundle.js"
|
||||
"protoc" : "./generate-protobuf.js"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue