-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add gapic options as inputs to generate_library.sh
#2121
Conversation
Tested the PR in the following libraries:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together. Just a couple comments.
I think we can expand proto_path_list.txt
to include at least one library per case that is fixed by this PR
if [ -f "${file_path}/${gapic_option}" ]; then | ||
gapic_option="${file_path}/${gapic_option}" | ||
else | ||
gapic_option="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that the BUILD file may reference a non-existent yaml
or json
file? If not defaulting to an error, would it make sense to produce a warning to stderr to explain that the specified file by the BUILD file was not found and will just use the default empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find a case to use a non-existent file.
I'll add a warning in such case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
library_generation/utilities.sh
Outdated
if [ "${rest_numeric_enums}" == "true" ]; then | ||
rest_numeric_enums="rest-numeric-enums," | ||
else | ||
rest_numeric_enums="" | ||
fi | ||
echo "transport=${transport},${rest_numeric_enums}grpc-service-config=${grpc_service_config},${gapic_config}api-service-config=${api_service_config}" | ||
gapic_yaml="gapic-config=${gapic_yaml}," | ||
echo "transport=${transport},${rest_numeric_enums}grpc-service-config=${grpc_service_config},${gapic_yaml}api-service-config=${service_yaml}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "transport=${transport},${rest_numeric_enums}grpc-service-config=${grpc_service_config},${gapic_yaml}api-service-config=${service_yaml}" | |
echo "transport=${transport},rest_numeric_enums=${rest_numeric_enums},service-config=${grpc_service_config},gapic_yaml=${gapic_yaml},service-yaml=${service_yaml}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rest_numeric_enums
is not like other gapic options, where key and value separated by "=". When set to false
, it can't present in the argument, otherwise the generator will treat it as true
.
Lines 60 to 62 in 4c96063
static boolean hasNumericEnumFlag(CodeGeneratorRequest request) { | |
return hasFlag(request.getParameter(), KEY_NUMERIC_ENUM); | |
} |
[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed! |
[java_showcase_integration_tests] Kudos, SonarCloud Quality Gate passed! |
In this PR:
generate_library.sh
: