Added maven.compiler.debug parameter

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163300 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Carlos Sanchez Gonzalez 2005-01-09 00:21:12 +00:00
parent e69b95ccef
commit 380b263ad0
1 changed files with 16 additions and 1 deletions

View File

@ -41,10 +41,19 @@ import java.util.List;
* expression="#project.classpathElements"
* description=""
*
* @parameter
* name="debug"
* type="String"
* required="false"
* validator=""
* expression="#maven.compiler.debug"
* description="Whether to include debugging information in the compiled class files; the default value is false"
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
* @todo use compile source roots and not the pom.build.sourceDirectory so that any
* sort of preprocessing and/or source generation can be taken into consideration.
* @todo change debug parameter type to Boolean
*/
public class CompilerMojo
@ -83,7 +92,13 @@ public class CompilerMojo
compilerConfiguration.setSourceLocations(Arrays.asList(new String[] {sourceDirectory}));
/* Compile with debugging info */
compilerConfiguration.addCompilerOption("-g", null);
String debugAsString = (String) request.getParameter( "debug" );
if (debugAsString != null)
{
if (Boolean.valueOf(debugAsString).booleanValue())
compilerConfiguration.addCompilerOption("-g", null);
}
List messages = compiler.compile(compilerConfiguration);