Commit c9f8a1b0 authored by murgatroid99's avatar murgatroid99

Moved CommonJS-specific files into commonjs directory

parent a862b6b7
...@@ -30,16 +30,18 @@ ...@@ -30,16 +30,18 @@
// Test suite is written using Jasmine -- see http://jasmine.github.io/ // Test suite is written using Jasmine -- see http://jasmine.github.io/
goog.setTestOnly();
goog.require('goog.json');
goog.require('goog.testing.asserts');
// CommonJS-LoadFromFile: google-protobuf jspb var googleProtobuf = require('google-protobuf');
goog.require('jspb.Message'); var asserts = require('closure_asserts_commonjs');
var global = Function('return this')();
// CommonJS-LoadFromFile: test7/test7_pb proto.jspb.test.framing // Bring asserts into the global namespace.
goog.require('proto.jspb.test.framing.FramingMessage'); googleProtobuf.object.extend(global, asserts);
googleProtobuf.exportSymbol('jspb.Message', googleProtobuf.Message, global);
var test7_pb = require('./test7/test7_pb');
googleProtobuf.exportSymbol('proto.jspb.test.framing.FramingMessage', test7_pb.FramingMessage, global);
describe('Import test suite', function() { describe('Import test suite', function() {
it('testImportedMessage', function() { it('testImportedMessage', function() {
......
...@@ -5,7 +5,7 @@ var glob = require('glob'); ...@@ -5,7 +5,7 @@ var glob = require('glob');
var protoc = process.env.PROTOC || '../src/protoc'; var protoc = process.env.PROTOC || '../src/protoc';
gulp.task('genproto_closure', function (cb) { gulp.task('genproto_closure', function (cb) {
exec(protoc + ' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto test*/*.proto ../src/google/protobuf/descriptor.proto', exec(protoc + ' --js_out=library=testproto_libs,binary:. -I ../src -I . *.proto ../src/google/protobuf/descriptor.proto',
function (err, stdout, stderr) { function (err, stdout, stderr) {
console.log(stdout); console.log(stdout);
console.log(stderr); console.log(stderr);
...@@ -14,7 +14,7 @@ gulp.task('genproto_closure', function (cb) { ...@@ -14,7 +14,7 @@ gulp.task('genproto_closure', function (cb) {
}); });
gulp.task('genproto_commonjs', 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 test*/*.proto ../src/google/protobuf/descriptor.proto', exec('mkdir -p commonjs_out && ' + protoc + ' --js_out=import_style=commonjs,binary:commonjs_out -I ../src -I commonjs -I . *.proto commonjs/test*/*.proto ../src/google/protobuf/descriptor.proto',
function (err, stdout, stderr) { function (err, stdout, stderr) {
console.log(stdout); console.log(stdout);
console.log(stderr); console.log(stderr);
...@@ -56,7 +56,8 @@ gulp.task('make_commonjs_out', ['dist', 'genproto_commonjs', 'commonjs_asserts'] ...@@ -56,7 +56,8 @@ gulp.task('make_commonjs_out', ['dist', 'genproto_commonjs', 'commonjs_asserts']
exec(cmd + exec(cmd +
'cp commonjs/jasmine.json commonjs_out/jasmine.json && ' + 'cp commonjs/jasmine.json commonjs_out/jasmine.json && ' +
'cp google-protobuf.js commonjs_out/test_node_modules', 'cp google-protobuf.js commonjs_out/test_node_modules && ' +
'cp commonjs/import_test.js commonjs_out/import_test.js',
function (err, stdout, stderr) { function (err, stdout, stderr) {
console.log(stdout); console.log(stdout);
console.log(stderr); console.log(stderr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment