| Apache ESME > Index > Clients > Ant Client |
This is a client for the "make" tool ant that allows you to send messages to ESME at certain points in the "make" process
<project name="EsmeViaAnt" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<path id="project.class.path">
<pathelement path="./dist/lib/EsmeViaAnt.jar:./lib/esme-rest-api-0.1-SNAPSHOT.jar:./lib/commons-codec-1.2.jar:./lib/commons-logging-1.0.4.jar:./lib/commons-httpclient-3.1.jar/"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="$
"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from $
">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="$
<!-- Put everything in $
</java>
</target>
</project>
import us.esme.api.EsmeRestApi;
import us.esme.api.Message;
public class EsmeAntTask
{
public static void main (String[] args) {
String apiUrl;
String authToken;
String localProxy;
String message;
EsmeRestApi esme;
apiUrl = args0;
authToken = args1;
localProxy = args2;
message = args3;
try {
esme = new EsmeRestApi(apiUrl);
if ((localProxy != null) && !("".equals(localProxy)))