Closed ph4r05 closed 6 years ago
I've just tested the idea and it works quite fine.
I think we can add package hw.trezor.messages;
globally, because in Java we already override this via option java_package
and Python generator's don't use package
value. I added this in 279bc1f220d38db9562ac9e22d61c5b94a854f9f, but I also used more granular distinction - is that OK for you?
Moreover I need only subset of protobuf files:
Don't call protoc *.proto
, but just protoc file1.proto file2.proto file3.proto file4.proto
Thanks, this works just fine.
My devel branch: https://github.com/ph4r05/monero/tree/ph4master-trezor
WireType <-> Message conversion works: https://github.com/ph4r05/monero/blob/ph4master-trezor/src/device/trezor/messages_map.cpp
Hi,
for integration to the Monero codebase, the generated messages should have a project-specific namespace.
I am experimenting with
protoc --cpp_out=src/device/trezor/messages
which works quite fine for the purpose but I would need to addpackage
to each protob file:As this is integration project specific package I understand it cannot be in general
trezor-common
repository.So the question is how to add package to each protobuf file before calling
protoc
to generate C++ messages. A new toolpb2cpp
may handle this.Moreover I need only subset of protobuf files:
messages.proto
messages-common.proto
messages-management.proto
messages-monero.proto
My idea is to add a new
pb2cpp
which would copy these protob files to temporary directory and add/replacepackage
directive with Monero-specific package. Then compiles the messages.What do you think? How would you address this? Thanks