A phing task for generating output by using Capsule.
This is based on the interface to TexenTask from Apache's Velocity engine.
author |
Hans Lellelid hans@xmpl.org |
---|---|
package |
phing.tasks.ext |
cleanup() : void
createAssign()
getContextProperties() : \Properties
getControlTemplate() : string
string
getDescription() : string
string
The text description of the task
getLocation() : \Location
getOutputDirectory() : string
string
getOutputFile() : string
string
getOwningTarget() : \Target
getProject() : \Project
getRegisterSlot(string $slotName) : \RegisterSlot
getRuntimeConfigurableWrapper() : \RuntimeConfigurable
getTaskName() : string
string
Name of this task
getTaskType() : string
string
The type of this task (XML Tag)
getTemplatePath() : string
string
init()
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
throws | |
---|---|
initControlContext() : \Capsule
throws |
the execute method will catch
and rethrow as a |
---|---|
\Capsule
initialized (cleared) Smarty context.
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
main()
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
maybeConfigure()
perform()
throws | |
---|---|
populateInitialContext(\Capsule $context) : void
throws |
Error while populating context. The {@link main()} method will catch and rethrow as a
|
---|
setContextProperties(string $file) : void
throws |
---|
string
setControlTemplate(string $controlTemplate) : void
string
setDescription(string $desc)
string
The text describing the task
setLocation(\Location $location)
setOutputDirectory(\PhingFile $outputDirectory) : void
setOutputFile(string $outputFile) : void
string
(TODO: change this to File)
setOwningTarget(\Target $target)
setProject(\Project $project) : void
setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)
setTaskName(string $name) : string
string
string
A string representing the name of this task for log
setTaskType( $name)
setTemplatePath( $templatePath) : void
assignedVars : array
var |
AssignedVar[] |
---|
array
controlTemplate : string
It may or may not invoke the services of worker templates.
var |
---|
string
templatePath : string
var |
---|
string
outputDirectory : string
var |
---|
string
outputFile : string
var |
---|
string
contextProperties : array
These values are not critical, like the template path or output path, but allow a convenient way to set a value that may be specific to a particular generation task.
For example, if you are generating scripts to allow
user to automatically create a database, then
you might want the $databaseName
to be placed
in the initial context so that it is available
in a script that might look something like the
following:
The value of
#!bin/sh
echo y | mysqladmin create $databaseName
$databaseName
isn't critical to
output, and you obviously don't want to change
the ant task to simply take a database name.
So initial context values can be set with
properties file.
var |
---|
array
description : string
var |
---|
string
taskType : string
var |
---|
string
taskName : string
var |
---|
string
project : \Project