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));
            }
        }
 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;
     }
 }
        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);
        }
Beispiel #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));
            }
        }
        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();
        }
 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;
 }
 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));
     }
 }
Beispiel #8
0
 internal FileNodeProperties(TrackedFileNode node)
     : base(node)
 {
 }
 internal FileNodeProperties(TrackedFileNode node)
     : base(node)
 { }