Understanding Apache Ant Tasks

In this section:

The iWay SDK is made up of two major components. The first, an Apache Ant extension that exposes several tasks for managing the building and deploying process for an iWay Integration Application (iIA).

The following is a list of Ant tasks that are currently supported by the iWay SDK:

These Ant tasks provide a rich feature set that can assist build masters to integrate iWay into their new or existing software manufacturing systems.


Top of page

x
iwaddtemplate

Uploads an application template file (.ita) to iWay Service Manager (iSM). The template will be renamed into templateName.

Parameters:

The following table lists and describes the parameters for the iwaddtemplate Ant task.

Attribute

Description

Required

fileName

File path to the template file (.ita).

yes

templateName

Name of the template on iSM.

yes

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

Example:

The following build.xml snippet is an example of how to invoke the iwaddtemplate Ant task:

<property name="new.template.name" value="uploaded" />
	<property name="template.file.name" value="../dev.ita" />
	<property name="server.url" value="http://localhost:9000" />
	<property name="server.user" value="iway"/>
	<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
	<iwaddtemplate 
			templateName="${new.template.name}" 
			fileName="${template.file.name}" 
			serverURL="${server.url}" 
			userName="${server.user}" 
			password="${server.password}"
		/>

Top of page

x
iwbuild

Builds an iWay Integration Application (.iia file) from an Eclipse-based iIT project. This task can only run in an application directory, ending with *.iab.

Parameters:

The following table lists and describes the parameters for the iwbuild Ant task.

Attribute

Description

Required

dir

The file path to the application directory, which must end with *.iab.

no

sdkPath

A list of additional workspaces separated by a semicolon (;). Workspaces are directories that contain iIT projects. Set this attribute if your application contains iIT project components in other workspaces.

no

clean

Set this attribute to true if you want to recompile the artifacts. This attribute is set to false by default.

no

Example:

The following build.xml snippet is an example of how to invoke the iwbuild Ant task:

<iwbuild dir="${appdir}"  sdkPath="${otherworkspace}" />

Top of page

x
iwdelete

Deletes an iIA template (.ita), application (.iia), or deployment from iSM.

Parameters:

The following table lists and describes the parameters for the iwdelete Ant task.

Attribute

Description

Required

name

Name of the iIA template, application, or deployment.

yes

type

The resource type (app, deployment, or template). This attribute is set to deployment by default.

no

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

Example:

The following build.xml snippet is an example of how to invoke the iwdelete Ant task:

<property name="deployment.name" value="from_ant" />
	<property name="server.url" value="http://localhost:9000" />
	<property name="server.user" value="iway"/>
	<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
<iwdelete 
	name="${deployment.name}"
	serverURL="${server.url}" 
	userName="${server.user}" 
	password="${server.password}"
	/>

Top of page

x
iwdeploy

Deploys an iIA with a specified template (.ita) to iSM.

Parameters:

The following table lists and describes the parameters for the iwdeploy Ant task.

Attribute

Description

Required

app

Name of the application in iSM that you want to deploy.

yes

templateName

Name of the template in iSM that you want to deploy.

yes

deploymentName

The application deployment name, which defaults to app_templateName.

yes

port

Console port for the application. If a port value is not set, the next available port will be assigned.

no

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

Example:

The following build.xml snippet is an example of how to invoke the iwdeploy Ant task:

<property name="app" value="app" />
	<property name="template.name" value="raw" />
	<property name="server.url" value="http://localhost:9000" />
	<property name="server.user" value="iway"/>
	<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
<iwdeploy 
	app="${app}"
	templateName="${template.name}" 
	serverURL="${server.url}" 
	userName="${server.user}" 
	password="${server.password}"
/>

Top of page

x
iwdeploylocal

Deploys an iIA with a specified template (.ita) to a local directory without running iSM.

Parameters:

The following table lists and describes the parameters for the iwdeploylocal Ant task.

Attribute

Description

Required

appDir

Application directory, ending with *.iab.

yes

sdkHome

Directory where iWay SDK is installed.

yes

templateFile

Location of the template (.ita) file.

yes

override

Set this attribute to true if you want to override the existing local deployment (if it exists). This attribute is set to false by default.

no

Example:

The following build.xml snippet is an example of how to invoke the iwdeploylocal Ant task:

