protected override void AddToContext(string fullPath, IImmutableDictionary <string, string> metadata, bool isActiveContext, IProjectLogger logger) { string[] folderNames = FileItemServices.GetLogicalFolderNames(Path.GetDirectoryName(_project.FullPath), fullPath, metadata); logger.WriteLine("Adding source file '{0}'", fullPath); Context.AddSourceFile(fullPath, isInCurrentContext: isActiveContext, folderNames: folderNames); }
private static string GetLinkedParentFolder(IImmutableDictionary <string, string> metadata) { string linkFilePath = FileItemServices.GetLinkFilePath(metadata); if (linkFilePath != null) { return(Path.GetDirectoryName(linkFilePath)); } return(null); }
private string GetLinkedParentFolder(string filePath, IProjectChangeDescription projectChange) { var metadata = projectChange.After.Items[filePath]; string linkFilePath = FileItemServices.GetLinkFilePath(metadata); if (linkFilePath != null) { return(Path.GetDirectoryName(linkFilePath)); } return(null); }
private void AddToContextIfNotPresent(string includePath, IImmutableDictionary <string, string> metadata, IProjectLogger logger) { string fullPath = _project.MakeRooted(includePath); if (!_paths.Contains(fullPath)) { string[]? folderNames = FileItemServices.GetLogicalFolderNames(Path.GetDirectoryName(_project.FullPath), fullPath, metadata); logger.WriteLine("Adding dynamic file '{0}'", fullPath); Context.AddDynamicFile(fullPath, folderNames); bool added = _paths.Add(fullPath); Assumes.True(added); } }