private bool IsJsFileADependency(JsFile jf) { foreach (var rjf in _RemainingJsFiles) { foreach (var jr in rjf.JsRefs) { if (jr.InternalFile == null) //Could not resolve, ignore continue; if (jf == jr.InternalFile) return true; } } return false; }
protected JsFile ParseFileMetadata(string fullPath) { var jf = new JsFile { FullPath = fullPath, JsRefs = new List<JsRef>(), }; using (var sr = new StreamReader(fullPath)) { while (!sr.EndOfStream) { var line = sr.ReadLine(); if (CANCEL_REF_REGEX.IsMatch(line)) break; Match match; if (IsInTSMode) match = TS_REF_REGEX.Match(line); else match = JS_REF_REGEX.Match(line); if (match.Success) { var relativeFilename = match.Groups["filename"].Value; if (string.IsNullOrWhiteSpace(relativeFilename)) continue; relativeFilename = relativeFilename.Replace("/", "\\"); jf.JsRefs.Add(new JsRef { RefPath = relativeFilename }); } } } jf.ResolveRefs(); return jf; }
public bool Matches(JsFile other) { return string.Equals(this.FullPath, other.FullPath, System.StringComparison.CurrentCultureIgnoreCase); }
private bool JsFileHasDependencies(JsFile jf) { return _RemainingJsFiles.Join(jf.JsRefs, sjf => sjf, jr => jr.InternalFile, (sjf, jr) => jr).Any(); }