private static void CreateCrushedFiles(IPathProvider pathProvider, CssGroupElementCollection cssGroups, JsGroupElementCollection jsGroups, CssCrusher cssCrusher, JsCrusher jsCrusher) { _cssOutput = "Css Files created:\r\n"; foreach (CssGroupElement group in cssGroups) { var files = new List<CssFile>(); foreach (CssFileElement cssFile in group.Files) { var file = new CssFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); cssCrusher.AddFiles(outputUri, files, group.AppendHashToCssAsset); _cssOutput += outputUri + " (" + group.Name + ")\r\n"; foreach (var cssFile in files) { outputUri = new Uri(pathProvider.ToAbsolute(cssFile.FilePath), UriKind.Relative); _cssOutput += " " + outputUri + "\r\n"; } } _jsOutput = "Js Files created:\r\n"; foreach (JsGroupElement group in jsGroups) { var files = new List<JsFile>(); foreach (JsFileElement cssFile in group.Files) { var file = new JsFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); jsCrusher.AddFiles(outputUri, files); _jsOutput += outputUri + " (" + group.Name + ")\r\n"; foreach (var jsFile in files) { outputUri = new Uri(pathProvider.ToAbsolute(jsFile.FilePath), UriKind.Relative); _jsOutput += " " + outputUri + "\r\n"; } } }
public CssFileProcessor(IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, ICssPathRewriter cssPathRewriter, CssFile cssFile, Uri cssRootUri, bool appendHashToAssets) { RetryableFileOpener = retryableFileOpener; PathProvider = pathProvider; CssPathRewriter = cssPathRewriter; CompressionType = cssFile.CompressionType; var filePath = PathProvider.MapPath(cssFile.FilePath); FileInfo = new FileInfo(filePath); CssRootUri = cssRootUri; RelativeRootUri = GetRelativeRootUri(cssFile.FilePath); AppendHashToAssets = appendHashToAssets; }
private void InitManager() { AppDomain.CurrentDomain.DomainUnload += OnDomainUnload; foreach (CssGroupElement group in _cssGroups) { var files = new List <CssFile>(); foreach (CssFileElement cssFile in group.Files) { var file = new CssFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(_pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); _cssCrusher.AddFiles(outputUri, files, group.AppendHashToCssAsset); } foreach (JsGroupElement group in _jsGroups) { var files = new List <JsFile>(); foreach (JsFileElement cssFile in group.Files) { var file = new JsFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(_pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); _jsCrusher.AddFiles(outputUri, files); } }
private void InitManager() { AppDomain.CurrentDomain.DomainUnload += OnDomainUnload; foreach (CssGroupElement group in cssGroups) { var files = new List <CssFile>(); var outputPath = group.OutputFilePath; foreach (CssFileElement cssFile in group.Files) { var file = new CssFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } CrushCssHelper.AddFiles(outputPath, files); } foreach (JsGroupElement group in jsGroups) { var files = new List <JsFile>(); var outputPath = group.OutputFilePath; foreach (JsFileElement cssFile in group.Files) { var file = new JsFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } CrushJsHelper.AddFiles(outputPath, files); } }
private void InitManager() { AppDomain.CurrentDomain.DomainUnload += OnDomainUnload; foreach (CssGroupElement group in _cssGroups) { var files = new List<CssFile>(); foreach (CssFileElement cssFile in group.Files) { var file = new CssFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(_pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); _cssCrusher.AddFiles(outputUri, files, group.AppendHashToCssAsset); } foreach (JsGroupElement group in _jsGroups) { var files = new List<JsFile>(); foreach (JsFileElement cssFile in group.Files) { var file = new JsFile() { CompressionType = cssFile.CompressionType, FilePath = cssFile.FilePath }; files.Add(file); } var outputUri = new Uri(_pathProvider.ToAbsolute(group.OutputFilePath), UriKind.Relative); _jsCrusher.AddFiles(outputUri, files); } }
public CssFileProcessor(IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, ICssPathRewriter cssPathRewriter, CssFile cssFile, Uri cssRootUri, bool appendHashToAssets) { RetryableFileOpener = retryableFileOpener; PathProvider = pathProvider; CssPathRewriter = cssPathRewriter; CompressionType = cssFile.CompressionType; var filePath = PathProvider.MapPath(cssFile.FilePath); FileInfo = new FileInfo(filePath); CssRootUri = cssRootUri; RelativeRootUri = GetRelativeRootUri(cssFile.FilePath); AppendHashToAssets = appendHashToAssets; }