blob: f8afed22b43e6f3a4b69bdb01e1800d77fabf12e [file] [log] [blame]
David Reiss36a5a252009-04-29 23:20:56 +00001<?xml version="1.0"?>
David Reissea2cba82009-03-30 21:35:00 +00002<!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
Jake Farrell4b8faf92011-04-19 21:11:54 +000010
11 http://www.apache.org/licenses/LICENSE-2.0
12
David Reissea2cba82009-03-30 21:35:00 +000013 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
Jake Farrell4b8faf92011-04-19 21:11:54 +000019 -->
David Reiss36a5a252009-04-29 23:20:56 +000020<project name="libthrift" default="dist" basedir="."
Bryan Duxbury547edc72010-03-28 21:02:38 +000021 xmlns:artifact="antlib:org.apache.maven.artifact.ant">
Jake Farrell4b8faf92011-04-19 21:11:54 +000022
Mark Slee83c52a82006-06-07 06:51:18 +000023 <description>Thrift Build File</description>
Bryan Duxbury2f45e782009-08-20 00:55:12 +000024 <property name="thrift.root" location="../../"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000025 <property name="thrift.artifactid" value="libthrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +000026
Jake Farrell4b8faf92011-04-19 21:11:54 +000027 <!-- Include the base properties file -->
28 <property file="${basedir}/build.properties" />
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000029
30 <property environment="env"/>
31
32 <condition property="version" value="${thrift.version}">
33 <isset property="release"/>
34 </condition>
Jake Farrell4b8faf92011-04-19 21:11:54 +000035 <property name="version" value="${thrift.version}-snapshot"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000036
37 <property name="final.name" value="${thrift.artifactid}-${version}"/>
38
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000039 <property name="src" location="${basedir}/src"/>
40 <property name="build.dir" location="${basedir}/build"/>
41 <property name="build.lib.dir" location="${build.dir}/lib"/>
42 <property name="build.tools.dir" location="${build.dir}/tools"/>
43 <property name="src.test" location="test"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +000044 <property name="javadoc.dir" location="${build.dir}/javadoc"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000045 <property name="build.test.dir" location="${build.dir}/test"/>
46 <property name="test.thrift.home" location="${thrift.root}/test"/>
47
Jake Farrell4b8faf92011-04-19 21:11:54 +000048 <property name="gen" location="gen-java"/>
49 <property name="genbean" location="gen-javabean"/>
henriqued7902bf2014-03-31 16:21:37 +020050 <property name="genreuse" location="gen-javareuse"/>
Roger Meiere86428c2014-05-30 00:14:50 +020051 <property name="genfullcamel" location="gen-fullcamel"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +000052
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000053 <property name="jar.file" location="${build.dir}/${final.name}.jar"/>
54 <property name="test.jar.file" location="${build.dir}/${final.name}-test.jar"/>
55 <property name="javadoc.jar.file" location="${build.dir}/${final.name}-javadoc.jar"/>
56 <property name="source.tar.gz" location="${build.dir}/${final.name}-src.tar.gz"/>
57
58 <!-- Junit properties -->
59 <property name="test.junit.output.format" value="plain"/>
60 <property name="test.timeout" value="2000000"/>
61 <property name="test.src.dir" location="${basedir}/test"/>
62 <property name="test.log.dir" value="${build.test.dir}/log"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +000063 <property name="test.port" value="9090"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000064
65 <!-- maven properties -->
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000066 <property name="pom.xml" location="${build.dir}/${final.name}.pom"/>
67
David Reiss36a5a252009-04-29 23:20:56 +000068 <path id="compile.classpath">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000069 <fileset dir="${build.lib.dir}">
70 <include name="**/*.jar"/>
71 </fileset>
David Reiss36a5a252009-04-29 23:20:56 +000072 </path>
73
74 <path id="test.classpath">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000075 <path refid="compile.classpath"/>
76 <pathelement path="${env.CLASSPATH}"/>
77 <pathelement location="${build.test.dir}"/>
78 <pathelement location="${jar.file}"/>
79 <pathelement location="${test.jar.file}"/>
henriqued7902bf2014-03-31 16:21:37 +020080
David Reiss36a5a252009-04-29 23:20:56 +000081 </path>
Bryan Duxbury538e3442009-02-10 04:49:39 +000082
Jake Farrell4b8faf92011-04-19 21:11:54 +000083 <!-- Tasks -->
84 <target name="init" depends="setup.init,mvn.init" unless="init.finished">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000085 <property name="init.finished" value="true"/>
Mark Slee83c52a82006-06-07 06:51:18 +000086 </target>
87
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000088 <target name="setup.init">
89 <tstamp/>
90 <mkdir dir="${build.dir}"/>
91 <mkdir dir="${build.lib.dir}"/>
92 <mkdir dir="${build.tools.dir}"/>
93 <mkdir dir="${build.test.dir}"/>
David Reiss36a5a252009-04-29 23:20:56 +000094 </target>
95
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +000096 <target name="compile" depends="init">
97 <javac srcdir="${src}" destdir="${build.dir}" source="1.5" target="1.5"
Roger Meierf35975b2013-11-17 18:30:23 +010098 debug="true" classpathref="compile.classpath" includeantruntime="false" encoding="UTF-8">
jfarrell98d9ef22014-02-23 22:56:58 -050099 <compilerarg value="-Xlint:unchecked"/>
Bryan Duxburybce6fad2011-08-24 00:22:30 +0000100 </javac>
David Reiss36a5a252009-04-29 23:20:56 +0000101 </target>
102
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000103 <target name="javadoc" depends="init">
104 <javadoc sourcepath="${src}" destdir="${javadoc.dir}"
105 version="true" windowtitle="Thrift Java API" doctitle="Thrift Java API"
Bryan Duxburyd8c77572010-07-29 19:30:47 +0000106 classpathref="test.classpath">
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000107 </javadoc>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000108 <jar jarfile="${javadoc.jar.file}" basedir="${javadoc.dir}">
109 <manifest>
110 <attribute name="Implementation-Version" value="${version}"/>
111 </manifest>
112 </jar>
Mark Slee83c52a82006-06-07 06:51:18 +0000113 </target>
114
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000115 <target name="dist" depends="compile">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000116 <mkdir dir="${build.dir}/META-INF"/>
117 <copy file="${thrift.root}/LICENSE" tofile="${build.dir}/META-INF/LICENSE.txt"/>
118 <copy file="${thrift.root}/NOTICE" tofile="${build.dir}/META-INF/NOTICE.txt"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000119 <jar jarfile="${jar.file}">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000120 <manifest>
121 <attribute name="Implementation-Version" value="${version}"/>
Jake Farrell34e1db42011-11-08 01:39:47 +0000122 <attribute name="Bundle-ManifestVersion" value="2"/>
123 <attribute name="Bundle-SymbolicName" value="${thrift.groupid}"/>
124 <attribute name="Bundle-Name" value="Apache Thrift"/>
125 <attribute name="Bundle-Version" value="${version}"/>
126 <attribute name="Bundle-Description" value="Apache Thrift library"/>
127 <attribute name="Bundle-License" value="${license}"/>
128 <attribute name="Bundle-ActivationPolicy" value="lazy"/>
henriqued7902bf2014-03-31 16:21:37 +0200129 <attribute name="Export-Package" value="${thrift.groupid}.async;uses:=&quot;
130${thrift.groupid}.protocol,${thrift.groupid}.transport,org.slf4j,${thrift.groupid}&quot;;version=&quot;${version}&quot;,
131${thrift.groupid}.protocol;uses:=&quot;${thrift.groupid}.transport,${thrift.groupid},${thrift.groupid}.scheme&quot;
132;version=&quot;${version}&quot;,${thrift.groupid}.server;uses:=&quot;${thrift.groupid}.transport,${thrift.groupid}.protocol,
133${thrift.groupid},org.slf4j,javax.servlet,javax.servlet.http&quot;;version=&quot;${version}&quot;,${thrift.groupid}.transport;
134uses:=&quot;${thrift.groupid}.protocol,${thrift.groupid},org.apache.http.client,org.apache.http.params,org.apache.http.entity,
135org.apache.http.client.methods,org.apache.http,org.slf4j,javax.net.ssl,javax.net,javax.security.sasl,
136javax.security.auth.callback&quot;;version=&quot;${version}&quot;,${thrift.groupid};uses:=&quot;${thrift.groupid}.protocol,
137${thrift.groupid}.async,${thrift.groupid}.server,${thrift.groupid}.transport,org.slf4j,org.apache.log4j,
138${thrift.groupid}.scheme&quot;;version=&quot;${version}&quot;,${thrift.groupid}.meta_data;uses:=&quot;${thrift.groupid}&quot;
139;version=&quot;${version}&quot;,${thrift.groupid}.scheme;uses:=&quot;${thrift.groupid}.protocol,
140${thrift.groupid}&quot;;version=&quot;${version}&quot;"/>
141 <attribute name="Import-Package" value="javax.net,javax.net.ssl,javax.security.auth.callback,
142javax.security.sasl,javax.servlet;resolution:=optional,javax.servlet.http;resolution:=optional,
143resolution:=optional,org.slf4j;resolution:=optional;version=&quot;[1.4,2)&quot;"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000144 </manifest>
145 <fileset dir="${build.dir}">
146 <include name="org/apache/thrift/**/*.class"/>
147 <include name="META-INF/*.txt"/>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000148 </fileset>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000149 </jar>
150 </target>
151
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000152 <target name="pack.src">
153 <tar destfile="${source.tar.gz}" basedir="${src}" compression="gzip"/>
154 </target>
155
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000156 <target name="install" depends="dist,javadoc">
David Reiss56c2c212009-06-04 02:05:25 +0000157 <copy todir="${install.path}">
Jake Farrell73b8dfc2011-06-02 16:13:18 +0000158 <fileset dir="${build.dir}" includes="*.jar"/>
159 <fileset dir="${build.lib.dir}" includes="*.jar"/>
David Reiss56c2c212009-06-04 02:05:25 +0000160 </copy>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000161 <copy todir="${install.javadoc.path}">
Jake Farrell73b8dfc2011-06-02 16:13:18 +0000162 <fileset dir="${javadoc.dir}" includes="**/*"/>
Bryan Duxbury32e04b42009-03-20 16:43:06 +0000163 </copy>
Mark Slee83c52a82006-06-07 06:51:18 +0000164 </target>
165
166 <target name="clean">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000167 <delete dir="${build.dir}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000168 <delete dir="${gen}"/>
169 <delete dir="${genbean}"/>
henriqued7902bf2014-03-31 16:21:37 +0200170 <delete dir="${genreuse}"/>
Roger Meiere86428c2014-05-30 00:14:50 +0200171 <delete dir="${genfullcamel}"/>
Mark Slee83c52a82006-06-07 06:51:18 +0000172 </target>
173
Roger Meierf42ce2a2013-01-16 22:12:14 +0100174 <target name="optional-generate" unless="no-gen-thrift">
175 <antcall target="generate">
176 </antcall>
177 </target>
178
179 <target name="compile-test" description="Build the test suite classes" depends="optional-generate,dist">
Roger Meierf35975b2013-11-17 18:30:23 +0100180 <javac debug="true" srcdir="${gen}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8">
Roger Meiere242a962012-11-15 22:23:27 +0000181 <compilerarg value="-Xlint:deprecation"/>
182 <!--<compilerarg value="-Xlint:unchecked"/>-->
henriqued7902bf2014-03-31 16:21:37 +0200183 </javac>
Roger Meierf35975b2013-11-17 18:30:23 +0100184 <javac debug="true" srcdir="${genbean}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8">
Roger Meiere242a962012-11-15 22:23:27 +0000185 <compilerarg value="-Xlint:deprecation"/>
186 <!--<compilerarg value="-Xlint:unchecked"/>-->
henriqued7902bf2014-03-31 16:21:37 +0200187 </javac>
188 <javac debug="true" srcdir="${genreuse}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8">
189 <compilerarg value="-Xlint:deprecation"/>
190 <!--<compilerarg value="-Xlint:unchecked"/>-->
191 </javac>
Roger Meiere86428c2014-05-30 00:14:50 +0200192 <javac debug="true" srcdir="${genfullcamel}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8">
193 <compilerarg value="-Xlint:deprecation"/>
194 <!--<compilerarg value="-Xlint:unchecked"/>-->
195 </javac>
Roger Meierf35975b2013-11-17 18:30:23 +0100196 <javac debug="true" srcdir="${src.test}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8">
Roger Meiere242a962012-11-15 22:23:27 +0000197 <compilerarg value="-Xlint:deprecation"/>
198 <!--<compilerarg value="-Xlint:unchecked"/>-->
Bryan Duxburybce6fad2011-08-24 00:22:30 +0000199 </javac>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000200 <copy todir="${build.test.dir}">
201 <fileset dir="${src.test}" includes="log4j.properties"/>
Todd Lipconfcaa8f52010-09-27 23:51:22 +0000202 </copy>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000203 <jar jarfile="${test.jar.file}" basedir="${build.test.dir}"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000204 </target>
205
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000206 <target name="junit-test" description="Run the JUnit test suite" depends="compile-test">
207 <mkdir dir="${test.log.dir}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000208 <junit printsummary="true" showoutput="${test.output}" timeout="${test.timeout}"
Jake Farrell4b8faf92011-04-19 21:11:54 +0000209 haltonfailure="true" errorProperty="tests.failed" failureProperty="tests.failed"
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000210 fork="true" forkmode="perTest" maxmemory="512m"
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000211 >
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000212 <sysproperty key="build.test" value="${build.test.dir}"/>
213 <sysproperty key="test.port" value="${test.port}"/>
Bryan Duxbury1b130832010-10-19 17:20:57 +0000214 <sysproperty key="javax.net.ssl.trustStore" value="${src.test}/.truststore"/>
215 <sysproperty key="javax.net.ssl.trustStorePassword" value="thrift"/>
216 <sysproperty key="javax.net.ssl.keyStore" value="${src.test}/.keystore"/>
217 <sysproperty key="javax.net.ssl.keyStorePassword" value="thrift"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000218 <classpath refid="test.classpath"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000219 <formatter type="${test.junit.output.format}"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000220 <batchtest todir="${test.log.dir}" unless="testcase">
Roger Meier5013de22010-10-25 19:57:26 +0000221 <fileset dir="${test.src.dir}">
222 <include name="**/Test*.java"/>
223 <exclude name="**/TestClient.java"/>
224 <exclude name="**/TestServer.java"/>
225 <exclude name="**/TestNonblockingServer.java"/>
226 </fileset>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000227 </batchtest>
228 <batchtest todir="${test.log.dir}" if="testcase">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000229 <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000230 </batchtest>
231 </junit>
232 <fail if="tests.failed">Tests failed!</fail>
233 </target>
234
235 <target name="deprecated-test" description="Run the non-JUnit test suite" depends="compile-test">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000236 <java classname="org.apache.thrift.test.EqualityTest" classpathref="test.classpath" failonerror="true"/>
237 <java classname="org.apache.thrift.test.JavaBeansTest" classpathref="test.classpath" failonerror="true"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000238 </target>
239
Bryan Duxbury951e7e22010-03-26 05:05:59 +0000240 <target name="test" description="Run the full test suite" depends="junit-test,deprecated-test"/>
henriqued17f1c92014-04-30 16:21:25 +0200241
242 <target name="testclient" description="Run a test client" depends="compile-test, run-testclient"/>
243 <target name="run-testclient" description="Run a test client">
David Reiss2727fab2009-12-09 19:30:01 +0000244 <java classname="org.apache.thrift.test.TestClient"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100245 classpathref="test.classpath" failonerror="true" fork="true">
246 <sysproperty key="javax.net.ssl.trustStore" value="${src.test}/.truststore"/>
247 <sysproperty key="javax.net.ssl.trustStorePassword" value="thrift"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000248 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000249 </java>
250 </target>
henriqued17f1c92014-04-30 16:21:25 +0200251
252 <target name="testserver" description="Run a test server" depends="compile-test, run-testserver"/>
253 <target name="run-testserver" description="Run a test server">
David Reiss2727fab2009-12-09 19:30:01 +0000254 <java classname="org.apache.thrift.test.TestServer"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100255 classpathref="test.classpath" failonerror="true" fork="true">
256 <sysproperty key="javax.net.ssl.keyStore" value="${src.test}/.keystore"/>
257 <sysproperty key="javax.net.ssl.keyStorePassword" value="thrift"/>
258 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000259 </java>
260 </target>
henriqued17f1c92014-04-30 16:21:25 +0200261
262 <target name="testnonblockingserver" description="Run a test nonblocking server" depends="compile-test, run-testnonblockingserver"/>
263 <target name="run-testnonblockingserver" description="Run a test nonblocking server">
David Reiss2727fab2009-12-09 19:30:01 +0000264 <java classname="org.apache.thrift.test.TestNonblockingServer"
265 classpathref="test.classpath" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000266 <arg line="${testargs}"/>
David Reiss2727fab2009-12-09 19:30:01 +0000267 </java>
268 </target>
269
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000270 <target name="generate">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000271 <!-- Generate the thrift gen-java source -->
Bryan Duxbury2845b162009-11-09 15:55:22 +0000272 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000273 <arg line="--gen java:hashcode ${test.thrift.home}/ThriftTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000274 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000275 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000276 <arg line="--gen java:hashcode ${test.thrift.home}/DebugProtoTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000277 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000278 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000279 <arg line="--gen java:hashcode ${test.thrift.home}/OptionalRequiredTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000280 </exec>
Bryan Duxbury2845b162009-11-09 15:55:22 +0000281 <exec executable="../../compiler/cpp/thrift" failonerror="true">
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000282 <arg line="--gen java:beans,nocamel ${test.thrift.home}/JavaBeansTest.thrift"/>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000283 </exec>
Bryan Duxbury1e79cb42011-12-21 18:13:29 +0000284 <exec executable="../../compiler/cpp/thrift" failonerror="true">
285 <arg line="--gen java:hashcode ${test.thrift.home}/ManyOptionals.thrift"/>
286 </exec>
henriqued7902bf2014-03-31 16:21:37 +0200287 <exec executable="mkdir" failonerror="true">
Roger Meiere86428c2014-05-30 00:14:50 +0200288 <arg line="-p ${genfullcamel}"/>
289 </exec>
290 <exec executable="../../compiler/cpp/thrift" failonerror="true">
291 <arg line="--gen java:hashcode,fullcamel -out ${genfullcamel} ${test.thrift.home}/DenseLinkingTest.thrift"/>
292 </exec>
293 <exec executable="mkdir" failonerror="true">
henriqued7902bf2014-03-31 16:21:37 +0200294 <arg line="-p ${genreuse}"/>
295 </exec>
296 <exec executable="../../compiler/cpp/thrift" failonerror="true">
297 <arg line="--gen java:reuse-objects -out ${genreuse} ${test.thrift.home}/ReuseObjects.thrift"/>
298 </exec>
Bryan Duxbury249d7cb2009-01-29 01:21:20 +0000299 </target>
300
Bryan Duxbury35dd47b2011-06-23 22:21:20 +0000301 <target name="proxy" if="proxy.enabled">
302 <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
303 proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/>
304 </target>
305
306 <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check,proxy" unless="mvn.ant.tasks.found">
Jake Farrell4b8faf92011-04-19 21:11:54 +0000307 <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000308 </target>
309
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000310 <target name="mvn.ant.tasks.check">
311 <condition property="mvn.ant.tasks.found">
312 <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
313 </condition>
Jake Farrell4b8faf92011-04-19 21:11:54 +0000314 </target>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000315
316 <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
317 <!-- Download mvn ant tasks, download dependencies, and setup pom file -->
Jake Farrell4b8faf92011-04-19 21:11:54 +0000318 <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000319
320 <!-- remote repositories used to download dependencies from -->
321 <artifact:remoteRepository id="central" url="${mvn.repo}"/>
322 <artifact:remoteRepository id="apache" url="${apache.repo}"/>
323
324 <!-- Pom file information -->
325 <artifact:pom id="pom"
326 groupId="${thrift.groupid}"
327 artifactId="${thrift.artifactid}"
328 version="${version}"
329 url="http://thrift.apache.org"
330 name="Apache Thrift"
331 description="Thrift is a software framework for scalable cross-language services development."
332 packaging="pom"
333 >
334 <remoteRepository refid="central"/>
335 <remoteRepository refid="apache"/>
336 <license name="The Apache Software License, Version 2.0" url="${license}"/>
Roger Meier565517a2013-03-22 21:08:39 +0100337 <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
338 developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
339 url="https://git-wip-us.apache.org/repos/asf?p=thrift.git"
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000340 />
341 <!-- Thrift Developers -->
342 <developer id="mcslee" name="Mark Slee"/>
343 <developer id="dreiss" name="David Reiss"/>
344 <developer id="aditya" name="Aditya Agarwal"/>
345 <developer id="marck" name="Marc Kwiatkowski"/>
346 <developer id="jwang" name="James Wang"/>
347 <developer id="cpiro" name="Chris Piro"/>
348 <developer id="bmaurer" name="Ben Maurer"/>
349 <developer id="kclark" name="Kevin Clark"/>
350 <developer id="jake" name="Jake Luciani"/>
351 <developer id="bryanduxbury" name="Bryan Duxbury"/>
352 <developer id="esteve" name="Esteve Fernandez"/>
353 <developer id="todd" name="Todd Lipcon"/>
354 <developer id="geechorama" name="Andrew McGeachie"/>
355 <developer id="molinaro" name="Anthony Molinaro"/>
356 <developer id="roger" name="Roger Meier"/>
Jake Farrell4b8faf92011-04-19 21:11:54 +0000357 <developer id="jfarrell" name="Jake Farrell"/>
Jens Geyer111d8f22013-06-03 16:49:55 +0200358 <developer id="jensg" name="Jens Geyer"/>
Carl Yeksigian350860f2013-06-01 22:48:52 -0400359 <developer id="carl" name="Carl Yeksigian"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000360
361 <!-- Thrift dependencies list -->
Jake Farrella0bd5232012-10-12 14:44:14 +0000362 <dependency groupId="org.slf4j" artifactId="slf4j-api" version="${slf4j.version}"/>
Jake Farrella0bd5232012-10-12 14:44:14 +0000363 <dependency groupId="javax.servlet" artifactId="servlet-api" version="${servlet.version}" scope="provided"/>
364 <dependency groupId="org.apache.httpcomponents" artifactId="httpclient" version="${httpclient.version}"/>
365 <dependency groupId="org.apache.httpcomponents" artifactId="httpcore" version="${httpcore.version}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000366 </artifact:pom>
367
368 <!-- Generate the pom file -->
369 <artifact:writepom pomRefId="pom" file="${pom.xml}"/>
370
371 <!-- Download the dependencies -->
372 <artifact:dependencies filesetId="build-dependency-jars" pomRefId="pom"/>
373
374 <!-- Copy the dependencies to the build/lib dir -->
375 <copy todir="${build.dir}/lib">
376 <fileset refid="build-dependency-jars"/>
377 <mapper type="flatten"/>
378 </copy>
379
Jake Farrell6ece9be2011-04-26 15:44:50 +0000380 <!-- Dependencies needed for testing -->
381 <artifact:dependencies filesetId="test-dependency-jars" useScope="runtime">
382 <dependency groupId="org.slf4j" artifactId="slf4j-log4j12" version="1.5.8"/>
383 <dependency groupId="junit" artifactId="junit" version="4.4"/>
384 </artifact:dependencies>
385
386 <!-- Copy the test dependencies to the build/lib dir -->
387 <copy todir="${build.dir}/lib">
388 <fileset refid="test-dependency-jars"/>
389 <mapper type="flatten"/>
390 </copy>
391
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000392 <property name="mvn.finished" value="true"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000393 </target>
394
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000395 <macrodef name="signAndDeploy">
396 <!-- Sign and deploy jars to apache repo -->
397 <attribute name="file"/>
398 <attribute name="classifier" default=""/>
399 <attribute name="packaging" default="jar"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000400 <attribute name="pom" default=""/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000401 <sequential>
402 <artifact:mvn fork="true">
403 <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/>
404 <arg value="-DrepositoryId=${maven-repository-id}"/>
405 <arg value="-Durl=${maven-repository-url}"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000406 <arg value="-DpomFile=@{pom}"/>
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000407 <arg value="-Dfile=@{file}"/>
408 <arg value="-Dclassifier=@{classifier}"/>
409 <arg value="-Dpackaging=@{packaging}"/>
410 <arg value="-Pgpg"/>
411 </artifact:mvn>
412 </sequential>
413 </macrodef>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000414
Bryan Duxbury55f7ffe2011-03-24 17:24:27 +0000415 <target name="publish" depends="clean,init,test,dist,javadoc,pack.src">
416 <!-- Compile, package, test and then send release to apache maven repo -->
417 <!-- run with: ant -Drelease=true publish-->
Jake Farrellc023d902011-05-20 19:04:13 +0000418 <signAndDeploy file="${pom.xml}" packaging="pom" classifier="" pom="${pom.xml}"/>
419 <signAndDeploy file="${jar.file}" packaging="jar" classifier="" pom="${pom.xml}"/>
420 <signAndDeploy file="${javadoc.jar.file}" packaging="jar" classifier="javadoc" pom="${pom.xml}"/>
421 <signAndDeploy file="${source.tar.gz}" packaging="src" classifier="tar.gz" pom="${pom.xml}"/>
Bryan Duxbury547edc72010-03-28 21:02:38 +0000422 </target>
Mark Slee83c52a82006-06-07 06:51:18 +0000423</project>