[
https://issues.apache.org/jira/browse/THRIFT-5577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531512#comment-17531512
]
Philip Lee commented on THRIFT-5577:
------------------------------------
I will have to disagree with your assessment. In C#/.NET it is conventional
for the default namespace of a project to match the project name, and the
default namespace of any files contained therein to match the folder structure,
so if my project is call MyCompany.MyFeature.XYZ the default namespace used by
files in the root folder of the project have namespace MyCompany.MyFeature.XYZ.
If I add a folder 'Thrift' and add files to that I expect them to have
namespace MyCompany.MyFeature.XYZ.Thrift.
So, if I use the thrift compiler against a thrift file with namespace
MyCompany.MyFeature.XYZ.Thrift it's my expectation to be able to put the
generated files in sub-folder 'Thrift'. Other C# developers will be somewhat
surprised to see the folder structure that is actually generated.
Also it's my expectation of a tool to put output where I ask it to not generate
an unnecessary folder structure.
As for your comment that if I did this
thrift -gen netstd -out subdir one.thrift
thrift -gen netstd -out subdir two.thrift
I would raise another ticket, then I wouldn't I would clearly be specifying
different folders
thrift -gen netstd -out One one.thrift
thrift -gen netstd -out Two two.thrift
to match the namespace which is the desired behaviour.
But whatever. At least there's a namespace in thrift 0.16 which is an
improvement over thrift 0.9 (which is currently used by a project I've
inherited).
> 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
> Assignee: Jens Geyer
> Priority: Major
> Fix For: 0.17.0
>
>
> 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)