Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
20e5d9eb
Commit
20e5d9eb
authored
8 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Update Node plugin to handle well known type changes
parent
245e9970
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/compiler/node_generator.cc
+11
-3
11 additions, 3 deletions
src/compiler/node_generator.cc
with
11 additions
and
3 deletions
src/compiler/node_generator.cc
+
11
−
3
View file @
20e5d9eb
...
@@ -74,8 +74,16 @@ grpc::string GetJSMessageFilename(const grpc::string& filename) {
...
@@ -74,8 +74,16 @@ grpc::string GetJSMessageFilename(const grpc::string& filename) {
// Given a filename like foo/bar/baz.proto, returns the root directory
// Given a filename like foo/bar/baz.proto, returns the root directory
// path ../../
// path ../../
grpc
::
string
GetRootPath
(
const
grpc
::
string
&
filename
)
{
grpc
::
string
GetRootPath
(
const
grpc
::
string
&
from_filename
,
size_t
slashes
=
std
::
count
(
filename
.
begin
(),
filename
.
end
(),
'/'
);
const
grpc
::
string
&
to_filename
)
{
if
(
to_filename
.
find
(
"google/protobuf"
)
==
0
)
{
// Well-known types (.proto files in the google/protobuf directory) are
// assumed to come from the 'google-protobuf' npm package. We may want to
// generalize this exception later by letting others put generated code in
// their own npm packages.
return
"google-protobuf/"
;
}
size_t
slashes
=
std
::
count
(
from_filename
.
begin
(),
from_filename
.
end
(),
'/'
);
if
(
slashes
==
0
)
{
if
(
slashes
==
0
)
{
return
"./"
;
return
"./"
;
}
}
...
@@ -90,7 +98,7 @@ grpc::string GetRootPath(const grpc::string& filename) {
...
@@ -90,7 +98,7 @@ grpc::string GetRootPath(const grpc::string& filename) {
// from_file, assuming that both paths are relative to the same directory
// from_file, assuming that both paths are relative to the same directory
grpc
::
string
GetRelativePath
(
const
grpc
::
string
&
from_file
,
grpc
::
string
GetRelativePath
(
const
grpc
::
string
&
from_file
,
const
grpc
::
string
&
to_file
)
{
const
grpc
::
string
&
to_file
)
{
return
GetRootPath
(
from_file
)
+
to_file
;
return
GetRootPath
(
from_file
,
to_file
)
+
to_file
;
}
}
/* Finds all message types used in all services in the file, and returns them
/* Finds all message types used in all services in the file, and returns them
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment