Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions T4.Build/BuildTemplateGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ string LockPath

return lockPath;
}
}

}
public new string OutputFile
{
get
{
{
get
{
if (string.IsNullOrEmpty(base.OutputFile))
{
if (ParsedTemplate == null)
Expand All @@ -54,11 +54,11 @@ string LockPath
foreach (var dt in ParsedTemplate.Directives)
{
if (dt.Name == "output")
ext = dt.Attributes.GetValueOrDefault("extension", ext);
}
base.OutputFile = Path.ChangeExtension(TemplateFile, ext);
}

ext = dt.Attributes.GetValueOrDefault("extension", ext);
}
base.OutputFile = Path.ChangeExtension(TemplateFile, ext);
}
return base.OutputFile;
}
}
Expand Down Expand Up @@ -114,7 +114,14 @@ public bool ProcessTemplate(bool skipUpToDate, out bool skipped)
return true;
}
}
return ProcessTemplate(TemplateFile, OutputFile);

var requestOutputFile = OutputFile;
var result = ProcessTemplate(TemplateFile, OutputFile);
if (requestOutputFile != OutputFile && File.Exists(OutputFile))
{
File.Move(OutputFile, requestOutputFile, true);
}
return result;
}

}
Expand Down