Package org.lesscss

Examples of org.lesscss.LessCompiler


  public boolean stop() {
    return false;
  }

  public static void main(String[] args) throws LessException, IOException {
    LessCompiler lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
    System.out.println(css);

    LessCssCompiler lessCssCompiler = new LessCssCompiler();
    lessCssCompiler.setBuildContext(ThreadBuildContext.getContext());
    lessCssCompiler.setSourceDirectory(new File(PathKit.getWebRootPath() + "/css/"));
View Full Code Here


  protected LessCompiler lessCompiler;

  @Before
  public void setUp() throws Exception {
    lessCompiler = new LessCompiler();
  }
View Full Code Here

   
    public abstract static class InterpretedFunction implements Script, Function {}
   
    @Before
    public void setUp() throws Exception {
        lessCompiler = new LessCompiler();
       
        when(logger.isDebugEnabled()).thenReturn(false);
        FieldUtils.writeField(lessCompiler, "logger", logger, true);
    }
View Full Code Here

   * @throws Exception
   */
  private LessSource compile() throws Exception
  {
    // compile file
    final LessCompiler lessCompiler = new LessCompiler();

    // create new source
    final LessSource mainLessSource = new LessSource(lessTargetFile);

    log.info("compiling " + lessTargetFile.getAbsolutePath() + " to " + cssTargetFile.getAbsolutePath());
    lessCompiler.compile(mainLessSource, cssTargetFile, false);
    return mainLessSource;
  }
View Full Code Here

  public boolean stop() {
    return false;
  }

  public static void main(String[] args) throws LessException, IOException {
    LessCompiler lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");
//        System.out.println(css);


    lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));
    css = lessCompiler.compile(new File(PathKit.getWebRootPath() + "/src/main/webapp/css/app/_layout.less"));
    System.out.println(css);

    LessCssCompiler lessCssCompiler = new LessCssCompiler();
    lessCssCompiler.setBuildContext(ThreadBuildContext.getContext());
    lessCssCompiler.setSourceDirectory(new File(PathKit.getWebRootPath() + "/css/"));
View Full Code Here

          throw new LessCssException(
              "Custom LESS JavaScript is not currently supported when using nodeExecutable");
        }
        lessCompiler = nodeJsLessCssCompiler;
      } else {
        LessCompiler newLessCompiler = new LessCompiler();
        newLessCompiler.setCompress(compress);
        newLessCompiler.setEncoding(encoding);
        if (lessJs != null) {
          try {
            newLessCompiler.setLessJs(lessJs.toURI().toURL());
          } catch (MalformedURLException e) {
            throw new LessCssException(
                "Error while loading LESS JavaScript: " + lessJs.getAbsolutePath(), e);
          }
        }
View Full Code Here

      copy(dir, "bootstrap-variables.less");
      copy(dir, "obj-type.less");
      copy(dir, "way-duplicata.less");

      File less = copy(dir, "way-duplicata-deps.less");
      return new LessCompiler().compile(less);
    }
View Full Code Here

    this.logger = logger;
    this.oracle = oracle;
  }

  public File convert(URL resource) throws IOException {
    LessCompiler lessCompiler = new LessCompiler();
    try {
      String lessFile = parseLess(resource);
      final String css = lessCompiler.compile(lessFile);
      return createCssFile(css);
    } catch (LessException e) {
      throw new IOException("specified less stylesheet could not be compiled to css", e);
    }
  }
View Full Code Here

      copy(dir, "bootstrap-variables.less");
      copy(dir, "obj-type.less");
      copy(dir, "way-boleto.less");

      File less = copy(dir, "way-boleto-deps.less");
      return new LessCompiler().compile(less);
    }
View Full Code Here

    Context context = Context.get();
    HttpServletRequest request = context.getRequest();
    String uri = request.getRequestURI();
    try {
      logger.debug("lessifying: {}", uri);
      LessCompiler less = new LessCompiler();
      String content = IOUtils.toString(reader);
      writer.write(less.compile(content));
    } catch (LessException ex) {
      throw new LessRuntimeException(LessCssError.of(
          uri, ex.getCause()), ex.getCause());
    } finally {
      // Rhino throws an exception when trying to exit twice. Make sure we don't
View Full Code Here

TOP

Related Classes of org.lesscss.LessCompiler

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.