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