private void PopulateFilesTab()
        {
            var root = new Folder();

            foreach (var file in archiveFile.Files.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase))
            {
                AddSourceFile(root, file.Key);
            }

            foreach (var taskAssembly in Build.TaskAssemblies)
            {
                var filePath   = ArchiveFile.CalculateArchivePath(taskAssembly.Key);
                var sourceFile = AddSourceFile(root, filePath);
                foreach (var taskName in taskAssembly.Value.OrderBy(s => s))
                {
                    var task = new Task
                    {
                        Name = taskName
                    };
                    sourceFile.AddChild(task);
                }
            }

            foreach (var subFolder in root.Children.OfType <Folder>())
            {
                CompressTree(subFolder);
            }

            filesTree.Items       = root.Children;
            filesTree.GotFocus   += (s, a) => ActiveTreeView = filesTree;
            filesTree.ContextMenu = sharedTreeContextMenu;
        }
Ejemplo n.º 2
0
        private void GenerateSourcesForProject(CompilerInvocation invocation, string outputDirectory)
        {
            var virtualProjectFilePath = invocation.ProjectFilePath;
            virtualProjectFilePath = ArchiveFile.CalculateArchivePath(virtualProjectFilePath);
            var physicalProjectPath = GetPhysicalPath(outputDirectory, virtualProjectFilePath);
            var physicalProjectDirectory = Path.GetDirectoryName(physicalProjectPath);
            if (!Directory.Exists(physicalProjectDirectory))
            {
                return;
            }

            var arguments = invocation.CommandLineArguments.Tokenize();
            foreach (var argument in arguments)
            {
                if (argument.StartsWith("/"))
                {
                    var reference = TryGetReference(argument);
                    if (reference != null)
                    {
                        reference = ArchiveFile.CalculateArchivePath(reference);
                        var physicalReferencePath = GetPhysicalPath(outputDirectory, reference);
                        WriteEmptyAssembly(physicalReferencePath);
                    }
                }
                else
                {
                    var sourceRelativePath = argument.TrimQuotes();
                    var physicalSourcePath = Path.Combine(physicalProjectDirectory, sourceRelativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
                    physicalSourcePath = Path.GetFullPath(physicalSourcePath);
                    WriteFile(physicalSourcePath, "");
                }
            }
        }
Ejemplo n.º 3
0
        private void GenerateSourcesForProject(CompilerInvocation invocation, string outputDirectory)
        {
            var virtualProjectDirectory = invocation.ProjectDirectory;

            virtualProjectDirectory = ArchiveFile.CalculateArchivePath(virtualProjectDirectory);
            var physicalProjectPath = GetPhysicalPath(outputDirectory, virtualProjectDirectory);
        }
 public SourceText GetSourceFileText(string filePath)
 {
     filePath = ArchiveFile.CalculateArchivePath(filePath);
     fileContents.TryGetValue(filePath, out SourceText result);
     return(result);
 }