aboutsummaryrefslogtreecommitdiff
path: root/js/gulpfile.js
diff options
context:
space:
mode:
authormurgatroid99 <mlumish@google.com>2016-02-24 13:44:57 -0800
committermurgatroid99 <mlumish@google.com>2016-02-24 13:44:57 -0800
commita862b6b77f49527bf1f6e1da54265d82256c4bf1 (patch)
tree3ce9fdde957b0fea1193b8384c17a15e5ac02b82 /js/gulpfile.js
parent8f67b165f0a949219fafc48c533be3fbf53497b7 (diff)
downloadprotobuf-a862b6b77f49527bf1f6e1da54265d82256c4bf1.tar.gz
protobuf-a862b6b77f49527bf1f6e1da54265d82256c4bf1.tar.bz2
protobuf-a862b6b77f49527bf1f6e1da54265d82256c4bf1.zip
Fix CommonJS relative require generation, and test it
Diffstat (limited to 'js/gulpfile.js')
-rw-r--r--js/gulpfile.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/gulpfile.js b/js/gulpfile.js
index b0faed06..e8028b4b 100644
--- a/js/gulpfile.js
+++ b/js/gulpfile.js
@@ -5,7 +5,7 @@ var glob = require('glob');
var protoc = process.env.PROTOC || '../src/protoc';
gulp.task('genproto_closure', function (cb) {
- exec(protoc + ' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto ../src/google/protobuf/descriptor.proto',
+ exec(protoc + ' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto test*/*.proto ../src/google/protobuf/descriptor.proto',
function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
@@ -14,7 +14,7 @@ gulp.task('genproto_closure', function (cb) {
});
gulp.task('genproto_commonjs', function (cb) {
- exec('mkdir -p commonjs_out && ' + protoc + ' --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I . *.proto ../src/google/protobuf/descriptor.proto',
+ exec('mkdir -p commonjs_out && ' + protoc + ' --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I . *.proto test*/*.proto ../src/google/protobuf/descriptor.proto',
function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
@@ -34,7 +34,7 @@ gulp.task('dist', function (cb) {
});
gulp.task('commonjs_asserts', function (cb) {
- exec('mkdir -p commonjs_out && ./node_modules/google-closure-library/closure/bin/calcdeps.py -i commonjs/export_asserts.js -p . -p node_modules/google-closure-library/closure -o compiled --compiler_jar node_modules/google-closure-compiler/compiler.jar > commonjs_out/closure_asserts_commonjs.js',
+ exec('mkdir -p commonjs_out/test_node_modules && ./node_modules/google-closure-library/closure/bin/calcdeps.py -i commonjs/export_asserts.js -p . -p node_modules/google-closure-library/closure -o compiled --compiler_jar node_modules/google-closure-compiler/compiler.jar > commonjs_out/test_node_modules/closure_asserts_commonjs.js',
function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
@@ -45,7 +45,7 @@ gulp.task('commonjs_asserts', function (cb) {
gulp.task('make_commonjs_out', ['dist', 'genproto_commonjs', 'commonjs_asserts'], function (cb) {
// TODO(haberman): minify this more aggressively.
// Will require proper externs/exports.
- var cmd = "mkdir -p commonjs_out/binary && ";
+ var cmd = "mkdir -p commonjs_out/binary && mkdir -p commonjs_out/test_node_modules && ";
function addTestFile(file) {
cmd += 'node commonjs/rewrite_tests_for_commonjs.js < ' + file +
' > commonjs_out/' + file + '&& ';
@@ -56,7 +56,7 @@ gulp.task('make_commonjs_out', ['dist', 'genproto_commonjs', 'commonjs_asserts']
exec(cmd +
'cp commonjs/jasmine.json commonjs_out/jasmine.json && ' +
- 'cp google-protobuf.js commonjs_out',
+ 'cp google-protobuf.js commonjs_out/test_node_modules',
function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
@@ -83,7 +83,7 @@ gulp.task('test_closure', ['genproto_closure', 'deps'], function (cb) {
});
gulp.task('test_commonjs', ['make_commonjs_out'], function (cb) {
- exec('cd commonjs_out && JASMINE_CONFIG_PATH=jasmine.json NODE_PATH=. ../node_modules/.bin/jasmine',
+ exec('cd commonjs_out && JASMINE_CONFIG_PATH=jasmine.json NODE_PATH=test_node_modules ../node_modules/.bin/jasmine',
function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);