org.dbmaintain.launch.ant
Class CreateScriptArchiveAntTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.dbmaintain.launch.ant.BaseAntTask
              extended by org.dbmaintain.launch.ant.CreateScriptArchiveAntTask

public class CreateScriptArchiveAntTask
extends BaseAntTask

Task that enables creating a jar file that packages all database update scripts. This jar can then be used as input for the updateDatabase task to apply changes on a target database. This way, database updates can be distributed as a deliverable, just like a war or ear file.

The created jar file will contain all configuration concerning the scripts in the META-INF folder.

Author:
Filip Neven, Tim Ducheyne, Alexander Snaps

Field Summary
 
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
CreateScriptArchiveAntTask()
           
 
Method Summary
protected  DbMaintainTask createDbMaintainTask()
           
 void setArchiveFileName(String archiveFileName)
          Defines the target name for the generated script archive.
 void setPatchQualifiers(String patchQualifiers)
          The qualifiers to use to determine whether a script is a patch script.
 void setPostProcessingScriptDirectoryName(String postProcessingScriptDirectoryName)
          Comma separated list of directories and files in which the post processing database scripts are located.
 void setQualifiers(String qualifiers)
          Optional comma-separated list of script qualifiers.
 void setScriptEncoding(String scriptEncoding)
          Encoding to use when reading the script files.
 void setScriptFileExtensions(String scriptFileExtensions)
          Sets the scriptFileExtensions property, that defines the extensions of the files that are regarded to be database scripts.
 void setScriptLocations(String scriptLocations)
          Defines where the scripts can be found that must be added to the jar file.
 
Methods inherited from class org.dbmaintain.launch.ant.BaseAntTask
execute, getAntProperties, getCustomConfigFile, setConfigFile
 
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
 

Constructor Detail

CreateScriptArchiveAntTask

public CreateScriptArchiveAntTask()
Method Detail

createDbMaintainTask

protected DbMaintainTask createDbMaintainTask()
Specified by:
createDbMaintainTask in class BaseAntTask

setArchiveFileName

public void setArchiveFileName(String archiveFileName)
Defines the target name for the generated script archive. This property is required

Parameters:
archiveFileName - The name for the archive, not null

setScriptLocations

public void setScriptLocations(String scriptLocations)
Defines where the scripts can be found that must be added to the jar file. Multiple locations may be configured, separated by comma's. Only folder names can be provided. This property is required.

Parameters:
scriptLocations - Comma separated list of script locations

setScriptEncoding

public void setScriptEncoding(String scriptEncoding)
Encoding to use when reading the script files. Defaults to ISO-8859-1

Parameters:
scriptEncoding - The encoding

setPostProcessingScriptDirectoryName

public void setPostProcessingScriptDirectoryName(String postProcessingScriptDirectoryName)
Comma separated list of directories and files in which the post processing database scripts are located. Directories in this list are recursively search for files. Defaults to postprocessing

Parameters:
postProcessingScriptDirectoryName - The directory names

setQualifiers

public void setQualifiers(String qualifiers)
Optional comma-separated list of script qualifiers. All custom qualifiers that are used in script file names must be declared.

Parameters:
qualifiers - the registered (allowed) script qualifiers

setPatchQualifiers

public void setPatchQualifiers(String patchQualifiers)
The qualifiers to use to determine whether a script is a patch script. Defaults to patch. E.g. 01_#patch_myscript.sql

Parameters:
patchQualifiers - The patch qualifiers

setScriptFileExtensions

public void setScriptFileExtensions(String scriptFileExtensions)
Sets the scriptFileExtensions property, that defines the extensions of the files that are regarded to be database scripts. The extensions should not start with a dot. The default is 'sql,ddl'.

Parameters:
scriptFileExtensions - Comma separated list of file extensions.


Copyright © 2011. All Rights Reserved.