Skip to content

Commit

Permalink
Added visual studio support for dot net .tt files (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhittle authored and Tom van Dijck committed Jun 14, 2017
1 parent 6907f67 commit 0bdd518
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/tools/dotnet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0bdd518

Please sign in to comment.