org.apache.tools.ant.taskdefs

Class Exec


public class Exec
extends Task

Executes a given command if the os platform is appropriate.

As of Ant 1.2, this class is no longer the implementation of Ant's <exec> task - it is considered to be dead code by the Ant developers and is unmaintained. Don't use it.

Field Summary

protected PrintWriter
fos

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Constructor Summary

Exec()
Sole constructor.

Method Summary

void
execute()
Called by the project to let the task do its work.
protected void
logFlush()
protected void
outputLog(String line, int messageLevel)
protected int
run(String command)
void
setCommand(String command)
void
setDir(String d)
void
setFailonerror(boolean fail)
void
setOs(String os)
void
setOutput(String out)

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Field Details

fos

protected PrintWriter fos

Constructor Details

Exec

public Exec()
Sole constructor.

Method Details

execute

public void execute()
            throws BuildException
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
Overrides:
execute in interface Task
Throws:
BuildException - if something goes wrong with the build

logFlush

protected void logFlush()

outputLog

protected void outputLog(String line,
                         int messageLevel)

run

protected int run(String command)
            throws BuildException

setCommand

public void setCommand(String command)

setDir

public void setDir(String d)

setFailonerror

public void setFailonerror(boolean fail)

setOs

public void setOs(String os)

setOutput

public void setOutput(String out)

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.