Moved CommonJS-specific files into commonjs directory
This commit is contained in:
parent
a862b6b77f
commit
c9f8a1b006
@ -30,16 +30,18 @@
|
||||
|
||||
// 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
|
||||
goog.require('jspb.Message');
|
||||
var googleProtobuf = require('google-protobuf');
|
||||
var asserts = require('closure_asserts_commonjs');
|
||||
var global = Function('return this')();
|
||||
|
||||
// CommonJS-LoadFromFile: test7/test7_pb proto.jspb.test.framing
|
||||
goog.require('proto.jspb.test.framing.FramingMessage');
|
||||
// Bring asserts into the global namespace.
|
||||
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() {
|
||||
it('testImportedMessage', function() {
|
@ -37,4 +37,4 @@ package jspb.test.importing;
|
||||
|
||||
message ImportedMessage {
|
||||
string string_value = 1;
|
||||
}
|
||||
}
|
@ -39,4 +39,4 @@ import "test6/test6.proto";
|
||||
|
||||
message FramingMessage {
|
||||
jspb.test.importing.ImportedMessage imported_message = 1;
|
||||
}
|
||||
}
|
@ -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 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) {
|
||||
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 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) {
|
||||
console.log(stdout);
|
||||
console.log(stderr);
|
||||
@ -56,7 +56,8 @@ 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/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) {
|
||||
console.log(stdout);
|
||||
console.log(stderr);
|
||||
|
Loading…
Reference in New Issue
Block a user