blob: f75778957261bbe61772db23f2a4423b22f59056 [file] [log] [blame]
Roger Meiere5e50de2010-11-02 12:36:52 +00001<!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18-->
19<project name="tutorial" default="test" basedir=".">
20
21 <description>Thrift JavaScript Tutorial</description>
22
23 <property name="src" location="src" />
24 <property name="javasrc" location="../java/src" />
25 <property name="gen" location="../gen-java" />
26 <property name="build" location="build" />
27
28 <!-- the root directory, where you unpack thrift distibution (e.g. thrift-0.x.x.tar.gz) -->
29 <property name="thrift.dir" location="../../" />
30 <property name="thrift.java.dir" location="${thrift.dir}/lib/java" />
31
32 <path id="libs.classpath">
Roger Meier5fc69732011-04-08 21:28:50 +000033 <fileset dir="../../lib/java/build">
34 <include name="*.jar" />
35 <exclude name="-test.jar" />
36 </fileset>
37 <fileset dir="../../lib/java/build/lib">
Roger Meiere5e50de2010-11-02 12:36:52 +000038 <include name="*.jar" />
39 </fileset>
40 </path>
41 <path id="build.classpath">
42 <path refid="libs.classpath" />
43 <pathelement path="${gen}" />
44 <pathelement path="${build}" />
45 </path>
46
47 <target name="init">
48 <tstamp />
49 <mkdir dir="${build}"/>
50 </target>
51
52 <target name="compile" depends="init">
53 <javac srcdir="${gen}" destdir="${build}" classpathref="libs.classpath" />
54 <javac srcdir="${javasrc}" destdir="${build}" classpathref="build.classpath">
55 <exclude name="JavaClient.java"/>
56 <exclude name="JavaServer.java"/>
57 <include name="CalculatorHandler.java"/>
58 </javac>
59 <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath">
60 <compilerarg value="-Xlint:all"/>
61 </javac>
62 </target>
63
64 <target name="tutorial" depends="compile">
65 <jar jarfile="tutorial-js.jar" basedir="${build}"/>
66 </target>
67
68 <target name="test" description="run the test server" depends="tutorial">
69 <java classname="Httpd" fork="true"
70 classpathref="build.classpath" failonerror="true">
71 <arg value="../../" />
72 </java>
73 </target>
74
75 <target name="clean">
76 <delete dir="${build}" />
77 <delete file="tutorial-js.jar" />
78 </target>
79
80</project>