[
https://issues.apache.org/jira/browse/THRIFT-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113225#comment-18113225
]
Sylwester Lachiewicz commented on THRIFT-740:
---------------------------------------------
Fair point, and the VS version was the wrong argument to close on. Visual
Studio is not the problem here; the mechanism this ticket proposes is.
A single-file custom tool needs a registered VSPackage (the
{{ThriftCodeGen.reg}} attachment), a strong-named assembly (the {{.snk}}), and
re-registration for each Visual Studio release. Nothing in this tree can build,
test, or ship that, and no CI job would catch it breaking.
The IDE integration itself already exists by another route. Every project under
[lib/netstd/Tests/Thrift.Compile.Tests|https://github.com/apache/thrift/tree/master/lib/netstd/Tests/Thrift.Compile.Tests]
carries a {{PreBuild}} MSBuild target that locates the compiler on the path,
in the working directory, or at {{compiler/cpp/thrift}}, checks {{thrift
-version}} against the project's {{ThriftVersion}} property, and regenerates
before {{Compile}}. MSBuild targets run inside Visual Studio, so a {{.thrift}}
file in a C# project is regenerated on build today. What that does not do is
nest the generated {{.cs}} file under the {{.thrift}} node in Solution
Explorer, which is the part that needed the custom tool.
The gap worth filing is elsewhere: that target lives only in test projects,
copy-pasted across four csproj files, and the ApacheThrift NuGet package ships
no build folder. An {{Apache.Thrift.targets}} in the package would make
{{.thrift}} first-class in any C# project, Visual Studio included, on ground
the project can maintain. I did not find an existing issue for it. Shall I open
one and link it here?
Leaving this as Won't Fix, since the VSPackage approach is what the ticket
describes.
_This comment was created with AI assistance._
> Visual Studio 2008 .thrift file complete integration
> ----------------------------------------------------
>
> Key: THRIFT-740
> URL: https://issues.apache.org/jira/browse/THRIFT-740
> Project: Thrift
> Issue Type: Improvement
> Components: netstd - Compiler
> Environment: Windows, Visual Studio 2008 (and possibly 2005, 2010)
> Reporter: James E. King III
> Priority: Major
> Attachments: Apache-Thrift-740-Jira-Codegen-VS.patch,
> ThriftCodeGen.reg, ThriftCodeGen.snk
>
>
> I have developed a single file code generator for Thrift in Visual Studio
> 2008 which allows .thrift files to be treated as first-class citizens in the
> IDE. When you add a .thrift file to the IDE, it is compiled and then all the
> compiled code output is condensed into a single .cs file which shows up as a
> subordinate file to the .thrift file in the IDE. As you edit or save the
> file it regenerates the .cs code for full build dependency support. This is
> built directly into the existing C# project provided with the distribution,
> and the test project no longer needs a pre-build step in order to work
> properly. I also added an extensive readme on installation and provided a
> tutorial walkthrough on how to use it.
> I am waiting for Dell legal to approve release of the code as open source.
> Once that happens I will make a patch available. Until then consider this is
> a placeholder.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)