public static CacheDefinition ToCache(this string key, List<string> paths, PackageProcessing processing) { return key.ToCacheDefintion(paths, paths.RawSource(processing)); }
/// <summary> /// Uses the PackageProcessing to lookup the filenames and map them to the source code, /// which if the file doesn't exist the PacakgeProcessing will log the error for later /// surfacing. /// </summary> /// <param name="files"> /// The list of filenames where the path is already resolved. /// </param> /// <param name="processing"> /// A package processing instance that can log errors and resolve filenames to file /// source code. /// </param> /// <returns> /// The source code with all the code from all of the files provided (when a file can /// be found) else an empty string for those files. /// </returns> public static string RawSource(this List<string> files, PackageProcessing processing) { return files.Aggregate( new StringBuilder(), (acc, name) => acc.Append(processing.Content[name])) .ToString(); }
public void Warnings_For_Empty_Package() { var resolver = new HomePathResolver( Path.Combine(Environment.CurrentDirectory, "../../Test-Files/Empty-Package/")); var p = new PackageProcessing(resolver, resolver.MapPackages()); Expect(p.Reporting.Warnings.Count, Is.GreaterThan(0)); }