installtoolkit
Class InstallerGeneratorTask

java.lang.Object
  extended by Task
      extended by installtoolkit.InstallerGeneratorTask
Direct Known Subclasses:
DebianPackageTask, WindowsInstallerTask

public abstract class InstallerGeneratorTask
extends Task

Base class for installer-builder tasks.
This class holds common functions for all install-builder tasks and handles the reading of the descriptorfile.

Author:
Christian Elberfeld

Field Summary
protected  boolean debug
           
protected  java.io.File descriptor
           
static java.lang.String DESCRIPTOR_NAMESPACE
          The XML Namespace of the desriptor file
protected  java.io.File destdir
           
protected  java.lang.String email
           
protected  java.util.List<java.lang.String> license
           
protected  java.util.List<java.lang.String> longDescription
           
protected  java.lang.String manufacturer
           
protected  java.lang.String packageName
           
protected  java.io.File schema
           
protected  java.lang.String shortDescription
           
protected  boolean validate
           
protected  java.lang.String version
           
protected  java.io.File workdir
           
 
Constructor Summary
InstallerGeneratorTask()
           
 
Method Summary
protected abstract  void build()
          The build() method must be overridden by the concrete install-builder classes.
protected  void copy(java.io.File src, java.io.File dst)
          Copy a file
protected  FileSet createFilesetFromPatterns(java.util.List<Pattern> patterns, java.io.File dir)
          Create an Ant FileSet from a list of patterns
 void execute()
          The execute method reads the descriptor file and executes the logic of the concrete class by calling the build() method.
protected  void readDebTag(Element root)
          This method should be overridden if the task needs informations from the <Deb> element of the descriptor file.
protected  java.util.List<Pattern> readPatterns(Element root)
          Read patterns from the descriptor file
protected  void readWindowsTag(Element root)
          This method should be overridden if the task needs informations from the <Win> element of the descriptor file.
 void setDebug(boolean debug)
          Enable debug output
 void setDescriptor(java.io.File descriptor)
          The descriptor file to read
 void setDestdir(java.io.File destdir)
          The directory where the installer packge will be created
 void setSchema(java.io.File schema)
          The XML Schema for the descriptor file
 void setValidate(boolean validate)
          If false, the descriptor file will not be validated
 void setVersion(java.lang.String version)
          The version number of the generatd installer package
 void setWorkdir(java.io.File workdir)
          The directory to compile the installer package
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTOR_NAMESPACE

public static final java.lang.String DESCRIPTOR_NAMESPACE
The XML Namespace of the desriptor file

See Also:
Constant Field Values

debug

protected boolean debug

version

protected java.lang.String version

descriptor

protected java.io.File descriptor

destdir

protected java.io.File destdir

workdir

protected java.io.File workdir

validate

protected boolean validate

schema

protected java.io.File schema

packageName

protected java.lang.String packageName

manufacturer

protected java.lang.String manufacturer

email

protected java.lang.String email

shortDescription

protected java.lang.String shortDescription

longDescription

protected java.util.List<java.lang.String> longDescription

license

protected java.util.List<java.lang.String> license
Constructor Detail

InstallerGeneratorTask

public InstallerGeneratorTask()
Method Detail

execute

public void execute()
             throws BuildException
The execute method reads the descriptor file and executes the logic of the concrete class by calling the build() method.

Throws:
BuildException
See Also:
Task#execute()

build

protected abstract void build()
                       throws java.lang.Exception
The build() method must be overridden by the concrete install-builder classes.

Throws:
java.lang.Exception

readWindowsTag

protected void readWindowsTag(Element root)
This method should be overridden if the task needs informations from the <Win> element of the descriptor file.

Parameters:
root -

readDebTag

protected void readDebTag(Element root)
This method should be overridden if the task needs informations from the <Deb> element of the descriptor file.

Parameters:
root -

readPatterns

protected java.util.List<Pattern> readPatterns(Element root)
Read patterns from the descriptor file

Parameters:
root - The element containig <Include> and <Exclude> Elements as childs

createFilesetFromPatterns

protected FileSet createFilesetFromPatterns(java.util.List<Pattern> patterns,
                                            java.io.File dir)
Create an Ant FileSet from a list of patterns

Parameters:
patterns - List of Patterns
dir - The basedirectory for the fileset
Returns:

copy

protected void copy(java.io.File src,
                    java.io.File dst)
Copy a file

Parameters:
src - Source file
dst - Destination file

setDebug

public void setDebug(boolean debug)
Enable debug output

Parameters:
debug -

setDescriptor

public void setDescriptor(java.io.File descriptor)
The descriptor file to read

Parameters:
descriptor -

setVersion

public void setVersion(java.lang.String version)
The version number of the generatd installer package

Parameters:
version -

setSchema

public void setSchema(java.io.File schema)
The XML Schema for the descriptor file

Parameters:
schema -

setValidate

public void setValidate(boolean validate)
If false, the descriptor file will not be validated

Parameters:
validate -

setDestdir

public void setDestdir(java.io.File destdir)
The directory where the installer packge will be created

Parameters:
destdir -

setWorkdir

public void setWorkdir(java.io.File workdir)
The directory to compile the installer package

Parameters:
workdir -


Copyright 2006-2006 null. All Rights Reserved.