You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by ca...@apache.org on 2005/01/08 22:35:24 UTC

cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java

carlos      2005/01/08 13:35:24

  Modified:    maven-plugins/maven-compiler-plugin pom.xml
               maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilerMojo.java
  Log:
  Compile with debugging info by default
  
  Revision  Changes    Path
  1.11      +2 -2      maven-components/maven-plugins/maven-compiler-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/pom.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- pom.xml	26 Aug 2004 01:18:18 -0000	1.10
  +++ pom.xml	8 Jan 2005 21:35:24 -0000	1.11
  @@ -23,12 +23,12 @@
       <dependency>
         <groupId>plexus</groupId>
         <artifactId>plexus-compiler-api</artifactId>
  -      <version>1.0</version>
  +      <version>1.2-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>plexus</groupId>
         <artifactId>plexus-compiler-javac</artifactId>
  -      <version>1.0</version>
  +      <version>1.2-SNAPSHOT</version>
       </dependency>
     </dependencies>
   </project>
  
  
  
  1.9       +13 -2     maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
  
  Index: CompilerMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CompilerMojo.java	27 Jun 2004 17:10:31 -0000	1.8
  +++ CompilerMojo.java	8 Jan 2005 21:35:24 -0000	1.9
  @@ -1,10 +1,12 @@
   package org.apache.maven.plugin;
   
   import org.codehaus.plexus.compiler.Compiler;
  +import org.codehaus.plexus.compiler.CompilerConfiguration;
   import org.codehaus.plexus.compiler.CompilerError;
   import org.codehaus.plexus.compiler.javac.JavacCompiler;
   
   import java.io.File;
  +import java.util.Arrays;
   import java.util.Iterator;
   import java.util.List;
   
  @@ -73,8 +75,17 @@
           {
               return;
           }
  +        
  +        CompilerConfiguration compilerConfiguration = new CompilerConfiguration();
  +        
  +        compilerConfiguration.setOutputLocation(outputDirectory);
  +        compilerConfiguration.setClasspathEntries(Arrays.asList(classpathElements));
  +        compilerConfiguration.setSourceLocations(Arrays.asList(new String[] {sourceDirectory}));
  +        
  +        /* Compile with debugging info */
  +        compilerConfiguration.addCompilerOption("-g", null);
   
  -        List messages = compiler.compile( classpathElements, new String[]{sourceDirectory}, outputDirectory );
  +        List messages = compiler.compile(compilerConfiguration);
   
           if ( debug )
           {
  
  
  

Re: cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java

Posted by Brett Porter <br...@apache.org>.
>Yes, the scripts are there and that's good enough. It's just a pita
>checking it in. Emmanuel was right! :-)
>  
>
I agree - was just checking :)

We could bundle it with a source distribution later though.

- Brett

Re: cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java

Posted by Jason van Zyl <jv...@maven.org>.
On Sat, 2005-01-08 at 15:52, Brett Porter wrote:
> carlos@apache.org wrote:
> 
> >  +        /* Compile with debugging info */
> >  +        compilerConfiguration.addCompilerOption("-g", null);
> >  
> >
> Could we give the compiler this as a named option such as "setDebug"? 
> That way the JavacCompiler can add -g, but a different one that might 
> lable it differently can add something different.
> 
> Also, why was mboot.jar removed? Are we going to require 
> m2-bootstrap-all now instead of java -jar mboot.jar?

Yes, the scripts are there and that's good enough. It's just a pita
checking it in. Emmanuel was right! :-)

> Cheers,
> Brett

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


Re: cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java

Posted by Brett Porter <br...@apache.org>.
carlos@apache.org wrote:

>  +        /* Compile with debugging info */
>  +        compilerConfiguration.addCompilerOption("-g", null);
>  
>
Could we give the compiler this as a named option such as "setDebug"? 
That way the JavacCompiler can add -g, but a different one that might 
lable it differently can add something different.

Also, why was mboot.jar removed? Are we going to require 
m2-bootstrap-all now instead of java -jar mboot.jar?

Cheers,
Brett