in Backend/RiderPlugin/ForTea.RiderPlugin/TemplateProcessing/Managing/Impl/T4TargetFileManager.cs [150:175]
public void TryProcessExecutionResults(IT4File file)
{
Locks.AssertReadAccessAllowed();
Locks.AssertWriteAccessAllowed();
var temporary = TryFindTemporaryTargetFile(file);
if (temporary == null) return;
var destinationLocation = GetDestinationLocation(file, temporary.Name);
destinationLocation.DeleteFile();
File.Move(temporary.FullPath, destinationLocation.FullPath);
var sourceFile = file.PhysicalPsiSourceFile.NotNull();
var projectFile = sourceFile.ToProjectFile().NotNull();
IProjectFile destination = null;
Solution.InvokeUnderTransaction(cookie =>
{
destination = UpdateProjectModel(file, destinationLocation, cookie);
RemoveLastGenOutputIfDifferent(file, cookie, destinationLocation);
TemplateMetadataManager.UpdateTemplateMetadata(
cookie,
projectFile,
T4TemplateKind.Executable,
destinationLocation
);
TemplateMetadataManager.UpdateGeneratedFileMetadata(cookie, destination, projectFile);
});
OutputFileRefresher.Refresh(destination);
}