Ejemplo n.º 1
0
        internal void OnNodeIncluded(TrackedFileNode node)
        {
            HashSet <string> children = ModuleTracker.AddRootModuleIncremental(node.Url);

            foreach (string child in children)
            {
                HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(child), false);
                parent.AddChild(CreateUntrackedNode(child));
            }
        }
Ejemplo n.º 2
0
 void ReloadOnOutputChange(object sender, ProjectPropertyChangedArgs e)
 {
     if (String.Equals(e.PropertyName, "OutputType", StringComparison.OrdinalIgnoreCase) &&
         !String.Equals(e.OldValue, e.NewValue, StringComparison.OrdinalIgnoreCase))
     {
         TrackedFileNode crateNode = this.GetCrateFileNode(e.OldValue);
         if (crateNode != null)
         {
             crateNode.IsEntryPoint = false;
         }
         this.ReloadCore();
         this.GetCrateFileNode(e.NewValue).IsEntryPoint = true;
     }
 }
Ejemplo n.º 3
0
        private TrackedFileNode CreateTrackedNode(ProjectElement elm)
        {
            var node = new TrackedFileNode(this, elm);

            if (!ModuleTracker.IsIncremental)
            {
                ModuleTracker.AddRootModule(node.Url);
            }
            else
            {
                HashSet <string> children = ModuleTracker.AddRootModuleIncremental(node.Url);
                foreach (string child in children)
                {
                    HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(child), false);
                    parent.AddChild(CreateUntrackedNode(child));
                }
            }
            return(node);
        }
Ejemplo n.º 4
0
        protected void ReloadCore()
        {
            string outputType = GetProjectProperty(ProjectFileConstants.OutputType, true);
            string entryPoint = GetCrateFileNodePath(outputType);

            containsEntryPoint = GetCrateFileNode(outputType) != null;
            ModuleTracker      = new ModuleTracker(entryPoint);
            base.Reload();
            // This project for some reason doesn't include entrypoint node, add it
            if (!containsEntryPoint)
            {
                HierarchyNode   parent = this.CreateFolderNodes(Path.GetDirectoryName(entryPoint), true);
                TrackedFileNode node   = (TrackedFileNode)this.CreateFileNode(entryPoint);
                node.IsEntryPoint = true;
                parent.AddChild(node);
            }
            MarkEntryPointFolders(outputType);
            foreach (string file in ModuleTracker.ExtractReachableAndMakeIncremental())
            {
                HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(file), false);
                parent.AddChild(CreateUntrackedNode(file));
            }
        }
Ejemplo n.º 5
0
        protected override void Reload()
        {
            string outputType = GetProjectProperty(ProjectFileConstants.OutputType, false);
            string entryPoint = Path.Combine(Path.GetDirectoryName(this.FileName), outputType == "library" ? @"src\lib.rs" : @"src\main.rs");

            containsEntryPoint = false;
            ModuleTracker      = new ModuleTracker(entryPoint);
            base.Reload();
            // This project for some reason doesn't include entrypoint node, add it
            if (!containsEntryPoint)
            {
                HierarchyNode   parent = this.CreateFolderNodes(Path.GetDirectoryName(entryPoint), true);
                TrackedFileNode node   = (TrackedFileNode)this.CreateFileNode(entryPoint);
                node.IsEntryPoint = true;
                parent.AddChild(node);
            }
            foreach (string file in ModuleTracker.ExtractReachableAndMakeIncremental())
            {
                HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(file), false);
                parent.AddChild(CreateUntrackedNode(file));
            }
            this.BuildProject.Save();
        }
Ejemplo n.º 6
0
 private TrackedFileNode CreateTrackedNode(ProjectElement elm)
 {
     var node = new TrackedFileNode(this, elm);
     if (!ModuleTracker.IsIncremental)
     {
         ModuleTracker.AddRootModule(node.Url);
     }
     else
     {
         HashSet<string> children = ModuleTracker.AddRootModuleIncremental(node.Url);
         foreach (string child in children)
         {
             HierarchyNode parent = this.CreateFolderNodes(fs.Path.GetDirectoryName(child), false);
             parent.AddChild(CreateUntrackedNode(child));
         }
     }
     return node;
 }
Ejemplo n.º 7
0
 internal void OnNodeIncluded(TrackedFileNode node)
 {
     HashSet<string> children = ModuleTracker.AddRootModuleIncremental(node.Url);
     foreach (string child in children)
     {
         HierarchyNode parent = this.CreateFolderNodes(fs.Path.GetDirectoryName(child), false);
         parent.AddChild(CreateUntrackedNode(child));
     }
 }
Ejemplo n.º 8
0
 internal FileNodeProperties(TrackedFileNode node)
     : base(node)
 {
 }
Ejemplo n.º 9
0
 internal FileNodeProperties(TrackedFileNode node)
     : base(node)
 { }