add source and target

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163535 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-12 06:10:37 +00:00
parent f0a20e0bcd
commit c6978405cf
1 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,8 @@ import java.util.List;
* expression="#maven.compiler.debug" * expression="#maven.compiler.debug"
* description="Whether to include debugging information in the compiled class files; the default value is false" * description="Whether to include debugging information in the compiled class files; the default value is false"
* @todo change debug parameter type to Boolean * @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 public class CompilerMojo
@ -95,6 +97,18 @@ public class CompilerMojo
compilerConfiguration.setOutputLocation( outputDirectory ); compilerConfiguration.setOutputLocation( outputDirectory );
compilerConfiguration.setClasspathEntries( classpathElements ); compilerConfiguration.setClasspathEntries( classpathElements );
compilerConfiguration.setSourceLocations( compileSourceRoots ); 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 */ /* Compile with debugging info */
String debugAsString = (String) request.getParameter( "debug" ); String debugAsString = (String) request.getParameter( "debug" );