org.apache.ant.dotnet.build
Class AbstractBuildTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.ant.dotnet.build.AbstractBuildTask
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
MSBuildTask, NAntTask

public abstract class AbstractBuildTask
extends org.apache.tools.ant.Task

Base class for NAntTask and MSBuildTask.


Nested Class Summary
static class AbstractBuildTask.Property
          A property.
static class AbstractBuildTask.Target
          A target.
 
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
protected AbstractBuildTask()
          Empty constructor.
 
Method Summary
 void addBuild(org.apache.tools.ant.util.XMLFragment f)
          Adds a build file fragment.
 void addProperty(AbstractBuildTask.Property t)
          A target to execute.
 void addTarget(AbstractBuildTask.Target t)
          A target to execute.
 void execute()
          Perform the build.
protected abstract  java.lang.String[] getBuildfileArguments(java.io.File buildFile)
          Must return buildfile argument(s).
protected abstract  java.lang.String getExecutable()
          Must return the executable.
protected abstract  java.lang.String[] getPropertyArguments(java.util.List properties)
          Must return property argument(s).
protected abstract  java.lang.String[] getTargetArguments(java.util.List targets)
          Must return target argument(s).
protected abstract  org.w3c.dom.Element makeTree(org.w3c.dom.DocumentFragment f)
          Turn the DoucmentFragment into a DOM tree suitable as a build file when serialized.
 void setBuildfile(java.io.File f)
          Sets the name of the build file.
 void setErrorProperty(java.lang.String name)
          Name of property to set if a build fails.
 void setFailOnError(boolean b)
          Whether a failure should stop the build.
 void setVm(java.lang.String value)
          Set the name of the executable for the virtual machine.
 
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, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBuildTask

protected AbstractBuildTask()
Empty constructor.

Method Detail

setBuildfile

public final void setBuildfile(java.io.File f)
Sets the name of the build file.


addBuild

public void addBuild(org.apache.tools.ant.util.XMLFragment f)
Adds a build file fragment.


setVm

public void setVm(java.lang.String value)
Set the name of the executable for the virtual machine.

Parameters:
value - the name of the executable for the virtual machine

addTarget

public final void addTarget(AbstractBuildTask.Target t)
A target to execute.


addProperty

public final void addProperty(AbstractBuildTask.Property t)
A target to execute.


setFailOnError

public void setFailOnError(boolean b)
Whether a failure should stop the build.

Since:
1.0 Beta 2

setErrorProperty

public void setErrorProperty(java.lang.String name)
Name of property to set if a build fails.

Since:
1.0 Beta 2

getExecutable

protected abstract java.lang.String getExecutable()
Must return the executable.

Returns:
must not return null

getBuildfileArguments

protected abstract java.lang.String[] getBuildfileArguments(java.io.File buildFile)
Must return buildfile argument(s).

Parameters:
buildFile - the absolute File for the buildfile or null if the user didn't specify a buildfile.
Returns:
must not return null

getTargetArguments

protected abstract java.lang.String[] getTargetArguments(java.util.List targets)
Must return target argument(s).

Returns:
must not return null

getPropertyArguments

protected abstract java.lang.String[] getPropertyArguments(java.util.List properties)
Must return property argument(s).

Returns:
must not return null

makeTree

protected abstract org.w3c.dom.Element makeTree(org.w3c.dom.DocumentFragment f)
Turn the DoucmentFragment into a DOM tree suitable as a build file when serialized.

Must throw a BuildException if the snippet can not be turned into a build file.


execute

public void execute()
Perform the build.

Overrides:
execute in class org.apache.tools.ant.Task