Package org.lesscss

Examples of org.lesscss.LessSource


        if (!output.getParentFile().exists() && !output.getParentFile().mkdirs()) {
          throw new LessCssException("Cannot create output directory " + output.getParentFile());
        }

        try {
          LessSource lessSource = new LessSource(input);
          long lessLastModified = lessSource.getLastModifiedIncludingImports();
          if (!output.exists() || (force || output.lastModified() < lessLastModified) && lastErrorModified < lessLastModified) {
            lastErrorModified = lessLastModified;
            long compilationStarted = System.currentTimeMillis();
            logger.info("Compiling LESS source: " + file);
            if (lessCompiler instanceof LessCompiler) {
View Full Code Here


      logger.info("The following LESS sources have been resolved:");

      for (String file : files) {
        File lessFile = new File(sourceDirectory, file);
        try {
          LessSource lessSource = new LessSource(lessFile);
          listLessSource(lessSource, file, 0, false);
        } catch (FileNotFoundException e) {
          throw new LessCssException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
        } catch (IOException e) {
          throw new LessCssException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
View Full Code Here

        if (!output.getParentFile().exists() && !output.getParentFile().mkdirs()) {
          throw new LessCssException("Cannot create output directory " + output.getParentFile());
        }

        try {
          LessSource lessSource = new LessSource(input);
          long lessLastModified = lessSource.getLastModifiedIncludingImports();
          if ((force || !output.exists() || output.lastModified() < lessLastModified) && lastErrorModified < lessLastModified) {
            lastErrorModified = lessLastModified;
            long compilationStarted = System.currentTimeMillis();
            logger.info("Compiling LESS source: " + file + "...");
            if (lessCompiler instanceof LessCompiler) {
View Full Code Here

      logger.info("The following LESS sources have been resolved:");

      for (String file : files) {
        File lessFile = new File(sourceDirectory, file);
        try {
          LessSource lessSource = new LessSource(lessFile);
          listLessSource(lessSource, file, 0, false);
        } catch (FileNotFoundException e) {
          throw new LessCssException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
        } catch (IOException e) {
          throw new LessCssException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
View Full Code Here

        if (!output.getParentFile().exists() && !output.getParentFile().mkdirs()) {
          throw new MojoExecutionException("Cannot create output directory " + output.getParentFile());
        }

        try {
          LessSource lessSource = new LessSource(input);
          if (force || !output.exists() || output.lastModified() < lessSource.getLastModifiedIncludingImports()) {
            long compilationStarted = System.currentTimeMillis();
            getLog().info("Compiling LESS source: " + file + "...");
            if (lessCompiler instanceof LessCompiler) {
              ((LessCompiler) lessCompiler).compile(lessSource, output, force);
            } else {
View Full Code Here

      getLog().info("The following LESS sources have been resolved:");

      for (String file : files) {
        File lessFile = new File(sourceDirectory, file);
        try {
          LessSource lessSource = new LessSource(lessFile);
          listLessSource(lessSource, file, 0, false);
        } catch (FileNotFoundException e) {
          throw new MojoExecutionException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
        } catch (IOException e) {
          throw new MojoExecutionException("Error while loading LESS source: " + lessFile.getAbsolutePath(), e);
View Full Code Here

     * @throws IOException
     * @throws LessException
     */
    private void processLessFile(String lessIncludeFilepath, String outputFilepath, URL lessCssJavascriptUrl)
            throws IOException, LessException {
        LessSource lessSource = new LessSource(new File(lessIncludeFilepath));
        if (log.isDebugEnabled()) {
            String result = lessSource.getNormalizedContent();
            File lessSourceOutput = new File(outputFilepath + ".lesssource");
            IOUtils.write(result, new FileOutputStream(lessSourceOutput));
            log.debug("Full Less source from include file {0}, using lessCssJavascript at {1}"
                    + ", is at {2}, output css will be written to {3}",
                    lessIncludeFilepath, lessCssJavascriptUrl.toString(), lessSourceOutput, outputFilepath);
View Full Code Here

  {
    // 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

   * @throws Exception
   */
  public void instantiate() throws Exception
  {
    instantiateFiles();
    final LessSource mainLessSource = compile();

    if (Configuration.isDevelopmentMode() == true) {
      // only add this fancy resource watcher in dev mode
      final IModificationWatcher resourceWatcher = application.getResourceSettings().getResourceWatcher(true);
      // add watchers
      addWatcher(resourceWatcher, mainLessSource);
      for (final LessSource importedSource : mainLessSource.getImports().values()) {
        addWatcher(resourceWatcher, importedSource);
      }

    }

View Full Code Here

        if (!output.getParentFile().exists() && !output.getParentFile().mkdirs()) {
          throw new LessCssException("Cannot create output directory " + output.getParentFile());
        }

        try {
          LessSource lessSource = new LessSource(input);
          if (force || !output.exists() || output.lastModified() < lessSource.getLastModifiedIncludingImports()) {
            long compilationStarted = System.currentTimeMillis();
            logger.info("Compiling LESS source: " + file + "...");
            if (lessCompiler instanceof LessCompiler) {
              ((LessCompiler) lessCompiler).compile(lessSource, output, force);
            } else {
View Full Code Here

TOP

Related Classes of org.lesscss.LessSource

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.