com.izforge.izpack.ant
Class IzPackTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bycom.izforge.izpack.ant.IzPackTask
All Implemented Interfaces:
PackagerListener

public class IzPackTask
extends org.apache.tools.ant.Task
implements PackagerListener

A IzPack Ant task.

Author:
Paul Wilkinson

Nested Class Summary
static class IzPackTask.InstallerType
          Enumerated attribute with the values "asis", "add" and "remove".
 
Field Summary
private  java.lang.String basedir
          Holds value of property basedir.
private  java.lang.String compression
          Holds value of property compression.
private  int compressionLevel
          Holds value of property compression.
private  ConfigHolder config
          The embedded installation configuration
private  boolean inheritAll
          should we inherit properties from the Ant file?
private  java.lang.String input
          Holds value of property input.
private  IzPackTask.InstallerType installerType
          Holds value of property installerType.
private  java.lang.String izPackDir
          Holds value of property izPackDir.
private  java.lang.String output
          Holds value of property output.
private  java.util.Properties properties
          Holds properties used to make substitutions in the install file
 
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
 
Fields inherited from interface com.izforge.izpack.compiler.PackagerListener
MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN
 
Constructor Summary
IzPackTask()
          Creates new IZPackTask
 
Method Summary
 void addConfiguredProperty(Property property)
          Ant will call this for each <property> tag to the IzPack task.
 void addConfiguredPropertyset(org.apache.tools.ant.types.PropertySet ps)
          A set of properties to pass from the build environment to the install compile
 ConfigHolder createConfig()
          Called by ant to create the object for the config nested element.
 void execute()
          Packages.
 void packagerMsg(java.lang.String str)
          Logs a message to the Ant log at default priority (MSG_INFO).
 void packagerMsg(java.lang.String str, int priority)
          Logs a message to the Ant log at the specified priority.
 void packagerStart()
          Called when the packaging starts.
 void packagerStop()
          Called when the packaging stops.
 void setBasedir(java.lang.String basedir)
          Setter for property basedir.
 void setCompression(java.lang.String compression)
          Setter for property compression.
 void setCompressionLevel(int compressionLevel)
           
 void setInheritAll(boolean value)
          If true, pass all Ant properties to IzPack.
 void setInput(java.lang.String input)
          Setter for property input.
 void setInstallerType(IzPackTask.InstallerType installerType)
          Setter for property installerType.
 void setIzPackDir(java.lang.String izPackDir)
          Setter for property izPackDir.
 void setOutput(java.lang.String output)
          Setter for property output.
 
Methods inherited from class org.apache.tools.ant.Task
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, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

private ConfigHolder config
The embedded installation configuration


input

private java.lang.String input
Holds value of property input.


basedir

private java.lang.String basedir
Holds value of property basedir.


output

private java.lang.String output
Holds value of property output.


compression

private java.lang.String compression
Holds value of property compression.


compressionLevel

private int compressionLevel
Holds value of property compression.


installerType

private IzPackTask.InstallerType installerType
Holds value of property installerType.


izPackDir

private java.lang.String izPackDir
Holds value of property izPackDir. This should point at the IzPack directory


properties

private java.util.Properties properties
Holds properties used to make substitutions in the install file


inheritAll

private boolean inheritAll
should we inherit properties from the Ant file?

Constructor Detail

IzPackTask

public IzPackTask()
Creates new IZPackTask

Method Detail

createConfig

public ConfigHolder createConfig()
Called by ant to create the object for the config nested element.

Returns:
a holder object for the config nested element.

packagerMsg

public void packagerMsg(java.lang.String str)
Logs a message to the Ant log at default priority (MSG_INFO).

Specified by:
packagerMsg in interface PackagerListener
Parameters:
str - The message to log.

packagerMsg

public void packagerMsg(java.lang.String str,
                        int priority)
Logs a message to the Ant log at the specified priority.

Specified by:
packagerMsg in interface PackagerListener
Parameters:
str - The message to log.
priority - The priority of the message.

packagerStart

public void packagerStart()
Called when the packaging starts.

Specified by:
packagerStart in interface PackagerListener

packagerStop

public void packagerStop()
Called when the packaging stops.

Specified by:
packagerStop in interface PackagerListener

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Packages.

Throws:
org.apache.tools.ant.BuildException - Description of the Exception

setInput

public void setInput(java.lang.String input)
Setter for property input.

Parameters:
input - New value of property input.

setBasedir

public void setBasedir(java.lang.String basedir)
Setter for property basedir.

Parameters:
basedir - New value of property basedir.

setOutput

public void setOutput(java.lang.String output)
Setter for property output.

Parameters:
output - New value of property output.

setInstallerType

public void setInstallerType(IzPackTask.InstallerType installerType)
Setter for property installerType.

Parameters:
installerType - New value of property installerType.

setIzPackDir

public void setIzPackDir(java.lang.String izPackDir)
Setter for property izPackDir.

Parameters:
izPackDir - New value of property izPackDir.

setInheritAll

public void setInheritAll(boolean value)
If true, pass all Ant properties to IzPack. Defaults to false;


setCompression

public void setCompression(java.lang.String compression)
Setter for property compression.

Parameters:
compression - The type compression to set for pack compression.

setCompressionLevel

public void setCompressionLevel(int compressionLevel)
Parameters:
compressionLevel - The compressionLevel to set.

addConfiguredProperty

public void addConfiguredProperty(Property property)
Ant will call this for each <property> tag to the IzPack task.


addConfiguredPropertyset

public void addConfiguredPropertyset(org.apache.tools.ant.types.PropertySet ps)
A set of properties to pass from the build environment to the install compile

Parameters:
ps - The propertyset collection of properties