diff options
Diffstat (limited to 'share/qbs/modules/protobuf/protobuf.js')
-rw-r--r-- | share/qbs/modules/protobuf/protobuf.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/share/qbs/modules/protobuf/protobuf.js b/share/qbs/modules/protobuf/protobuf.js index 576a5ec07..511f5a6c6 100644 --- a/share/qbs/modules/protobuf/protobuf.js +++ b/share/qbs/modules/protobuf/protobuf.js @@ -109,3 +109,28 @@ function doPrepare(module, product, input, outputs, lang) cmd.description = "generating " + lang + " files for " + input.fileName; return [cmd]; } + +function doPrepareGrpc(module, product, input, outputs, lang) +{ + var outputDir = module.outputDir; + var args = []; + + args.push("--grpc_out", outputDir); + args.push("--plugin=protoc-gen-grpc=" + module.grpcPluginPath); + + var importPaths = module.importPaths; + if (importPaths.length === 0) + importPaths = [FileInfo.path(input.filePath)]; + importPaths.forEach(function(path) { + if (!FileInfo.isAbsolutePath(path)) + path = FileInfo.joinPaths(product.sourceDirectory, path); + args.push("--proto_path", path); + }); + + args.push(input.filePath); + + var cmd = new Command(module.protocBinary, args); + cmd.highlight = "codegen"; + cmd.description = "generating " + lang + " files for " + input.fileName; + return [cmd]; +} |