From 3eede41a936bd50357c517fe227601280d9d5563 Mon Sep 17 00:00:00 2001 From: bwhittle Date: Mon, 27 Mar 2017 11:02:15 -0700 Subject: [PATCH] Added visual studio support for dot net .tt files (#90) --- src/tools/dotnet.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua index af33ba6e..f933db89 100644 --- a/src/tools/dotnet.lua +++ b/src/tools/dotnet.lua @@ -45,7 +45,7 @@ info.action = "Compile" elseif fcfg.buildaction == "Embed" or ext == ".resx" then info.action = "EmbeddedResource" - elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" or ext == ".dll" then + elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" or ext == ".dll" or ext == ".tt" then info.action = "Content" elseif fcfg.buildaction == "Resource" then info.action = "Resource" @@ -117,6 +117,13 @@ info.SubType = "Form" end + testname = basename .. ".tt" + if project.hasfile(fcfg.project, testname) then + info.AutoGen = "True" + info.DesignTime = "True" + info.DependentUpon = testname + end + end -- Allow C# object type build actions to override the default @@ -168,6 +175,15 @@ end end + if info.action == "Content" and fname:endswith(".tt") then + local testname = fname:sub(1, -4) .. ".cs" + if project.hasfile(fcfg.project, testname) then + info.Generator = "TextTemplatingFileGenerator" + info.LastGenOutput = path.getname(testname) + info.CopyToOutputDirectory = nil + end + end + if info.action == "None" and fname:endswith(".xsd") then local testname = fname:sub(1, -5) .. ".Designer.cs" if project.hasfile(fcfg.project, testname) then