[ 
https://issues.apache.org/jira/browse/THRIFT-5577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531447#comment-17531447
 ] 

Jens Geyer commented on THRIFT-5577:
------------------------------------

Aside from that, the behavior starts to make totally sense if you have two IDL 
files, like so: 

{code}
namespace netstd Two
struct Foobar {}
{code}
and
{code}
namespace netstd One
struct Foobar {}
{code}

If you run 

{code}
thrift -gen netstd -out subdir one.thrift
thrift -gen netstd -out subdir two.thrift
{code}

and like you proposed the generator should in that case place everything under 
"subdir" then the second command would overwrite the Foobar.cs file from the 
first command, and you would file the next ticket about exactly that. Hence 
also the best practice recommendation to have exactly one namespace per IDL 
file and exactly one IDL file per namespace.

Bottom line: No issue left that could/should be fixed..

> netstd namespace directive creates matching subfolders
> ------------------------------------------------------
>
>                 Key: THRIFT-5577
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5577
>             Project: Thrift
>          Issue Type: Improvement
>          Components: netstd - Compiler
>    Affects Versions: 0.16.0
>            Reporter: Philip Lee
>            Priority: Major
>
> If I add a namespace directive to the .thrift file, and I specify the output 
> folder, the thrift compiler creates a set of sub-folders matching the 
> namespace which is not useful.
> e.g. I have a project called 
> MyCompany.MyFeature.Xyz
> and I have a .thrift file with
> namespace netstd MyCompany.MyFeature.Xyz.Thrift
> and I use
> thrift-0.16.0.exe --gen netstd --out .\thrift rpc.thrift
> Then I get sub-folders
> MyCompany.MyFeature.Xyz\Thrift\MyCompany\MyFeature\Xyz\Thrift\<files.cs>
> What I expect is for the generated files to be placed in folder Thrift, e.g.
> MyCompany.MyFeature.Xyz\Thrift\<files.cs>
> to match the namespace.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to