<property name="appDir" value="C:\iway\src\7.0\components\iwscript\testdata\projects\app\Applications\mover.iab" />
	<property name="template.file" value="C:\iway\src\7.0\components\iwscript\testdata\projects\app\dev.ita" />
	<iwdeploylocal 
			sdkHome="${basedir}"
			appDir="${appDir}"
			templateFile="${template.file}"
			override="true"
			 />

Top of page

x
iwscript

Executes a remote Ant script through iSM.

Parameters:

The following table lists and describes the parameters for the iwscript Ant task.

Attribute

Description

Required

antTarget

The Ant target to invoke inside the Ant script.

yes

app

The name of the application deployment.

yes

script

The script name, which is usually build.xml.

yes

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

Example:

The following build.xml snippet is an example of how to invoke the iwscript Ant task:

<property name="remote.target" value="props"/>
	<property name="deployment.name" value="from_ant" />
	<property name="server.url" value="http://localhost:9000" />
	<property name="server.user" value="iway"/>
	<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
	
 <iwscript 
	serverurl="${server.url}" 
	anttarget="${remote.target}"
	app="${deployment.name}"
	script="build.xml"
	username="${server.user}"
	password="${server.password}"
/>

Top of page

x
iwstart

Starts a deployed iIA or application channel(s). If no channel nodes are found, then the application is started. Otherwise, specified channels are started.

Parameters:

The following table lists and describes the parameters for the iwstart Ant task.

Attribute

Description

Required

deploymentName

The name of the application deployment.

yes

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

timeout

Determines the amount of time (in seconds) to wait for an application deployment or channel to start. The default value is 10 seconds.

no

failonerror

If set to true, the execution of the script will terminate if an application deployment or a channel fails to start before timeout occurs.

no

Examples:

The following build.xml snippet is an example of how to start an application deployment:

<property name="deployment.name" value="from_ant" />
<property name="server.url" value="http://localhost:9000" />
<property name="server.user" value="iway"/>
<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
<iwstart 
    deploymentName="${deployment.name}"
    serverURL="${server.url}" 
    userName="${server.user}" 
    password="${server.password}"
/>

The following build.xml snippet is an example of how to start three channels (file1, file2, and file3):

<iwstart 
    deploymentName="${deployment.name}"
    serverURL="${server.url}" 
    userName="${server.user}" 
    password="${server.password}">
        <Channel name="file1"/>
        <Channel name="file2"/>
        <Channel name="file3"/>
</iwstart>

Top of page

x
iwstop

Stops a deployed iIA or application channel(s). If no channel nodes are found, then the application is stopped. Otherwise, specified channels are stopped.

Parameters:

The following table lists and describes the parameters for the iwstop Ant task.

Attribute

Description

Required

deploymentName

The name of the application deployment.

yes

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

timeout

Determines the amount of time (in seconds) to wait for an application deployment or channel to stop. The default value is 10 seconds.

no

failonerror

If set to true, the execution of the script will terminate if an application deployment or a channel fails to stop before timeout occurs.

no

Examples:

The following build.xml snippet is an example of how to stop an application deployment:

<property name="deployment.name" value="from_ant" />
<property name="server.url" value="http://localhost:9000" />
<property name="server.user" value="iway"/>
<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
<iwstop 
    deploymentName="${deployment.name}"
    serverURL="${server.url}" 
    userName="${server.user}" 
    password="${server.password}"
/>

The following build.xml snippet is an example of how to stop three channels (file3, file2, and file1:

<iwstop 
    deploymentName="${deployment.name}"
    serverURL="${server.url}" 
    userName="${server.user}" 
    password="${server.password}">
        <Channel name="file3"/>
        <Channel name="file2"/>
        <Channel name="file1"/>
</iwstop>

Top of page

x
iwupload

Uploads an application (.iia) file to iSM.

Parameters:

The following table lists and describes the parameters for the iwupload Ant task.

Attribute

Description

Required

applicationFile

The file path to the application (.iia) file.

no

user

A valid user name that is used to connect to iSM.

yes

password

A valid password that is used to connect to iSM.

yes

serverURL

The URL used to access iSM.

yes

Example:

The following build.xml snippet is an example of how to invoke the iwupload Ant task:

<property name="iia.name" value="C:\app.iia" />
	<property name="template.name" value="raw" />
	<property name="server.url" value="http://localhost:9000" />
	<property name="server.user" value="iway"/>
	<property name="server.password" value="ENCR(3237324531043128310632252993121)"/>
<iwupload 
	applicationFile="${iia.name}" 
	serverURL="${server.url}" 
	userName="${server.user}" 
	password="${server.password}"
/>

iWay Software