Exemple #1
0
        public void SetUp()
        {
            globalJS = new JavascriptTransformerPolicy <StubTransformer>(ActionType.Global);
            js1      = JavascriptTransformerPolicy <StubTransformer> .For(ActionType.Transformation, ".coffee");

            js2 = JavascriptTransformerPolicy <StubTransformer> .For(ActionType.Transformation, ".tr1", "tr2");

            js3 = JavascriptTransformerPolicy <StubTransformer> .For(ActionType.Generate, ".a");


            globalCSS = new CssTransformerPolicy <StubTransformer>(ActionType.Global);
            css1      = new CssTransformerPolicy <StubTransformer>(ActionType.Transformation, ".css");
            less      = new CssTransformerPolicy <StubTransformer>(ActionType.Transformation, ".less");
            sass      = new CssTransformerPolicy <StubTransformer>(ActionType.Transformation, ".sass");

            var policies = new List <ITransformerPolicy>()
            {
                globalJS,
                js1,
                js2,
                js3,
                globalCSS,
                css1,
                less,
                sass,
            };

            theLibrary = new TransformerPolicyLibrary(policies);
        }
        public ContentPlan BuildPlan()
        {
            var library      = new TransformerPolicyLibrary(_policies);
            var combinations = new AssetCombinationCache();

            if (_combination != null)
            {
                combinations.StoreCombination(_combination.MimeType, _combination);
            }

            var pipeline = new AssetPipeline();

            _files.Each(f =>
            {
                var path = new AssetPath(AssetPipeline.Application, f.Name, f.Folder);
                pipeline.AddFile(path, f);
            });

            var planner = new ContentPlanner(combinations, pipeline, library);

            return(planner.BuildPlanFor(_name));
        }