18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING A COMMAND-LINE JAVA APPLICATION<br />

• validate-engine—ensures that the <strong>ArcGIS</strong> <strong>Engine</strong> developer environment is<br />

properly set.<br />

• compile—compiles the scenario.<br />

• execute—runs the scenario in a separate JVM instance.<br />

• all—the default target, which builds the entire scenario.<br />

• clean—cleans all build products.<br />

• run-scenario—builds and runs the scenario application.<br />

To get an idea of the structure of Ant targets, look at a sample compile target<br />

line by line.<br />

The entire build script is not discussed in detail<br />

here; to learn more about building Ant scripts<br />

see the Ant documentation available from the<br />

Apache Ant Web site, http://ant.apache.org/.<br />

<br />

As shown in the first line, this target has a name to reference and depends on<br />

another target. To ensure a successful build, the ‘depends’ attribute is used to<br />

confirm that the environment is set correctly.<br />

<br />

<br />

<br />

In the last section of this sample target, one of ANT’s core tasks, “javac”, is<br />

created to compile the files in the source directory and place them in the class<br />

directory. The javac task supports a class path task to ensure the class path settings.<br />

The complete sample target, including closure of the XML tags, is as shown<br />

below:<br />

<br />

<br />

<br />

<br />

<br />

<br />

Now that you have a basic understanding of targets and their usage in Ant,<br />

proceed with creating the build.xml file for this scenario.<br />

1. Create an XML file named build.xml and add the following:<br />

<br />

<br />

<br />

<br />

<br />

&properties;<br />

<br />

<br />

<br />

<br />

Chapter 6 • <strong>Developer</strong> scenarios • 413

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

Saved successfully!

Ooh no, something went wrong!