src/T4Toolbox.VisualStudio/OutputFileManager.cs
/// <summary>
/// Deletes output files that were not generated by the current session.
/// </summary>
Deletes output files that were not generated by the current session.
Deletes output files that were not generated by the current session .
private void DeleteOldOutputs()
        {
            string lastOutputs = this.input.GetItemAttribute(ItemMetadata.LastOutputs);
            string[] logEntries = lastOutputs.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in logEntries)
            {
                string relativePath = line.Trim();
                if (relativePath.Length == 0)
                {
                    continue;
                }
                string absolutePath = this.GetFullPath(relativePath);
                if (this.outputFiles.Any(output => string.Equals(this.GetFullPath(output.Path), absolutePath, StringComparison.OrdinalIgnoreCase)))
                {
                    continue;
                }
                ProjectItem projectItem = this.dte.Solution.FindProjectItem(absolutePath);
                if (projectItem != null)
                {
                    DeleteProjectItem(projectItem);
                }
            }
        }
private void DeleteOldOutputs ( ) { string lastOutputs = this . input . GetItemAttribute ( ItemMetadata . LastOutputs ) ; string [ ] logEntries = lastOutputs . Split ( new [ ] { ' \n ' , ' \r ' } , StringSplitOptions . RemoveEmptyEntries ) ; foreach ( string line in logEntries ) { string relativePath = line . Trim ( ) ; if ( relativePath . Length == 0 ) { continue ; } string absolutePath = this . GetFullPath ( relativePath ) ; if ( this . outputFiles . Any ( output => string . Equals ( this . GetFullPath ( output . Path ) , absolutePath , StringComparison . OrdinalIgnoreCase ) ) ) { continue ; } ProjectItem projectItem = this . dte . Solution . FindProjectItem ( absolutePath ) ; if ( projectItem != null ) { DeleteProjectItem ( projectItem ) ; } } }
Deletes output files that were not generated by the current session.
Deletes output files that were not generated by the current session .
// Delete all files recorded in the log that were not regenerated // Skip blank lines // Skip the file if it was regenerated during current transformation // The file wasn't regenerated, delete it from the solution, source control and file storage