This is an automated email from the ASF dual-hosted git repository. jensg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git
commit 6064696ae08e9764f588143f8ffd380b95405aca Author: Mario Emmenlauer <[email protected]> AuthorDate: Wed Apr 15 10:26:09 2020 +0200 lib/js/Gruntfile.js: Generalized to add some level of Windows CMD support (not complete yet) --- lib/js/Gruntfile.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/js/Gruntfile.js b/lib/js/Gruntfile.js index 87b826f..4421f0c 100644 --- a/lib/js/Gruntfile.js +++ b/lib/js/Gruntfile.js @@ -39,27 +39,22 @@ module.exports = function(grunt) { }, shell: { InstallThriftJS: { - command: 'mkdir -p test/build/js/lib; cp src/thrift.js test/build/js/thrift.js' + command: 'cp src/thrift.js test/build/js/thrift.js' }, InstallThriftNodeJSDep: { - command: 'cd ../..; npm install' + command: 'cd ../.. && npm install' }, InstallTestLibs: { - command: 'cd test; ant download_jslibs' + command: 'cd test && ant download_jslibs' }, ThriftGen: { command: [ - 'mkdir -p test/gen-js', - '../../compiler/cpp/thrift -gen js --out test/gen-js ../../test/ThriftTest.thrift', - '../../compiler/cpp/thrift -gen js --out test/gen-js ../../test/JsDeepConstructorTest.thrift', - 'mkdir -p test/gen-js-jquery', - '../../compiler/cpp/thrift -gen js:jquery --out test/gen-js-jquery ../../test/ThriftTest.thrift', - 'mkdir -p test/gen-nodejs', - '../../compiler/cpp/thrift -gen js:node --out test/gen-nodejs ../../test/ThriftTest.thrift', - 'mkdir -p test/gen-js-es6', - '../../compiler/cpp/thrift -gen js:es6 --out test/gen-js-es6 ../../test/ThriftTest.thrift', - 'mkdir -p test/gen-nodejs-es6', - '../../compiler/cpp/thrift -gen js:node,es6 --out ./test/gen-nodejs-es6 ../../test/ThriftTest.thrift', + '"../../compiler/cpp/thrift" -gen js --out test/gen-js ../../test/ThriftTest.thrift', + '"../../compiler/cpp/thrift" -gen js --out test/gen-js ../../test/JsDeepConstructorTest.thrift', + '"../../compiler/cpp/thrift" -gen js:jquery --out test/gen-js-jquery ../../test/ThriftTest.thrift', + '"../../compiler/cpp/thrift" -gen js:node --out test/gen-nodejs ../../test/ThriftTest.thrift', + '"../../compiler/cpp/thrift" -gen js:es6 --out test/gen-js-es6 ../../test/ThriftTest.thrift', + '"../../compiler/cpp/thrift" -gen js:node,es6 --out ./test/gen-nodejs-es6 ../../test/ThriftTest.thrift', ].join(' && ') }, ThriftGenJQ: { @@ -290,7 +285,17 @@ module.exports = function(grunt) { }, 1000); }); + grunt.registerTask('CreateDirectories', 'Creating required local directories', function () { + grunt.file.mkdir('test/build/js/lib'); + grunt.file.mkdir('test/gen-js'); + grunt.file.mkdir('test/gen-js-jquery'); + grunt.file.mkdir('test/gen-nodejs'); + grunt.file.mkdir('test/gen-js-es6'); + grunt.file.mkdir('test/gen-nodejs-es6'); +}); + grunt.registerTask('installAndGenerate', [ + 'CreateDirectories', 'shell:InstallThriftJS', 'shell:InstallThriftNodeJSDep', 'shell:ThriftGen',
