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

Namespaces are not respected #24

Closed
tamird opened this issue Jan 14, 2015 · 7 comments
Closed

Namespaces are not respected #24

tamird opened this issue Jan 14, 2015 · 7 comments

Comments

@tamird
Copy link
Contributor

tamird commented Jan 14, 2015

Hello! Thanks for maintaining this project. We're evaluating using this for our iOS apps and have run into a filename-collision issue, which seems to be caused by protobuf-swift not respecting package namespaces. Repro:

foo/person.proto:

package foo;

message Person {
 optional uint32 age = 1;
}

bar/person.proto:

package bar;

message Person {
 optional uint32 age = 1;
}

output:

~ protoc --plugin=../../protobuf-swift/src/compiler/protoc-gen-swift {foo,bar}/person.proto --swift_out=../../swift_protos
Person.pb.swift: Tried to write the same file twice.
~ echo $?
1
@alexeyxo
Copy link
Owner

I am agree, but i don't know how do it task. In the swift and objective-c syntax has not "namespaces". I would think... Issue #27

@alexeyxo alexeyxo self-assigned this Jan 15, 2015
@tamird
Copy link
Contributor Author

tamird commented Jan 15, 2015

https://twitter.com/clattner_llvm/status/474730716941385729

Seems like you need a separate xcode target per package.

@mwildehahn
Copy link

+1. I had to restructure my protobufs so all the messages were nested to avoid collisions. respecting the package would be huge.

alexeyxo added a commit that referenced this issue Feb 3, 2015
Update compiller for packages
alexeyxo added a commit that referenced this issue Feb 3, 2015
@alexeyxo
Copy link
Owner

alexeyxo commented Feb 3, 2015

You can test.
Branch name "package".

@tamird
Copy link
Contributor Author

tamird commented Feb 3, 2015

Can you open a pull request?

@alexeyxo
Copy link
Owner

alexeyxo commented Feb 3, 2015

I have not finished. I should to clean up the code.

alexeyxo added a commit that referenced this issue Feb 16, 2015
alexeyxo added a commit that referenced this issue Feb 17, 2015
@alexeyxo
Copy link
Owner

alexeyxo commented Mar 9, 2015

Fixed f612ae3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants