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
f7d9cbe6
Commit
f7d9cbe6
authored
8 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
PR comments
parent
f781dbb0
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
tools/codegen/core/gen_nano_proto.sh
+12
-5
12 additions, 5 deletions
tools/codegen/core/gen_nano_proto.sh
with
12 additions
and
5 deletions
tools/codegen/core/gen_nano_proto.sh
+
12
−
5
View file @
f7d9cbe6
...
...
@@ -34,6 +34,13 @@
# tools/codegen/core/gen_nano_proto.sh \
# src/proto/grpc/lb/v0/load_balancer.proto
# $PWD/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0
#
# Exit statuses:
# 1: Incorrect number of arguments
# 2: Input proto file (1st argument) doesn't exist or is not a regular file.
# 3: Options file for nanopb not found in same dir as the input proto file.
# 4: Output dir not an absolute path.
# 5: Couldn't create output directory (2nd argument).
read
-r
-d
''
COPYRIGHT
<<
'
EOF
'
/*
...
...
@@ -76,7 +83,7 @@ COPYRIGHT_FILE=$(mktemp)
echo
"
${
COPYRIGHT
/<YEAR>/
$CURRENT_YEAR
}
"
>
$COPYRIGHT_FILE
set
-ex
if
[
$#
-lt
2
]
;
then
if
[
$#
-lt
2
]
||
[
$#
-gt
3
]
;
then
echo
"Usage:
$0
<input.proto> <absolute path to output dir> [grpc path]"
exit
1
fi
...
...
@@ -89,22 +96,22 @@ readonly EXPECTED_OPTIONS_FILE_PATH="${1%.*}.options"
if
[[
!
-f
"
$INPUT_PROTO
"
]]
;
then
echo
"Input proto file '
$INPUT_PROTO
' doesn't exist."
exit
3
exit
2
fi
if
[[
!
-f
"
${
EXPECTED_OPTIONS_FILE_PATH
}
"
]]
;
then
echo
"Expected nanopb options file '
${
EXPECTED_OPTIONS_FILE_PATH
}
' missing"
exit
4
exit
3
fi
if
[[
"
${
OUTPUT_DIR
:0:1
}
"
!=
'/'
]]
;
then
echo
"The output directory must be an absolute path. Got '
$OUTPUT_DIR
'"
exit
5
exit
4
fi
mkdir
-p
"
$OUTPUT_DIR
"
if
[
$?
!=
0
]
;
then
echo
"Error creating output directory
$OUTPUT_DIR
"
exit
2
exit
5
fi
readonly
VENV_DIR
=
$(
mktemp
-d
)
...
...
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