web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Chapter 28 28BES Ant tasks and running Chapter BES examples Many of the BES examples now employ the Ant build script system. In addition to Ant's core functionality, the BES version of Ant includes customized tasks for several of the BES command line tools, including commands of the following: ■ appclient ■ iastool ■ idl2java ■ java2iiop These customized Ant tasks have the following advantages over using exec or apply directives: ■ ■ ■ Customized Ant tasks run under the VM used to launch the Ant script, hence they run faster and use less memory compared to spawning new JVMs with the exec/ apply commands. Customized tasks have a much simpler command syntax than the exec/apply version. Ant features such as filesets and patternsets are available in a more natural way. Chapter 28: BES Ant tasks and running BES examples 283

General syntax and usage General syntax and usage The following table shows the currently defined Ant tasks and their relationship to the equivalent command line tools. Ant task name Equivalent command line Function appclient appclient Runs a client application. idl2java idl2java Converts IDL to Java classes. java2iiop java2iiop Executes the java2iiop command. iastool iastool Runs iastool. Generally the BES Ant task uses the same pattern as the command-line tool equivalent. Name-value pair transformation All name-value pair command line arguments can be transformed into Ant task attributes. The name-value pair command-line arguments should be translated into equivalent XML attributes. For example, the command line: iastool -verify -src cart_beans_client.jar -role DEVELOPER translates into the Ant task: Name-only argument transformation All name-only command-line arguments can be transformed into boolean type Ant task attributes. For boolean-style attributes, such as -nowarn, use the default usage of the attribute, according to the usage documented for each of the command line tools. See Chapter 29, “iastool command-line utility” for more information about iastool command line attributes. Note For example, the following command sets the warn attribute to false: iastool -verify -src cart_beans_client.jar -role DEVELOPER -nowarn -nostrict The equivalent Ant task is: It is not valid to use “warn” as an attribute in the Ant task. For instance, the following line causes a syntax error: ****** INCORRECT SYNTAX!!! ****** Multiple File Arguments Many commands either act on multiple files or have options which can point to multiple files. There are several ways to achieve this functionality in the equivalent Ant task. For example, the iastool -merge command: iastool -merge -target build\client.jar -type lib client\build\local_client.jar build\local_stubs.jar 284 BES Developer’s Guide

General syntax and usage<br />

General syntax and usage<br />

The following table shows the currently defined Ant tasks and their relationship to the<br />

equivalent command line tools.<br />

Ant task name Equivalent command line Function<br />

appclient appclient Runs a client application.<br />

idl2java idl2java Converts IDL to Java classes.<br />

java2iiop java2iiop Executes the java2iiop command.<br />

iastool iastool Runs iastool.<br />

Generally the BES Ant task uses the same pattern as the command-line tool<br />

equivalent.<br />

Name-value pair transformation<br />

All name-value pair command line arguments can be transformed into Ant task<br />

attributes. The name-value pair command-line arguments should be translated into<br />

equivalent XML attributes. For example, the command line:<br />

iastool -verify -src cart_beans_client.jar -role DEVELOPER<br />

translates into the Ant task:<br />

<br />

Name-only argument transformation<br />

All name-only command-line arguments can be transformed into boolean type Ant task<br />

attributes. For boolean-style attributes, such as -nowarn, use the default usage of the<br />

attribute, according to the usage documented for each of the command line tools. See<br />

Chapter 29, “iastool command-line utility” for more information about iastool command<br />

line attributes.<br />

Note<br />

For example, the following command sets the warn attribute to false:<br />

iastool -verify -src cart_beans_client.jar -role DEVELOPER -nowarn -nostrict<br />

The equivalent Ant task is:<br />

<br />

It is not valid to use “warn” as an attribute in the Ant task. For instance, the following<br />

line causes a syntax error:<br />

****** INCORRECT SYNTAX!!! ******<br />

<br />

Multiple File Arguments<br />

Many commands either act on multiple files or have options which can point to multiple<br />

files. There are several ways to achieve this functionality in the equivalent Ant task. For<br />

example, the iastool -merge command:<br />

iastool -merge -target build\client.jar -type lib client\build\local_client.jar<br />

build\local_stubs.jar<br />

284 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!