private IntermediateFileObject(EvaluatedFilesRule parent, string currentSubPath, string originalFile, IEnumerable<EvaluatedFilesRule> currentStack ) { _parentRules = new Stack<EvaluatedFilesRule>(currentStack); _parentRules.Push(parent); OutputSubPath = parent.CreateChildPath(currentSubPath); File = originalFile; //parent.AddDescendentOFO(this); }
private IEnumerable<IntermediateFileObject> PerformPathTrimming(IEnumerable<IntermediateFileObject> files, EvaluatedFilesRule parent, TrimPathType trimType) { if (trimType == TrimPathType.minimal) { //DO NOT REORDER ANYTHING HERE. IF YOU DO, EVERYTHING WILL FAIL!!! return files.Zip(files.Select(i => i.File).GetMinimalPaths(), (o, s) => { o.OutputSubPath = parent.CreateChildPath(s); return o; }); } else if (trimType == TrimPathType.all) { return files.Select(i => { i.OutputSubPath = parent.CreateChildPath(Path.GetFileName(i.File)); return i; }); } //we did the local_minimal path trimming before //TODO: we actually need to move this back down here return files; }