Beispiel #1
0
 public JsFileProcessor(IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, JsFile jsFile)
 {
     RetryableFileOpener = retryableFileOpener;
     PathProvider = pathProvider;
     CompressionType = jsFile.CompressionType;
     var filePath = PathProvider.MapPath(jsFile.FilePath);
     FileInfo = new FileInfo(filePath);
 }
Beispiel #2
0
        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";
                }
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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);
            }
        }
Beispiel #5
0
        public JsFileProcessor(IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, JsFile jsFile)
        {
            RetryableFileOpener = retryableFileOpener;
            PathProvider        = pathProvider;
            CompressionType     = jsFile.CompressionType;
            var filePath = PathProvider.MapPath(jsFile.FilePath);

            FileInfo = new FileInfo(filePath);
        }
        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);
            }
        }