org.schmant.task.jdk.javac.ext
Class ExtJavacTask

java.lang.Object
  extended by org.schmant.support.AbstractArgumentChecker
      extended by org.schmant.task.stub.AbstractTask<T>
          extended by org.schmant.task.stub.AbstractActionTask<T>
              extended by org.schmant.task.stub.AbstractProcessTask<T>
                  extended by org.schmant.task.template.jdk.javac.AbstractJavacTask<ExtJavacTask>
                      extended by org.schmant.task.jdk.javac.ext.ExtJavacTask
All Implemented Interfaces:
TaskDependency, ActionTaskConfigurable<ExtJavacTask>, ActionTaskSpec<ExtJavacTask>, LoggingConfigurable<ExtJavacTask>, OverwriteConfigurable<ExtJavacTask>, SourceConfigurable<ExtJavacTask>, SourceConfigured, TargetConfigurable<ExtJavacTask>, TargetConfigured, GeneratorTaskConfigurable<ExtJavacTask>, GeneratorTaskSpec<ExtJavacTask>, ProcessTaskConfigurable<ExtJavacTask>, ProcessTaskSpec<ExtJavacTask>, Task, TaskRunnable, TaskSpecification<ExtJavacTask>, ExtProcessConfigured, ExtProcessTask<ExtJavacTask>

public final class ExtJavacTask
extends AbstractJavacTask<ExtJavacTask>
implements ExtProcessTask<ExtJavacTask>, ExtProcessConfigured

See ExtJavacTF

Since:
0.5
Author:
Karl Gustafsson
Task_package:
org.schmant.task.base

Field Summary
 
Fields inherited from interface org.schmant.task.confable.OverwriteConfigurable
DEFAULT_OVERWRITE_STRATEGY
 
Method Summary
 void copyProperties(ExtJavacTask spec)
          Override the implementation from AbstractTask to copy the source properties.
protected  String getDefaultLogHeader()
          Get the default log header to log (to level INFO) before the task is run if the task user has not set a custom header.
 List<String> getEnvironmentVariables()
           
 ProcessResult getProcessResult()
          Get the result from the external program.
 ProcessOutputStrategy getStderrStrategy()
           
 ProcessOutputStrategy getStdoutStrategy()
           
 File getWorkingDirectory()
           
protected  boolean hasSources()
          This is implemented by subclasses to return true if any source file property is set.
 boolean isFailOnErrors()
           
 boolean isInheritEnvironmentVariables()
           
protected  boolean isMoreThanOneSourceAllowed()
          Is more than one source object allowed? This method returns false .
protected  void runJavac(Report r)
          This is implemented by subclasses.
 String toString()
          Default implementation for tasks.
 
Methods inherited from class org.schmant.task.template.jdk.javac.AbstractJavacTask
getAnnotationProcessingMode, getAnnotationProcessorOptions, getAnnotationProcessorPath, getAnnotationProcessors, getArguments, getClasspathDecorators, getClasspathEntries, getClasspathEntriesFromDecorators, getDebugOptions, getEncoding, getImplicitClassFileGeneration, getOptionsInternal, getSourceCodeVersion, getSourceFilesDir, getTargetVersion, isDeprecation, isNowarn, isSourcesMandatory, runInternal, validate
 
Methods inherited from class org.schmant.task.stub.AbstractProcessTask
getOverwriteStrategy, getTarget, isTargetMandatory, setOverwrite, setOverwriteStrategy, setTarget
 
Methods inherited from class org.schmant.task.stub.AbstractActionTask
addSource, addSources, clearSources, getRelativeToBase, getSource, getSources, setRelativeToBase, setSource, setSources
 
Methods inherited from class org.schmant.task.stub.AbstractTask
cancel, createTask, getDefaultLogFooter, getDependencyForTasksScheduledByThisTask, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, setLogFooter, setLogHeader, setReportLevel, setTraceLogging
 
