Package com.github.sommeri.less4j.core

Examples of com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler


        if (cssContent == null) {

            // clear any obsolete content
            timeToContentMap.clear();

            ThreadUnsafeLessCompiler compiler = new ThreadUnsafeLessCompiler();
            LessCompiler.Configuration configuration = new LessCompiler.Configuration();
            configuration.getSourceMapConfiguration().setLinkSourceMap(false);

            try {
                LessCompiler.CompilationResult result = compiler.compile(lessSource, configuration);
                List<LessCompiler.Problem> warnings = result.getWarnings();

                for (LessCompiler.Problem warning : warnings) {
                    LOG.warn("There is a warning during compilation of '{}' at line {}, character {}. Message: {}",
                             lessSource.getInputURL(), warning.getLine(), warning.getCharacter(), warning.getMessage());
View Full Code Here


    return lessValue;
  }

  @Override
  public InputStream open(String s, URLConnection resource) throws IOException {
    LessCompiler compiler = new ThreadUnsafeLessCompiler();
    try {
      LessCompiler.CompilationResult result = compiler.compile(resource.getURL());
      return new ByteArrayInputStream(result.getCss().getBytes());
    }
    catch (Less4jException e) {
      List<LessCompiler.Problem> errors = e.getErrors();
      ArrayList<Message> messages = new ArrayList<Message>(errors.size());
View Full Code Here

    customFunctionExample();
  }

  private static void basicFileExample() throws Less4jException {
    File inputLessFile = createFile("sampleInput.less", "* { margin: 1 1 1 1; }");
    LessCompiler compiler = new ThreadUnsafeLessCompiler();
    CompilationResult compilationResult = compiler.compile(inputLessFile);

    System.out.println(compilationResult.getCss());
    for (Problem warning : compilationResult.getWarnings()) {
      System.err.println(format(warning));
    }
View Full Code Here

   
    return text;
  }

  protected LessCompiler getCompiler() {
    return new ThreadUnsafeLessCompiler();
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler

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.