-
Notifications
You must be signed in to change notification settings - Fork 274
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
Setting an output directory #13
Comments
The value should have been set to the default output directory, which is |
No, g-s/main/python would be ideal, but currently both my java and python are dumped into g-s/main Also, is there a standard for building a python package? I don't want to put my setup.py in build/... and if I specify package_dir to the generated directory then the packaged files have the generated-sources prefix. |
Sorry I was wrong. The default output directory is in fact |
Yes -- one of the many purposes of protobuf is to be cross-platform/language so, that would be good. I think the right behavior would be to append $builtin.name (i.e., to mirror src/main/{java|python}), but I guess that would change the current behavior -- unless that only happens if multiple languages are detected? Also, do you have any thoughts on the packaging problem? I.e., setup.py having to be in a different directory and no init.py being generated? |
+1 for @richburdon 's issue. Would be nice to deal with hybrid environments better. |
@haberman - since you work on Python Protobuf, could you help on answering this question? |
@zhangkun83 any thoughts here? I can patch to correct this, but would appreciate some thoughts on how to deal with legacy issues. The build tools should assume a standard file layout -- especially in the case of cross-platform technologies like protobuf. My proposal: each xxx_out should be able to specify a different output directory. |
@richburdon I am current working on a redesign of the plugin DSL for 0.5.0, which will support the kind of configuration you have proposed. |
TL; DR: I am working on the new version of the plugin. I thought I would be able to allow customizing the directory for each builtin/plugin, but it turns out almost impossible due to constraints from Android build model. I am thinking about separating the outputs per builtin/plugin as previously suggested, but not allowing customizing them. Would that suffice? The full story: Android projects are compiled per variant (an Android concept), not per sourceSet. In order to work with Android projects, the Protobuf plugin has to have a protoc run per variant, thus the protoc options have to be configured per variant. So we are moving the configuration knobs to the Variants are generated in |
I think the approach you're intending is optimal (i.e., fixed outputs per When can I try it? :) On Fri, Jun 19, 2015 at 2:44 PM Kun Zhang [email protected] wrote:
|
I am currently coding it :). Hopefully I can check it in in a week or two. |
@richburdon @Xorlev I have created branch for the next version v0.5.x. It puts the generated code under It has not been released to repositories, so you have to build it and install it locally. Please follow the README on how to do it. Feedback is appreciated. |
0.5.0 has been released. Please refer to the README on the master branch. |
Apologies for not seeing this earlier. This looks great to me and I'll give it a spin tonight. Thanks @zhangkun83! |
"python" below sets the python_out flag; but how do you assign a value?
e.g., python_out=$buildDir/generated-sources/main/python
The text was updated successfully, but these errors were encountered: