Marcel, could you please add log messages to your commits?this will make it 
much easier to backtrace stuff. -Robert
________________________________
> From: marceloverd...@codehaus.org 
> To: s...@mojo.codehaus.org 
> Date: Mon, 10 Oct 2011 16:03:44 -0500 
> Subject: [mojo-scm] [14791] 
> trunk/sandbox/lesscss-maven-plugin/src/main/java/com/asual: 
> 
> 
> Revision 
> 14791<http://fisheye.codehaus.org/changelog/mojo/?cs=14791> 
> Author 
> marceloverdijk 
> Date 
> 2011-10-10 16:03:44 -0500 (Mon, 10 Oct 2011) 
> Log Message 
> 
> Modified Paths 
> 
> * 
> trunk/sandbox/lesscss-maven-plugin/src/main/java/org/codehaus/mojo/lesscss/CompileMojo.java
>  
> 
> Removed Paths 
> 
> * trunk/sandbox/lesscss-maven-plugin/src/main/java/com/asual/lesscss/ 
> 
> Diff 
> Modified: 
> trunk/sandbox/lesscss-maven-plugin/src/main/java/org/codehaus/mojo/lesscss/CompileMojo.java
>  
> (14790 => 14791) 
> 
> 
> --- 
> trunk/sandbox/lesscss-maven-plugin/src/main/java/org/codehaus/mojo/lesscss/CompileMojo.java
>  
> 2011-10-08 14:14:52 UTC (rev 14790) 
> +++ 
> trunk/sandbox/lesscss-maven-plugin/src/main/java/org/codehaus/mojo/lesscss/CompileMojo.java
>  
> 2011-10-10 21:03:44 UTC (rev 14791) 
> @@ -19,16 +19,14 @@ 
> import java.io.IOException; 
> import java.net.MalformedURLException; 
> import java.util.Arrays; 
> - 
> import org.apache.maven.plugin.AbstractMojo; 
> import org.apache.maven.plugin.MojoExecutionException; 
> import org.codehaus.plexus.util.DirectoryScanner; 
> +import com.googlecode.lesscss4j.LessCompiler; 
> +import com.googlecode.lesscss4j.LessException; 
> 
> -import com.asual.lesscss.LessEngine; 
> -import com.asual.lesscss.LessException; 
> - 
> /** 
> - * Goal which compiles the less sources to css stylesheets. 
> + * Goal which compiles the LESS sources to CSS stylesheets. 
> * 
> * @author Marcel Overdijk 
> * @goal compile 
> @@ -69,11 +67,11 @@ 
> private String[] excludes = new String[] {}; 
> 
> /** 
> - * The location of the less javascript file. 
> + * The location of the LESS JavasSript file. 
> * 
> * @parameter 
> */ 
> - private String lessJs; 
> + private File lessJs; 
> 
> /** 
> * Execute the MOJO. 
> @@ -103,7 +101,7 @@ 
> 
> if ( files == null || files.length < 1 ) 
> { 
> - getLog().info( "Nothing to compile - no less sources found" ); 
> + getLog().info( "Nothing to compile - no LESS sources found" ); 
> } 
> else 
> { 
> @@ -112,24 +110,17 @@ 
> getLog().debug( "included files = " + Arrays.toString( files ) ); 
> } 
> 
> - LessEngine engine; 
> - 
> - if ( lessJs == null ) 
> + LessCompiler lessCompiler = new LessCompiler(); 
> + 
> + if ( lessJs != null ) 
> { 
> - engine = new LessEngine(); 
> - } 
> - else 
> - { 
> - getLog().info( "Using custom less javascript: " + lessJs ); 
> - File less = new File( lessJs ); 
> - try 
> - { 
> - engine = new LessEngine( less.toURI().toURL() ); 
> + try { 
> + lessCompiler.setLessJs(lessJs.toURI().toURL()); 
> } 
> - catch ( MalformedURLException e ) 
> - { 
> - throw new MojoExecutionException( "Error while loading less javascript", e 
> ); 
> + catch (MalformedURLException e) { 
> + throw new MojoExecutionException( "Error while loading LESS JavaScript", e 
> ); 
> } 
> + getLog().info( "Using custom LESS javascript: " + lessJs.getAbsolutePath() 
> ); 
> } 
> 
> for ( String file : files ) 
> @@ -146,28 +137,28 @@ 
> 
> try 
> { 
> - engine.compile( input, output ); 
> + lessCompiler.compile( input, output ); 
> } 
> catch ( LessException e ) 
> { 
> - throw new MojoExecutionException( "Error while compiling less sources", e 
> ); 
> + throw new MojoExecutionException( "Error while compiling LESS sources", e 
> ); 
> } 
> catch ( IOException e ) 
> { 
> - throw new MojoExecutionException( "Error while compiling less sources", e 
> ); 
> + throw new MojoExecutionException( "Error while compiling LESS sources", e 
> ); 
> } 
> } 
> 
> StringBuilder sb = new StringBuilder(); 
> sb.append( "Compiled " ); 
> sb.append( files.length ); 
> - sb.append( " less " ); 
> + sb.append( " LESS " ); 
> sb.append( ( files.length == 1 ? "source" : "sources" ) ); 
> sb.append( " to " ); 
> sb.append( outputDirectory ); 
> sb.append( " (" ); 
> sb.append( System.currentTimeMillis() - start ); 
> - sb.append( "ms)" ); 
> + sb.append( " ms)" ); 
> getLog().info( sb.toString() ); 
> } 
> } 
> 
> 
> 
> ________________________________ 
> 
> To unsubscribe from this list please visit: 
> 
> http://xircles.codehaus.org/manage_email                                      
>   

Reply via email to