Repository navigation
Adding --proto-package-prefix to .proto Skymarshal generation - #477
Closed
james-clarke-skydio wants to merge 2 commits into
Closed
james-clarke-skydio wants to merge 2 commits into
james-clarke-skydio wants to merge 2 commits into
Conversation
--proto-package-prefix to .proto Skymarshal generation
Contributor
Author
|
Closing in favor of making this change elsewhere and separately pushing it here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Similar to how Skymarshal already supports
--python-package-prefixwhen generating namespaced python files, this does the same for.protofiles without touching the original.lcmsource file(s).Currently there is no proto equivalent, and if we want to provide a different package prefix in the upstream service(s) needing this functionality, we need this added. Luckily, this should follow similarly to how it was done for Python.
A few small, additive changes in
emit_proto.py:--proto-package-prefixCLI arg (defaults toNone— no behavior change if unset).EnumType.proto_packageandStructType.proto_packageprepend the prefix when set.create_filescopies args and swaps in the override before rendering, leaving the shared args object untouched.EnumType.proto_filenameandStructType.proto_filenameskip the<package>/pbtypes/subdirectory when set, writing directly under--proto-path.--proto-flat-outputCLI arg (defaults toNone- no behavior change), used when generating protos from.lcmfiles.Verified locally:
--proto-package-prefixflag, output is unchanged (package api)--proto-package-prefix skydio, output ispackage skydio.api;--proto-flat-outputflag, output is unchanged (<proto-path>/<package>/pbtypes/<file>.proto)--proto-flat-output, output is<proto-path>/<file>.proto--proto-package-prefix(both flags together produce the expected flat, prefixed output)