The plugin.xml file for automation plug-ins
An automation plug-in is defined with the plugin.xml file.
The structure of this file consists of a header element and one or more
step-type elements. The header element identifies the
plug-in. Each step-type element defines a step. Steps are available to users
in the Build process
editor and are used to construct component processes.
After the document-type declaration, the plugin root element identifies the XML
schema type, PluginXMLSchema_v1.xsd, which all plug-ins use. The
following code fragment presents the basic structure of the plugin.xml
file for automation plug-ins:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.urbancode.com/PluginXMLSchema_v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header>
<identifier id="com.urbancode.air.plugin.Shell" version="4" name="Shell"/>
<description>The Shell plugin allows users to run custom shell scripts during the deployment process.</description>
<tag>Scripting/Shell</tag>
<server:plugin-type>Automation</server:plugin-type>
</header>
<step-type name="Shell">
<description>Execute a shell or batch script.</description>
<properties>
<property name="shellInterpreter">
<property-ui type="textBox" label="Interpreter"
description="Optionally specify the interpreter to use to evaluate the command.
If left blank the following platform-specific behavior will be used:
Command Line will use .bat file interpreter on Windows and .com file interpreter on VMS. On other
systems it will use the shell specified by 'air/shell' agent variable if present. *nix systems
may override this by having the Command Line starts with a #! sequence."/>
</property>
<property name="scriptBody" required="true">
<property-ui type="textAreaBox" label="Shell Script" description="Enter the script code to execute."/>
</property>
<property name="runAsDaemon">
<property-ui type="checkBox" label="Daemon" description="Check this option to run the command in the background while permitting the step to
complete immediately. The output will not be captured if running as a daemon."/>
</property>
<property name="outputFile">
<property-ui type="textBox" label="Output File" description="Only set this value if Daemon is checked. Enter the
path of the file to which the command output is directed. Leave blank to discard the output. The output
will not be captured if an output file is specified."/>
</property>
</properties>
<post-processing>
<![CDATA[
if (properties.get("exitCode") != 0) {
properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
}
else {
properties.put("Status", "Success");
}
]]>
</post-processing>
<command program="${GROOVY_HOME}/bin/groovy">
<arg value="-cp"/>
<arg path="lib/shell.jar:lib/CommonsUtil.jar:lib/log4j.jar:lib/NativeProcess.jar:lib/WinAPI.jar"/>
<arg file="shell.groovy"/>
<arg file="${PLUGIN_INPUT_PROPS}"/>
<arg file="${PLUGIN_OUTPUT_PROPS}"/>
</command>
</step-type>
For information about the structure of the plugin.xml file for source plug-ins, see Creating source plug-ins.