|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Sequential
com.codemesh.terp.ant.TerpSequential
com.codemesh.terp.ant.compiler.cpp.DynamicSourcesOption
public class DynamicSourcesOption
An option that acts as a task container for echo commands that dynamically create source files.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware |
|---|
TerpAware.Delegate |
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
DynamicSourcesOption()
|
|
| Method Summary | |
|---|---|
void |
addCommands(java.util.List<java.lang.String> commandList,
CppCompiler compiler,
CompilerPhase phase)
Adds the compiler switches repreesnted by this option to the list of switches. |
boolean |
appliesTo(CppCompiler compiler,
CompilerPhase phase)
Returns true if this compiler option applies to the given compiler and compiler phase. |
TerpEcho |
createCreate()
Adds a TerpEcho task to this task. |
java.util.List<java.lang.String> |
creates(CppCompiler compiler,
CompilerPhase phase)
Returns a list of filenames representing the files that are created due to the presence of this compiler option. |
void |
execute()
Generates the files represented by the nested <create> elements, if and only if all task conditions are met. |
java.util.List<TerpEcho> |
getCreates()
Returns all nested TerpEcho tasks. |
java.lang.String |
getIf()
Returns the condition that must be satidifed to execute the implementing task. |
java.lang.String |
getOptions()
Returns an optional identifier of an external compiler options instance. |
java.lang.String |
getUnless()
Returns the condition that must not be satidifed to execute the implementing task. |
protected java.io.File |
safeGetFile(CppCompiler compiler,
TerpEcho echo)
|
boolean |
satisfies(TerpContext ctx)
Returns true if both conditions are met within the given terp context. |
void |
setIf(java.lang.String condition)
Sets a condition that must be satisfied to execute the implementing task. |
void |
setOptions(java.lang.String options)
Sets the optional identifier of an external compiler options instance to be applied to the sources represented by this element. |
void |
setPhase(java.lang.String phase)
Sets the compilation phase in which the sources are dynamically generated. |
void |
setProject(org.apache.tools.ant.Project p)
|
void |
setUnless(java.lang.String condition)
Sets a condition that must not be satisfied to execute the implementing task. |
| Methods inherited from class com.codemesh.terp.ant.TerpSequential |
|---|
getContext, satisfiesConditions, setContext |
| Methods inherited from class org.apache.tools.ant.taskdefs.Sequential |
|---|
addTask |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DynamicSourcesOption()
| Method Detail |
|---|
public void setProject(org.apache.tools.ant.Project p)
setProject in class TerpSequentialpublic void setPhase(java.lang.String phase)
phase - the compilation phase, one of "precomp", "comp", "link", or "postlink".public java.lang.String getOptions()
public void setOptions(java.lang.String options)
options - an identifier of a compiler options set.
public void addCommands(java.util.List<java.lang.String> commandList,
CppCompiler compiler,
CompilerPhase phase)
This method is called by the compiler repeatedly with different values for the compiler phase to account for these possibilities. Does not perform any action unless an external options identifier is set and it is the compilation phase.
addCommands in interface CompilerOption<CppCompiler>commandList - the list to which the compiler switches represented
by this option (if any) are added.compiler - the compiler for which we're doing this.phase - the compiler phase in wihch we're doing this.
public boolean appliesTo(CppCompiler compiler,
CompilerPhase phase)
appliesTo in interface CompilerOption<CppCompiler>compiler - the compiler for which we're asking.phase - the compiler phase we're executing.
public TerpEcho createCreate()
TerpEcho task to this task.
The nested tasks will be executed sequentially if all conditions
for task execution are met.
TerpEcho task.public java.util.List<TerpEcho> getCreates()
TerpEcho tasks.
public java.lang.String getIf()
getIf in interface CompilerOption<CppCompiler>getIf in interface TerpAwaregetIf in class TerpSequentialpublic void setIf(java.lang.String condition)
setIf in interface CompilerOption<CppCompiler>setIf in interface TerpAwaresetIf in class TerpSequentialcondition - a terp expression that must evaluate to a boolean value.public java.lang.String getUnless()
getUnless in interface CompilerOption<CppCompiler>getUnless in interface TerpAwaregetUnless in class TerpSequentialpublic void setUnless(java.lang.String condition)
setUnless in interface CompilerOption<CppCompiler>setUnless in interface TerpAwaresetUnless in class TerpSequentialcondition - a terp expression that must evaluate to a boolean value.public boolean satisfies(TerpContext ctx)
satisfies in interface CompilerOption<CppCompiler>ctx - the terp context in which the logical expressions are evaluated.
public java.util.List<java.lang.String> creates(CppCompiler compiler,
CompilerPhase phase)
TerpEcho
tasks specify target filenames, which they are not strictly required to do. If
a nested <create> element does not specify a target filename, a
random filename is generated. This filename will be different every time this
method is invoked.
creates in interface FileCreating<CppCompiler>compiler - the compiler.phase - the compilation phase.
protected java.io.File safeGetFile(CppCompiler compiler,
TerpEcho echo)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class TerpSequentialorg.apache.tools.ant.BuildException
|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||