Skip to content
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

import does not work correctly #32

Closed
Mask051 opened this issue Jul 8, 2015 · 2 comments
Closed

import does not work correctly #32

Mask051 opened this issue Jul 8, 2015 · 2 comments

Comments

@Mask051
Copy link

Mask051 commented Jul 8, 2015

org/a/a.proto

syntax = "proto2";
package org.a;

message Msg {
extensions 16 to max;
}

org/b/b.proto

syntax = "proto2";
package org.b;
import "org/a/a.proto";

extend Msg {
optional Test test = 16;
}

message Test {}

These configuration throws error while compiling:

protoc-jar: executing: [C:\Users\D\AppData\Local\Temp\protoc3931572059064664031.exe, --plugin=protoc-gen-scala=C:\Users\D\AppData\Local\Temp\scalapbgen2982993506159287014.b
at, -ID:\my_app\app, -ID:\my_app\target\protobuf_external, --scala_out=:D:\my_app\target\scala-2.11\src_managed\main
\compiled_protobuf, D:\my_app\app\org\a\a.proto,
D:\my_app\app\org\b\b.proto]
org/b/b.proto:6:8: "Msg" is not defined.
[libprotobuf WARNING google/protobuf/descriptor.cc:6117] Warning: Unused import: "org/b/b.proto" imports "org/a/a.proto" which is not used.
java.lang.RuntimeException: protoc returned exit code: 1

@thesamet
Copy link
Contributor

thesamet commented Jul 8, 2015

On a fast first read, it seems like the error is generated by protoc, not ScalaPB. In b.proto, the package name is missing. Can you try:

extend org.a.Msg {
  optional Test test = 16;
}

This should pass protoc, though ScalaPB currently does not support extensions.

@Mask051
Copy link
Author

Mask051 commented Jul 8, 2015

It works. Thanks

@thesamet thesamet closed this as completed Jul 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants