net.dpml.tools.tasks
Class PartTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.dpml.tools.tasks.GenericTask
              extended by net.dpml.tools.tasks.PartTask
Direct Known Subclasses:
ComponentBuilderTask

public class PartTask
extends GenericTask

Creation of an part definition in XML.

Version:
1.2.0
Author:
Digital Product Meta Library

Field Summary
static String PLUGIN_DESCRIPTION_KEY
          Property key used to identify the plugin description.
static String PLUGIN_HANDLER_KEY
          Property key used to identify a custom plugin handler classname.
static String PLUGIN_TITLE_KEY
          Property key used to identify the plugin title.
static String TYPE
          Constant artifact type for a plugin.
 
Fields inherited from class net.dpml.tools.tasks.GenericTask
ASC_EXT, GPG_EXE_KEY, MD5_EXT
 
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
PartTask()
           
 
Method Summary
protected  Part build(Resource resource)
          Build the part definition.
 void execute()
          Task execution.
protected  Classpath getClasspath(Resource resource)
          Construct the classpath for the supplied resource.
protected  Context getContext(Project project)
          Get the project definition.
protected  Info getInfo(Resource resource)
          Construct the info object based on properties declared by the supplied resource.
 void setDest(File file)
          Override the default output destination.
 void setTest(boolean test)
          Set the test build policy.
 void writePart(Part part)
          Externalize the part as a deliverable.
 
Methods inherited from class net.dpml.tools.tasks.GenericTask
asc, checksum, copy, deleteDir, getContext, getLibrary, getResource, init, isInitialized, mkDir
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
Constant artifact type for a plugin.

See Also:
Constant Field Values

PLUGIN_TITLE_KEY

public static final String PLUGIN_TITLE_KEY
Property key used to identify the plugin title.

See Also:
Constant Field Values

PLUGIN_DESCRIPTION_KEY

public static final String PLUGIN_DESCRIPTION_KEY
Property key used to identify the plugin description.

See Also:
Constant Field Values

PLUGIN_HANDLER_KEY

public static final String PLUGIN_HANDLER_KEY
Property key used to identify a custom plugin handler classname.

See Also:
Constant Field Values
Constructor Detail

PartTask

public PartTask()
Method Detail

setTest

public void setTest(boolean test)
Set the test build policy. The default is to include the project artifact in the classpath of a created part, however - in a test scenario we don't want to do this. Setting test to true will result in the association of a local file uri to the project resource.

Parameters:
test - true if this is a local test part

setDest

public void setDest(File file)
Override the default output destination.

Parameters:
file - the overriding destination

execute

public void execute()
Task execution.

Overrides:
execute in class Task

writePart

public void writePart(Part part)
Externalize the part as a deliverable.

Parameters:
part - the part to be externalized as XML

build

protected Part build(Resource resource)
Build the part definition.

Parameters:
resource - the resource
Returns:
the part

getInfo

protected Info getInfo(Resource resource)
Construct the info object based on properties declared by the supplied resource.

Parameters:
resource - the resource
Returns:
the info descriptor

getClasspath

protected Classpath getClasspath(Resource resource)
                          throws IOException
Construct the classpath for the supplied resource.

Parameters:
resource - the resource
Returns:
the classpath
Throws:
IOException - is an IO error occurs

getContext

protected Context getContext(Project project)
Get the project definition.

Parameters:
project - the project
Returns:
the build context