@ -67,6 +67,41 @@ ls -lR ./proto_out
exit 1
}
# Run again with base_namespace option set to empty value to check that the files
# are created under a full directory structure defined by the namespace
rm -rf ${ PROTO_OUT }
mkdir -p ${ PROTO_OUT }
$PROTOC \
--plugin= protoc-gen-grpc-csharp= $PLUGIN \
--csharp_out= ${ PROTO_OUT } \
--grpc-csharp_out= ${ PROTO_OUT } \
--csharp_opt= base_namespace = \
--grpc-csharp_opt= base_namespace = \
-I ${ DATA_DIR } /proto \
${ DATA_DIR } /proto/namespacetest.proto
# log the files generated
ls -lR ./proto_out
# Verify the output files exist in the right location.
# The C# namespace option in the proto file of "Example.V1.CodegenTest"
# combined with the command line options above should mean the generated files
# are created in the output directory "Example/V1/CodegenTest"
# First file is generated by protoc.
[ -e ${ PROTO_OUT } /Example/V1/CodegenTest/Namespacetest.cs ] || {
echo >& 2 "missing generated output, expecting Example/V1/CodegenTest/Namespacetest.cs"
exit 1
}
# Second file is generated by the plugin.
[ -e ${ PROTO_OUT } /Example/V1/CodegenTest/NamespacetestGrpc.cs ] || {
echo >& 2 "missing generated output, expecting Example/V1/CodegenTest/NamespacetestGrpc.cs"
exit 1
}
# Run again without the base_namespace options to check the files are created
# in the root of the output directory