Re: [protobuf] Proto File not found while running protoc

2023-02-27 Thread ritesh singh
Unless, there's some option or way to execute it in java/kotlin without reying on user's machine. I believe https://github.com/os72/protoc-jar is the only option. On Tuesday, February 28, 2023 at 12:59:48 AM UTC+5:30 ritesh singh wrote: > I went through docs - and i guess importer can be used

Re: [protobuf] Proto File not found while running protoc

2023-02-27 Thread ritesh singh
I went through docs - and i guess importer can be used - https://protobuf.dev/reference/cpp/api-docs/google.protobuf.compiler.importer/ But, this is not exposed as java api. On Sunday, February 26, 2023 at 7:25:49 PM UTC+5:30 ritesh singh wrote: > I was also wondering, if >

Re: [protobuf] Proto File not found while running protoc

2023-02-26 Thread ritesh singh
I was also wondering, if https://mvnrepository.com/artifact/com.google.protobuf/protoc can be used to do what above *protoc *command is doing? Because, to run the protoc command from my plugin, the user's machine needs to have the protoc compiler installed. My idea is to just get the .proto

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
I think it's not working with absolute path. If my imports are like this import "com/google/samples/apps/nowinandroid/data/dark_theme_config.proto"; import "com/google/samples/apps/nowinandroid/data/theme_brand.proto"; it wont work. But if it's relative it works import "theme_brand.proto";

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
This is resolved. Thanks. On Saturday, February 25, 2023 at 2:35:02 AM UTC+5:30 Adam Cozzette wrote: > Probably the cleanest solution would be to cd to the directory containing > com/ and run protoc from there: protoc -I . --include_imports > --descriptor_set_out=/dev/stdout >

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
Thanks Adam. This how my code looks like * fun decodeProto(protoFile: VirtualFile) { try { val fileDescriptorSet = generateFileDescriptorSet(protoFile) val fileDescriptor: Descriptors.FileDescriptor = parseFileDescriptorSet(fileDescriptorSet) val

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread 'Adam Cozzette' via Protocol Buffers
Probably the cleanest solution would be to cd to the directory containing com/ and run protoc from there: protoc -I . --include_imports --descriptor_set_out=/dev/stdout com/google/samples/apps/nowinandroid/data/user_preferences.proto On Fri, Feb 24, 2023 at 11:11 AM ritesh singh wrote: > If i

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
If i remove imports, it works fine. On Saturday, February 25, 2023 at 12:41:13 AM UTC+5:30 ritesh singh wrote: > It looks like this > > syntax = "proto3"; > > import "com/google/samples/apps/nowinandroid/data/dark_theme_config.proto" > ; > import

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
It looks like this syntax = "proto3"; import "com/google/samples/apps/nowinandroid/data/dark_theme_config.proto"; import "com/google/samples/apps/nowinandroid/data/theme_brand.proto"; option java_package = "com.google.samples.apps.nowinandroid.core.datastore"; option java_multiple_files = true;

Re: [protobuf] Proto File not found while running protoc

2023-02-24 Thread 'Adam Cozzette' via Protocol Buffers
What do the import lines in user_preferences.proto look like? In your case the import paths should point to files relative to the current directory. On Fri, Feb 24, 2023 at 9:40 AM ritesh singh wrote: > I have 3 proto files in the current directory. > > user_preferences.proto imports other

[protobuf] Proto File not found while running protoc

2023-02-24 Thread ritesh singh
I have 3 proto files in the current directory. user_preferences.proto imports other protos and all are available in the same directory. But, if i try to run this command, it throws an error. - *Imported file not found.* *protoc --include_imports --descriptor_set_out=/dev/stdout