mirror of https://github.com/apache/maven.git
use primitive types
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@177873 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eeb42ca316
commit
6a630346a2
|
@ -38,16 +38,13 @@ public abstract class AbstractCompilerMojo
|
||||||
|
|
||||||
private Compiler compiler = new JavacCompiler();
|
private Compiler compiler = new JavacCompiler();
|
||||||
|
|
||||||
// TODO: use boolean when supported
|
|
||||||
/**
|
/**
|
||||||
* Whether to include debugging information in the compiled class files.
|
* Whether to include debugging information in the compiled class files.
|
||||||
* <br/>
|
|
||||||
* <br/>
|
|
||||||
* The default value is true.
|
* The default value is true.
|
||||||
*
|
*
|
||||||
* @parameter expression="${maven.compiler.debug}"
|
* @parameter expression="${maven.compiler.debug}"
|
||||||
*/
|
*/
|
||||||
private String debug = Boolean.TRUE.toString();
|
private boolean debug = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The -source argument for the Java compiler
|
* The -source argument for the Java compiler
|
||||||
|
@ -63,14 +60,13 @@ public abstract class AbstractCompilerMojo
|
||||||
*/
|
*/
|
||||||
private String target;
|
private String target;
|
||||||
|
|
||||||
// TODO: Use long when supported
|
|
||||||
/**
|
/**
|
||||||
* The granularity in milliseconds of the last modification
|
* The granularity in milliseconds of the last modification
|
||||||
* date for testing whether a source needs recompilation
|
* date for testing whether a source needs recompilation
|
||||||
*
|
*
|
||||||
* @parameter alias="${lastModGranularityMs}"
|
* @parameter alias="${lastModGranularityMs}"
|
||||||
*/
|
*/
|
||||||
private String staleMillis = "0";
|
private int staleMillis = 0;
|
||||||
|
|
||||||
protected abstract List getClasspathElements();
|
protected abstract List getClasspathElements();
|
||||||
|
|
||||||
|
@ -121,10 +117,7 @@ public abstract class AbstractCompilerMojo
|
||||||
compilerConfiguration.addCompilerOption( "-target", target );
|
compilerConfiguration.addCompilerOption( "-target", target );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( debug != null && Boolean.valueOf( debug ).booleanValue() )
|
compilerConfiguration.setDebug( debug );
|
||||||
{
|
|
||||||
compilerConfiguration.setDebug( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
List messages = null;
|
List messages = null;
|
||||||
try
|
try
|
||||||
|
@ -158,24 +151,9 @@ public abstract class AbstractCompilerMojo
|
||||||
private Set computeStaleSources()
|
private Set computeStaleSources()
|
||||||
throws MojoExecutionException
|
throws MojoExecutionException
|
||||||
{
|
{
|
||||||
long staleTime = 0;
|
|
||||||
|
|
||||||
if ( staleMillis != null && staleMillis.length() > 0 )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
staleTime = Long.parseLong( staleMillis );
|
|
||||||
}
|
|
||||||
catch ( NumberFormatException e )
|
|
||||||
{
|
|
||||||
throw new MojoExecutionException( "Invalid staleMillis plugin parameter value: \'" + staleMillis
|
|
||||||
+ "\'", e );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
SuffixMapping mapping = new SuffixMapping( ".java", ".class" );
|
SuffixMapping mapping = new SuffixMapping( ".java", ".class" );
|
||||||
|
|
||||||
SourceInclusionScanner scanner = new StaleSourceScanner( staleTime );
|
SourceInclusionScanner scanner = new StaleSourceScanner( staleMillis );
|
||||||
|
|
||||||
scanner.addSourceMapping( mapping );
|
scanner.addSourceMapping( mapping );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue