public override CompileResults Compile(string inPath, string outPath) { SassAndCoffee.Ruby.Sass.SassCompiler compiler = new SassAndCoffee.Ruby.Sass.SassCompiler(); string output = compiler.Compile(inPath, false, null); using (StreamWriter sw = new StreamWriter(outPath)) { sw.WriteLine(OrangeBits.GetHeader(inPath)); sw.Write(output); } return(null); }
public CompileResults Compile(string inPath, string outPath) { CoffeeScriptCompiler compiler = new CoffeeScriptCompiler(new SassAndCoffee.Core.InstanceProvider <IJavaScriptRuntime>(() => new IEJavaScriptRuntime())); using (StreamReader sr = new StreamReader(inPath)) { string content = sr.ReadToEnd(); string output = compiler.Compile(content); using (StreamWriter sw = new StreamWriter(outPath)) { sw.WriteLine(OrangeBits.GetHeader(inPath)); sw.Write(output); } } return(null); }
//-------------------------------------------------------------------------- // // ICompiler Methods // //-------------------------------------------------------------------------- #region CompileResults /// <summary> /// /// </summary> /// <param name="inPath"></param> /// <param name="outPath"></param> public CompileResults Compile(string inPath, string outPath) { using (StreamReader sr = new StreamReader(inPath)) { LessEngine engine = new LessEngine(); SetCurrentFilePath(engine.Parser, inPath); var fileReader = new FileReader(); var source = fileReader.GetFileContents(inPath); var output = engine.TransformToCss(source, inPath); if (engine.LastTransformationSuccessful) { using (StreamWriter sw = new StreamWriter(outPath)) { sw.WriteLine(OrangeBits.GetHeader(inPath)); sw.Write(output); } } else { throw new Exception("Error compiling LESS"); } } return(null); }