maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java
Date Sat, 12 Mar 2005 06:10:37 GMT
brett       2005/03/11 22:10:37

  Modified:    maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilerMojo.java
  Log:
  add source and target
  
  Revision  Changes    Path
  1.22      +15 -1     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CompilerMojo.java	10 Mar 2005 17:16:23 -0000	1.21
  +++ CompilerMojo.java	12 Mar 2005 06:10:37 -0000	1.22
  @@ -57,6 +57,8 @@
    * expression="#maven.compiler.debug"
    * description="Whether to include debugging information in the compiled class files; the
default value is false"
    * @todo change debug parameter type to Boolean
  + * @parameter name="source" type="String" required="false" expression="#source" validator=""
description="The -source argument for the Java compiler"
  + * @parameter name="target" type="String" required="false" expression="#target" validator=""
description="The -target argument for the Java compiler"
    */
   
   public class CompilerMojo
  @@ -95,6 +97,18 @@
           compilerConfiguration.setOutputLocation( outputDirectory );
           compilerConfiguration.setClasspathEntries( classpathElements );
           compilerConfiguration.setSourceLocations( compileSourceRoots );
  +
  +        String source = ( String ) request.getParameter( "source" );
  +        if ( source != null )
  +        {
  +            compilerConfiguration.addCompilerOption( "-source", source );
  +        }
  +        
  +        String target = ( String ) request.getParameter( "target" );
  +        if ( target != null )
  +        {
  +            compilerConfiguration.addCompilerOption( "-target", target );
  +        }
           
           /* Compile with debugging info */
           String debugAsString = (String) request.getParameter( "debug" );
  
  
  

Mime
View raw message