Methods inherited from class org.schmant.support.AbstractArgumentChecker
check, check, check, check
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.schmant.task.Task
cancel, getDependencyForTasksScheduledByThisTask, getFailureCause, isCancelled, isDone, isInterrupted, isRunning, isSuccessful
 
Methods inherited from interface org.schmant.run.TaskDependency
getDependencyObservable, getSatisfiedStateLock, isSatisfied
 
Methods inherited from interface org.schmant.task.TaskRunnable
run
 
Methods inherited from interface org.schmant.task.confable.SourceConfigurable
addSource, addSources, clearSources, setRelativeToBase, setSource, setSources
 
Methods inherited from interface org.schmant.task.confable.SourceConfigured
getSource, getSources
 
Methods inherited from interface org.schmant.task.TaskSpecification
createTask
 
Methods inherited from interface org.schmant.task.confable.LoggingConfigurable
setLogFooter, setLogHeader, setReportLevel, setTraceLogging
 

Method Detail

isFailOnErrors

public boolean isFailOnErrors()
Specified by:
isFailOnErrors in interface ExtProcessConfigured

getWorkingDirectory

public File getWorkingDirectory()
Specified by:
getWorkingDirectory in interface ExtProcessConfigured

isInheritEnvironmentVariables

public boolean isInheritEnvironmentVariables()
Specified by:
isInheritEnvironmentVariables in interface ExtProcessConfigured

getEnvironmentVariables

public List<String> getEnvironmentVariables()
Specified by:
getEnvironmentVariables in interface ExtProcessConfigured

getStdoutStrategy

public ProcessOutputStrategy getStdoutStrategy()
Specified by:
getStdoutStrategy in interface ExtProcessConfigured

getStderrStrategy

public ProcessOutputStrategy getStderrStrategy()
Specified by:
getStderrStrategy in interface ExtProcessConfigured

isMoreThanOneSourceAllowed

protected boolean isMoreThanOneSourceAllowed()
Description copied from class: AbstractActionTask
Is more than one source object allowed? This method returns false . Subclasses override this method to return true if they allow several sources.

This method will only be called if AbstractActionTask.isSourcesMandatory() returns true.

Overrides:
isMoreThanOneSourceAllowed in class AbstractActionTask<ExtJavacTask>
Returns:
false, always

getProcessResult

public ProcessResult getProcessResult()
Description copied from interface: ExtProcessTask
Get the result from the external program.

Specified by:
getProcessResult in interface ExtProcessTask<ExtJavacTask>
Returns:
The program result.

getDefaultLogHeader

protected String getDefaultLogHeader()
Description copied from class: AbstractTask
Get the default log header to log (to level INFO) before the task is run if the task user has not set a custom header. Subclasses may override this to return better headers.

This is called after validating the task.

Return null to disable logging.

Overrides:
getDefaultLogHeader in class AbstractTask<ExtJavacTask>
Returns:
"Running " + toString()

hasSources

protected boolean hasSources()
Description copied from class: AbstractJavacTask
This is implemented by subclasses to return true if any source file property is set.

Specified by:
hasSources in class AbstractJavacTask<ExtJavacTask>

runJavac

protected void runJavac(Report r)
                 throws InterruptedException
Description copied from class: AbstractJavacTask
This is implemented by subclasses. It is executed when the task is run.

Specified by:
runJavac in class AbstractJavacTask<ExtJavacTask>
Throws:
InterruptedException

copyProperties

public void copyProperties(ExtJavacTask spec)
Description copied from class: AbstractActionTask
Override the implementation from AbstractTask to copy the source properties. Subclasses must override this to copy their own properties.

Specified by:
copyProperties in interface TaskSpecification<ExtJavacTask>
Overrides:
copyProperties in class AbstractJavacTask<ExtJavacTask>
Parameters:
spec - The specification to copy properties to.

toString

public String toString()
Description copied from class: AbstractTask
Default implementation for tasks. Task implementations may override this. It is used in the default log header that is written (level INFO) before a task is run.

This implementation just returns the class name.

Overrides:
toString in class AbstractProcessTask<ExtJavacTask>