Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
c9f8a1b0
Commit
c9f8a1b0
authored
Feb 24, 2016
by
murgatroid99
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved CommonJS-specific files into commonjs directory
parent
a862b6b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
import_test.js
js/commonjs/import_test.js
+9
-7
test6.proto
js/commonjs/test6/test6.proto
+1
-2
test7.proto
js/commonjs/test7/test7.proto
+1
-2
gulpfile.js
js/gulpfile.js
+4
-3
No files found.
js/import_test.js
→
js/
commonjs/
import_test.js
View file @
c9f8a1b0
...
...
@@ -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
()
{
...
...
js/test6/test6.proto
→
js/
commonjs/
test6/test6.proto
View file @
c9f8a1b0
...
...
@@ -37,4 +37,4 @@ package jspb.test.importing;
message
ImportedMessage
{
string
string_value
=
1
;
}
\ No newline at end of file
}
js/test7/test7.proto
→
js/
commonjs/
test7/test7.proto
View file @
c9f8a1b0
...
...
@@ -39,4 +39,4 @@ import "test6/test6.proto";
message
FramingMessage
{
jspb.test.importing.ImportedMessage
imported_message
=
1
;
}
\ No newline at end of file
}
js/gulpfile.js
View file @
c9f8a1b0
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment