Package com.github.sommeri.less4j.LessSource

Examples of com.github.sommeri.less4j.LessSource.StringSource


    deleteFile(inputLessFile);
  }

  private static void guessedCssLocationExample2() throws Less4jException {
    URI uri = (new File("src/sampleInput.less")).toURI();
    StringSource lessSource = new StringSource(".class { margin: 1 1 1 1; }", "sampleInput.less", uri);
   
    LessCompiler compiler = new DefaultLessCompiler();
    CompilationResult compilationResult = compiler.compile(lessSource);

    System.out.println(compilationResult.getCss());
View Full Code Here


    File cssFile = new File("dist/sampleInput.css").getAbsoluteFile();
    Configuration configuration = new Configuration();
    configuration.setCssResultLocation(cssFile);

    URI uri = (new File("src/sampleInput.less")).toURI();
    StringSource lessSource = new StringSource(".class { margin: 1 1 1 1; }", "sampleInput.less", uri);
   
    LessCompiler compiler = new DefaultLessCompiler();
    CompilationResult compilationResult = compiler.compile(lessSource, configuration);

    System.out.println(compilationResult.getCss());
View Full Code Here

    expectCompileError(less, expectedError);
  }

  private void expectCompileError(String less, String expectedError) {
    StringSource lessSource = new StringSource(less);
    try {
      LessCompiler compiler = new DefaultLessCompiler();
      compiler.compile(lessSource);
    } catch (Less4jException e) {
      assertFalse(e.getErrors().isEmpty());
View Full Code Here

  protected CompilationResult compile(File lessFile, File cssOutput) throws Less4jException {
    try {
      String less = IOUtils.toString(new FileReader(lessFile));
      LessCompiler compiler = getCompiler();
      Configuration configuration = createConfiguration(cssOutput);
      CompilationResult actual = compiler.compile(new StringSource(less), configuration);
      return actual;
    } catch (IOException ex) {
      throw new RuntimeException("Can not read less file " + lessFile.getName(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.LessSource.StringSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.