blob: 03a6e7c64d3be4d4de13c91d7695af9f6bb36d3a [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" />
Roger Meierfa899322012-10-22 19:27:38 +000025 <property name="gen" location="../java/gen-java" />
Roger Meiere5e50de2010-11-02 12:36:52 +000026 <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="../../" />
Roger Meierfa899322012-10-22 19:27:38 +000030 <!-- JavaScript tutorial depends on the java tutorial thrift handler and server infrastructure -->
Roger Meiere5e50de2010-11-02 12:36:52 +000031 <property name="thrift.java.dir" location="${thrift.dir}/lib/java" />
32
33 <path id="libs.classpath">
Alex Volanis7004a612018-01-24 10:30:13 -050034 <fileset dir="${thrift.java.dir}/build/libs">
35 <include name="libthrift*.jar" />
36 <exclude name="libthrift*test.jar" />
37 <exclude name="libthrift*javadoc.jar" />
38 <exclude name="libthrift*sources.jar" />
Roger Meier5fc69732011-04-08 21:28:50 +000039 </fileset>
Alex Volanis7004a612018-01-24 10:30:13 -050040 <fileset dir="${thrift.java.dir}/build/deps">
Roger Meiere5e50de2010-11-02 12:36:52 +000041 <include name="*.jar" />
42 </fileset>
43 </path>
44 <path id="build.classpath">
45 <path refid="libs.classpath" />
46 <pathelement path="${gen}" />
47 <pathelement path="${build}" />
48 </path>
49
50 <target name="init">
51 <tstamp />
52 <mkdir dir="${build}"/>
53 </target>
54
55 <target name="compile" depends="init">
James E. King, IIIcf254892017-01-25 20:34:04 -050056 <javac compiler="modern" includeantruntime="false" srcdir="${gen}" destdir="${build}" classpathref="libs.classpath" />
57 <javac compiler="modern" includeantruntime="false" srcdir="${javasrc}" destdir="${build}" classpathref="build.classpath">
Roger Meiere5e50de2010-11-02 12:36:52 +000058 <exclude name="JavaClient.java"/>
59 <exclude name="JavaServer.java"/>
60 <include name="CalculatorHandler.java"/>
61 </javac>
James E. King, IIIcf254892017-01-25 20:34:04 -050062 <javac compiler="modern" includeantruntime="false" srcdir="${src}" destdir="${build}" classpathref="build.classpath">
Roger Meiere5e50de2010-11-02 12:36:52 +000063 <compilerarg value="-Xlint:all"/>
64 </javac>
65 </target>
66
Roger Meierfa899322012-10-22 19:27:38 +000067 <target name="test" depends="tutorial" />
68
Roger Meiere5e50de2010-11-02 12:36:52 +000069 <target name="tutorial" depends="compile">
70 <jar jarfile="tutorial-js.jar" basedir="${build}"/>
71 </target>
72
Roger Meierfa899322012-10-22 19:27:38 +000073 <target name="tutorialserver" description="run the test server" depends="tutorial, generate">
Roger Meiere5e50de2010-11-02 12:36:52 +000074 <java classname="Httpd" fork="true"
75 classpathref="build.classpath" failonerror="true">
76 <arg value="../../" />
77 </java>
78 </target>
79
Roger Meierfa899322012-10-22 19:27:38 +000080 <target name="generate">
81 <exec executable="../../compiler/cpp/thrift" failonerror="true">
82 <arg line="--gen js -r ../tutorial.thrift"/>
83 </exec>
84 </target>
Alex Volanis7004a612018-01-24 10:30:13 -050085
Roger Meiere5e50de2010-11-02 12:36:52 +000086 <target name="clean">
87 <delete dir="${build}" />
Roger Meier18a90d12012-10-24 18:40:06 +000088 <delete dir="gen-js"/>
Roger Meiere5e50de2010-11-02 12:36:52 +000089 <delete file="tutorial-js.jar" />
90 </target>
91
92</project>