David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 2 | <!-- |
| 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 |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 10 | |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 11 | http://www.apache.org/licenses/LICENSE-2.0 |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 12 | |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 13 | 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 Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 19 | --> |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 20 | <project name="libthrift" default="dist" basedir="." |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 21 | xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 22 | |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 23 | <description>Thrift Build File</description> |
Bryan Duxbury | 2f45e78 | 2009-08-20 00:55:12 +0000 | [diff] [blame] | 24 | <property name="thrift.root" location="../../"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 25 | <property name="thrift.artifactid" value="libthrift"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 26 | |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 27 | <!-- Include the base properties file --> |
| 28 | <property file="${basedir}/build.properties" /> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 29 | |
| 30 | <property environment="env"/> |
| 31 | |
| 32 | <condition property="version" value="${thrift.version}"> |
| 33 | <isset property="release"/> |
| 34 | </condition> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 35 | <property name="version" value="${thrift.version}-snapshot"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 36 | |
| 37 | <property name="final.name" value="${thrift.artifactid}-${version}"/> |
| 38 | |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 39 | <property name="thrift.compiler" location="../../compiler/cpp/thrift"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 40 | <property name="src" location="${basedir}/src"/> |
| 41 | <property name="build.dir" location="${basedir}/build"/> |
| 42 | <property name="build.lib.dir" location="${build.dir}/lib"/> |
| 43 | <property name="build.tools.dir" location="${build.dir}/tools"/> |
| 44 | <property name="src.test" location="test"/> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 45 | <property name="javadoc.dir" location="${build.dir}/javadoc"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 46 | <property name="build.test.dir" location="${build.dir}/test"/> |
| 47 | <property name="test.thrift.home" location="${thrift.root}/test"/> |
| 48 | |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 49 | <property name="gen" location="gen-java"/> |
| 50 | <property name="genbean" location="gen-javabean"/> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 51 | <property name="genreuse" location="gen-javareuse"/> |
Roger Meier | e86428c | 2014-05-30 00:14:50 +0200 | [diff] [blame] | 52 | <property name="genfullcamel" location="gen-fullcamel"/> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 53 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 54 | <property name="jar.file" location="${build.dir}/${final.name}.jar"/> |
| 55 | <property name="test.jar.file" location="${build.dir}/${final.name}-test.jar"/> |
| 56 | <property name="javadoc.jar.file" location="${build.dir}/${final.name}-javadoc.jar"/> |
jfarrell | f231945 | 2014-10-08 23:24:37 -0400 | [diff] [blame] | 57 | <property name="source.jar.file" location="${build.dir}/${final.name}-sources.jar"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 58 | |
| 59 | <!-- Junit properties --> |
| 60 | <property name="test.junit.output.format" value="plain"/> |
| 61 | <property name="test.timeout" value="2000000"/> |
| 62 | <property name="test.src.dir" location="${basedir}/test"/> |
| 63 | <property name="test.log.dir" value="${build.test.dir}/log"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 64 | <property name="test.port" value="9090"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 65 | |
| 66 | <!-- maven properties --> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 67 | <property name="pom.xml" location="${build.dir}/${final.name}.pom"/> |
| 68 | |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 69 | <path id="compile.classpath"> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 70 | <fileset dir="${build.lib.dir}"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 71 | <include name="**/*.jar"/> |
| 72 | </fileset> |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 73 | </path> |
| 74 | |
| 75 | <path id="test.classpath"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 76 | <path refid="compile.classpath"/> |
| 77 | <pathelement path="${env.CLASSPATH}"/> |
| 78 | <pathelement location="${build.test.dir}"/> |
| 79 | <pathelement location="${jar.file}"/> |
| 80 | <pathelement location="${test.jar.file}"/> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 81 | |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 82 | </path> |
Bryan Duxbury | 538e344 | 2009-02-10 04:49:39 +0000 | [diff] [blame] | 83 | |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 84 | <!-- Tasks --> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 85 | <target name="init" depends="setup.init,mvn.init" unless="init.finished"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 86 | <property name="init.finished" value="true"/> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 87 | </target> |
| 88 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 89 | <target name="setup.init"> |
| 90 | <tstamp/> |
| 91 | <mkdir dir="${build.dir}"/> |
| 92 | <mkdir dir="${build.lib.dir}"/> |
| 93 | <mkdir dir="${build.tools.dir}"/> |
| 94 | <mkdir dir="${build.test.dir}"/> |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 95 | </target> |
| 96 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 97 | <target name="compile" depends="init"> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 98 | <javac compiler="modern" srcdir="${src}" destdir="${build.dir}" source="1.5" target="1.5" |
Roger Meier | f35975b | 2013-11-17 18:30:23 +0100 | [diff] [blame] | 99 | debug="true" classpathref="compile.classpath" includeantruntime="false" encoding="UTF-8"> |
jfarrell | 98d9ef2 | 2014-02-23 22:56:58 -0500 | [diff] [blame] | 100 | <compilerarg value="-Xlint:unchecked"/> |
Bryan Duxbury | bce6fad | 2011-08-24 00:22:30 +0000 | [diff] [blame] | 101 | </javac> |
David Reiss | 36a5a25 | 2009-04-29 23:20:56 +0000 | [diff] [blame] | 102 | </target> |
| 103 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 104 | <target name="javadoc" depends="init"> |
| 105 | <javadoc sourcepath="${src}" destdir="${javadoc.dir}" |
| 106 | version="true" windowtitle="Thrift Java API" doctitle="Thrift Java API" |
Bryan Duxbury | d8c7757 | 2010-07-29 19:30:47 +0000 | [diff] [blame] | 107 | classpathref="test.classpath"> |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 108 | </javadoc> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 109 | <jar jarfile="${javadoc.jar.file}" basedir="${javadoc.dir}"> |
| 110 | <manifest> |
| 111 | <attribute name="Implementation-Version" value="${version}"/> |
| 112 | </manifest> |
| 113 | </jar> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 114 | </target> |
| 115 | |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 116 | <target name="dist" depends="compile"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 117 | <mkdir dir="${build.dir}/META-INF"/> |
| 118 | <copy file="${thrift.root}/LICENSE" tofile="${build.dir}/META-INF/LICENSE.txt"/> |
| 119 | <copy file="${thrift.root}/NOTICE" tofile="${build.dir}/META-INF/NOTICE.txt"/> |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 120 | <jar jarfile="${jar.file}"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 121 | <manifest> |
| 122 | <attribute name="Implementation-Version" value="${version}"/> |
Jake Farrell | 34e1db4 | 2011-11-08 01:39:47 +0000 | [diff] [blame] | 123 | <attribute name="Bundle-ManifestVersion" value="2"/> |
| 124 | <attribute name="Bundle-SymbolicName" value="${thrift.groupid}"/> |
| 125 | <attribute name="Bundle-Name" value="Apache Thrift"/> |
| 126 | <attribute name="Bundle-Version" value="${version}"/> |
| 127 | <attribute name="Bundle-Description" value="Apache Thrift library"/> |
| 128 | <attribute name="Bundle-License" value="${license}"/> |
| 129 | <attribute name="Bundle-ActivationPolicy" value="lazy"/> |
jfarrell | 63ad5f6 | 2014-10-01 21:44:30 -0400 | [diff] [blame] | 130 | <attribute name="Export-Package" value="${thrift.groupid}.async;uses:="${thrift.groupid}.protocol,${thrift.groupid}.transport,org.slf4j,${thrift.groupid}";version="${version}",${thrift.groupid}.protocol;uses:="${thrift.groupid}.transport,${thrift.groupid},${thrift.groupid}.scheme";version="${version}",${thrift.groupid}.server;uses:="${thrift.groupid}.transport,${thrift.groupid}.protocol,${thrift.groupid},org.slf4j,javax.servlet,javax.servlet.http";version="${version}",${thrift.groupid}.transport;uses:="${thrift.groupid}.protocol,${thrift.groupid},org.apache.http.client,org.apache.http.params,org.apache.http.entity,org.apache.http.client.methods,org.apache.http,org.slf4j,javax.net.ssl,javax.net,javax.security.sasl,javax.security.auth.callback";version="${version}",${thrift.groupid};uses:="${thrift.groupid}.protocol,${thrift.groupid}.async,${thrift.groupid}.server,${thrift.groupid}.transport,org.slf4j,org.apache.log4j,${thrift.groupid}.scheme";version="${version}",${thrift.groupid}.meta_data;uses:="${thrift.groupid}";version="${version}",${thrift.groupid}.scheme;uses:="${thrift.groupid}.protocol,${thrift.groupid}";version="${version}""/> |
Roger Meier | ecc2a6b | 2015-07-16 23:48:39 +0200 | [diff] [blame] | 131 | <attribute name="Import-Package" value="javax.net,javax.net.ssl,javax.security.auth.callback,javax.security.sasl,javax.servlet;resolution:=optional,javax.servlet.http;resolution:=optional,org.slf4j;resolution:=optional;version="[1.4,2)",org.apache.http.client;resolution:=optional,org.apache.http.params;resolution:=optional,org.apache.http.entity;resolution:=optional,org.apache.http.client.methods;resolution:=optional,org.apache.http;resolution:=optional"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 132 | </manifest> |
| 133 | <fileset dir="${build.dir}"> |
| 134 | <include name="org/apache/thrift/**/*.class"/> |
| 135 | <include name="META-INF/*.txt"/> |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 136 | </fileset> |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 137 | </jar> |
| 138 | </target> |
| 139 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 140 | <target name="pack.src"> |
jfarrell | f231945 | 2014-10-08 23:24:37 -0400 | [diff] [blame] | 141 | <jar jarfile="${source.jar.file}"> |
| 142 | <fileset dir="${src}"> |
| 143 | <include name="**/*.java"/> |
| 144 | </fileset> |
| 145 | </jar> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 146 | </target> |
| 147 | |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 148 | <target name="install" depends="dist,javadoc"> |
David Reiss | 56c2c21 | 2009-06-04 02:05:25 +0000 | [diff] [blame] | 149 | <copy todir="${install.path}"> |
Jake Farrell | 73b8dfc | 2011-06-02 16:13:18 +0000 | [diff] [blame] | 150 | <fileset dir="${build.dir}" includes="*.jar"/> |
| 151 | <fileset dir="${build.lib.dir}" includes="*.jar"/> |
David Reiss | 56c2c21 | 2009-06-04 02:05:25 +0000 | [diff] [blame] | 152 | </copy> |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 153 | <copy todir="${install.javadoc.path}"> |
Jake Farrell | 73b8dfc | 2011-06-02 16:13:18 +0000 | [diff] [blame] | 154 | <fileset dir="${javadoc.dir}" includes="**/*"/> |
Bryan Duxbury | 32e04b4 | 2009-03-20 16:43:06 +0000 | [diff] [blame] | 155 | </copy> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 156 | </target> |
| 157 | |
| 158 | <target name="clean"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 159 | <delete dir="${build.dir}"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 160 | <delete dir="${gen}"/> |
| 161 | <delete dir="${genbean}"/> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 162 | <delete dir="${genreuse}"/> |
Roger Meier | e86428c | 2014-05-30 00:14:50 +0200 | [diff] [blame] | 163 | <delete dir="${genfullcamel}"/> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 164 | </target> |
| 165 | |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 166 | <target name="optional-generate" unless="no-gen-thrift"> |
Roger Meier | f42ce2a | 2013-01-16 22:12:14 +0100 | [diff] [blame] | 167 | <antcall target="generate"> |
| 168 | </antcall> |
| 169 | </target> |
| 170 | |
| 171 | <target name="compile-test" description="Build the test suite classes" depends="optional-generate,dist"> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 172 | <javac compiler="modern" debug="true" srcdir="${gen}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8"> |
Roger Meier | e242a96 | 2012-11-15 22:23:27 +0000 | [diff] [blame] | 173 | <compilerarg value="-Xlint:deprecation"/> |
| 174 | <!--<compilerarg value="-Xlint:unchecked"/>--> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 175 | </javac> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 176 | <javac compiler="modern" debug="true" srcdir="${genbean}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8"> |
Roger Meier | e242a96 | 2012-11-15 22:23:27 +0000 | [diff] [blame] | 177 | <compilerarg value="-Xlint:deprecation"/> |
| 178 | <!--<compilerarg value="-Xlint:unchecked"/>--> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 179 | </javac> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 180 | <javac compiler="modern" debug="true" srcdir="${genreuse}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8"> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 181 | <compilerarg value="-Xlint:deprecation"/> |
| 182 | <!--<compilerarg value="-Xlint:unchecked"/>--> |
| 183 | </javac> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 184 | <javac compiler="modern" debug="true" srcdir="${genfullcamel}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8"> |
Roger Meier | e86428c | 2014-05-30 00:14:50 +0200 | [diff] [blame] | 185 | <compilerarg value="-Xlint:deprecation"/> |
| 186 | <!--<compilerarg value="-Xlint:unchecked"/>--> |
| 187 | </javac> |
James E. King, III | cf25489 | 2017-01-25 20:34:04 -0500 | [diff] [blame] | 188 | <javac compiler="modern" debug="true" srcdir="${src.test}" destdir="${build.test.dir}" classpathref="test.classpath" includeantruntime="false" encoding="UTF-8"> |
Roger Meier | e242a96 | 2012-11-15 22:23:27 +0000 | [diff] [blame] | 189 | <compilerarg value="-Xlint:deprecation"/> |
| 190 | <!--<compilerarg value="-Xlint:unchecked"/>--> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 191 | </javac> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 192 | <copy todir="${build.test.dir}"> |
| 193 | <fileset dir="${src.test}" includes="log4j.properties"/> |
Todd Lipcon | fcaa8f5 | 2010-09-27 23:51:22 +0000 | [diff] [blame] | 194 | </copy> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 195 | <jar jarfile="${test.jar.file}" basedir="${build.test.dir}"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 196 | </target> |
| 197 | |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 198 | <target name="junit-test" description="Run the JUnit test suite" depends="compile-test"> |
| 199 | <mkdir dir="${test.log.dir}"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 200 | <junit printsummary="true" showoutput="${test.output}" timeout="${test.timeout}" |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 201 | haltonfailure="true" errorProperty="tests.failed" failureProperty="tests.failed" |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 202 | fork="true" forkmode="perTest" maxmemory="512m" |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 203 | > |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 204 | <sysproperty key="build.test" value="${build.test.dir}"/> |
| 205 | <sysproperty key="test.port" value="${test.port}"/> |
Bryan Duxbury | 1b13083 | 2010-10-19 17:20:57 +0000 | [diff] [blame] | 206 | <sysproperty key="javax.net.ssl.trustStore" value="${src.test}/.truststore"/> |
| 207 | <sysproperty key="javax.net.ssl.trustStorePassword" value="thrift"/> |
| 208 | <sysproperty key="javax.net.ssl.keyStore" value="${src.test}/.keystore"/> |
| 209 | <sysproperty key="javax.net.ssl.keyStorePassword" value="thrift"/> |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 210 | <classpath refid="test.classpath"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 211 | <formatter type="${test.junit.output.format}"/> |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 212 | <batchtest todir="${test.log.dir}" unless="testcase"> |
Roger Meier | 5013de2 | 2010-10-25 19:57:26 +0000 | [diff] [blame] | 213 | <fileset dir="${test.src.dir}"> |
| 214 | <include name="**/Test*.java"/> |
| 215 | <exclude name="**/TestClient.java"/> |
| 216 | <exclude name="**/TestServer.java"/> |
| 217 | <exclude name="**/TestNonblockingServer.java"/> |
| 218 | </fileset> |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 219 | </batchtest> |
| 220 | <batchtest todir="${test.log.dir}" if="testcase"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 221 | <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/> |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 222 | </batchtest> |
| 223 | </junit> |
| 224 | <fail if="tests.failed">Tests failed!</fail> |
| 225 | </target> |
| 226 | |
| 227 | <target name="deprecated-test" description="Run the non-JUnit test suite" depends="compile-test"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 228 | <java classname="org.apache.thrift.test.EqualityTest" classpathref="test.classpath" failonerror="true"/> |
| 229 | <java classname="org.apache.thrift.test.JavaBeansTest" classpathref="test.classpath" failonerror="true"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 230 | </target> |
| 231 | |
Bryan Duxbury | 951e7e2 | 2010-03-26 05:05:59 +0000 | [diff] [blame] | 232 | <target name="test" description="Run the full test suite" depends="junit-test,deprecated-test"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 233 | |
henrique | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 234 | <target name="testclient" description="Run a test client" depends="compile-test, run-testclient"/> |
| 235 | <target name="run-testclient" description="Run a test client"> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 236 | <java classname="org.apache.thrift.test.TestClient" |
Roger Meier | f42ce2a | 2013-01-16 22:12:14 +0100 | [diff] [blame] | 237 | classpathref="test.classpath" failonerror="true" fork="true"> |
| 238 | <sysproperty key="javax.net.ssl.trustStore" value="${src.test}/.truststore"/> |
| 239 | <sysproperty key="javax.net.ssl.trustStorePassword" value="thrift"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 240 | <arg line="${testargs}"/> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 241 | </java> |
| 242 | </target> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 243 | |
henrique | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 244 | <target name="testserver" description="Run a test server" depends="compile-test, run-testserver"/> |
| 245 | <target name="run-testserver" description="Run a test server"> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 246 | <java classname="org.apache.thrift.test.TestServer" |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 247 | classpathref="test.classpath" failonerror="true" fork="true"> |
Roger Meier | f42ce2a | 2013-01-16 22:12:14 +0100 | [diff] [blame] | 248 | <sysproperty key="javax.net.ssl.keyStore" value="${src.test}/.keystore"/> |
| 249 | <sysproperty key="javax.net.ssl.keyStorePassword" value="thrift"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 250 | <arg line="${testargs}"/> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 251 | </java> |
| 252 | </target> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 253 | |
henrique | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 254 | <target name="testnonblockingserver" description="Run a test nonblocking server" depends="compile-test, run-testnonblockingserver"/> |
| 255 | <target name="run-testnonblockingserver" description="Run a test nonblocking server"> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 256 | <java classname="org.apache.thrift.test.TestNonblockingServer" |
| 257 | classpathref="test.classpath" failonerror="true"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 258 | <arg line="${testargs}"/> |
David Reiss | 2727fab | 2009-12-09 19:30:01 +0000 | [diff] [blame] | 259 | </java> |
| 260 | </target> |
| 261 | |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 262 | <target name="generate"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 263 | <!-- Generate the thrift gen-java source --> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 264 | <exec executable="${thrift.compiler}" failonerror="true"> |
Jens Geyer | 4733c4c | 2016-02-13 23:48:20 +0100 | [diff] [blame] | 265 | <arg line="--gen java ${test.thrift.home}/ThriftTest.thrift"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 266 | </exec> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 267 | <exec executable="${thrift.compiler}" failonerror="true"> |
BCG | 7ab125a | 2016-10-31 23:32:18 -0400 | [diff] [blame] | 268 | <arg line="--gen java ${test.thrift.home}/JavaTypes.thrift"/> |
| 269 | </exec> |
| 270 | <exec executable="${thrift.compiler}" failonerror="true"> |
Jens Geyer | 4733c4c | 2016-02-13 23:48:20 +0100 | [diff] [blame] | 271 | <arg line="--gen java ${test.thrift.home}/DebugProtoTest.thrift"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 272 | </exec> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 273 | <exec executable="${thrift.compiler}" failonerror="true"> |
Jens Geyer | 4733c4c | 2016-02-13 23:48:20 +0100 | [diff] [blame] | 274 | <arg line="--gen java ${test.thrift.home}/OptionalRequiredTest.thrift"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 275 | </exec> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 276 | <exec executable="${thrift.compiler}" failonerror="true"> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 277 | <arg line="--gen java:beans,nocamel ${test.thrift.home}/JavaBeansTest.thrift"/> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 278 | </exec> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 279 | <exec executable="${thrift.compiler}" failonerror="true"> |
Jens Geyer | 4733c4c | 2016-02-13 23:48:20 +0100 | [diff] [blame] | 280 | <arg line="--gen java ${test.thrift.home}/ManyOptionals.thrift"/> |
Bryan Duxbury | 1e79cb4 | 2011-12-21 18:13:29 +0000 | [diff] [blame] | 281 | </exec> |
Gary Gregory | fd83224 | 2016-11-10 11:35:46 -0800 | [diff] [blame] | 282 | <mkdir dir="${genfullcamel}"/> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 283 | <exec executable="${thrift.compiler}" failonerror="true"> |
Jens Geyer | 4733c4c | 2016-02-13 23:48:20 +0100 | [diff] [blame] | 284 | <arg line="--gen java:fullcamel -out ${genfullcamel} ${test.thrift.home}/FullCamelTest.thrift"/> |
Roger Meier | e86428c | 2014-05-30 00:14:50 +0200 | [diff] [blame] | 285 | </exec> |
Gary Gregory | fd83224 | 2016-11-10 11:35:46 -0800 | [diff] [blame] | 286 | <mkdir dir="${genreuse}"/> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 287 | <exec executable="${thrift.compiler}" failonerror="true"> |
henrique | d7902bf | 2014-03-31 16:21:37 +0200 | [diff] [blame] | 288 | <arg line="--gen java:reuse-objects -out ${genreuse} ${test.thrift.home}/ReuseObjects.thrift"/> |
| 289 | </exec> |
Deniss Afonin | 3311a9b | 2017-04-18 19:27:49 +0300 | [diff] [blame] | 290 | <exec executable="${thrift.compiler}" failonerror="true"> |
| 291 | <arg line="--gen java ${test.thrift.home}/JavaDeepCopyTest.thrift"/> |
| 292 | </exec> |
Deniss Afonin | d3cda9c | 2017-04-17 23:53:16 +0300 | [diff] [blame] | 293 | <exec executable="${thrift.compiler}" failonerror="true"> |
| 294 | <arg line="--gen java ${test.thrift.home}/EnumContainersTest.thrift"/> |
| 295 | </exec> |
Bryan Duxbury | 249d7cb | 2009-01-29 01:21:20 +0000 | [diff] [blame] | 296 | </target> |
| 297 | |
Bryan Duxbury | 35dd47b | 2011-06-23 22:21:20 +0000 | [diff] [blame] | 298 | <target name="proxy" if="proxy.enabled"> |
| 299 | <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" |
| 300 | proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/> |
| 301 | </target> |
| 302 | |
| 303 | <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check,proxy" unless="mvn.ant.tasks.found"> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 304 | <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/> |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 305 | </target> |
| 306 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 307 | <target name="mvn.ant.tasks.check"> |
| 308 | <condition property="mvn.ant.tasks.found"> |
| 309 | <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> |
| 310 | </condition> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 311 | </target> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 312 | |
| 313 | <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished"> |
| 314 | <!-- Download mvn ant tasks, download dependencies, and setup pom file --> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 315 | <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 316 | |
| 317 | <!-- remote repositories used to download dependencies from --> |
| 318 | <artifact:remoteRepository id="central" url="${mvn.repo}"/> |
| 319 | <artifact:remoteRepository id="apache" url="${apache.repo}"/> |
| 320 | |
| 321 | <!-- Pom file information --> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 322 | <artifact:pom id="pom" |
| 323 | groupId="${thrift.groupid}" |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 324 | artifactId="${thrift.artifactid}" |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 325 | version="${version}" |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 326 | url="http://thrift.apache.org" |
| 327 | name="Apache Thrift" |
| 328 | description="Thrift is a software framework for scalable cross-language services development." |
| 329 | packaging="pom" |
| 330 | > |
| 331 | <remoteRepository refid="central"/> |
| 332 | <remoteRepository refid="apache"/> |
| 333 | <license name="The Apache Software License, Version 2.0" url="${license}"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 334 | <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" |
Roger Meier | 565517a | 2013-03-22 21:08:39 +0100 | [diff] [blame] | 335 | developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" |
| 336 | url="https://git-wip-us.apache.org/repos/asf?p=thrift.git" |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 337 | /> |
| 338 | <!-- Thrift Developers --> |
| 339 | <developer id="mcslee" name="Mark Slee"/> |
| 340 | <developer id="dreiss" name="David Reiss"/> |
| 341 | <developer id="aditya" name="Aditya Agarwal"/> |
| 342 | <developer id="marck" name="Marc Kwiatkowski"/> |
| 343 | <developer id="jwang" name="James Wang"/> |
| 344 | <developer id="cpiro" name="Chris Piro"/> |
| 345 | <developer id="bmaurer" name="Ben Maurer"/> |
| 346 | <developer id="kclark" name="Kevin Clark"/> |
| 347 | <developer id="jake" name="Jake Luciani"/> |
| 348 | <developer id="bryanduxbury" name="Bryan Duxbury"/> |
| 349 | <developer id="esteve" name="Esteve Fernandez"/> |
| 350 | <developer id="todd" name="Todd Lipcon"/> |
| 351 | <developer id="geechorama" name="Andrew McGeachie"/> |
| 352 | <developer id="molinaro" name="Anthony Molinaro"/> |
| 353 | <developer id="roger" name="Roger Meier"/> |
Jake Farrell | 4b8faf9 | 2011-04-19 21:11:54 +0000 | [diff] [blame] | 354 | <developer id="jfarrell" name="Jake Farrell"/> |
Jens Geyer | 111d8f2 | 2013-06-03 16:49:55 +0200 | [diff] [blame] | 355 | <developer id="jensg" name="Jens Geyer"/> |
Carl Yeksigian | 350860f | 2013-06-01 22:48:52 -0400 | [diff] [blame] | 356 | <developer id="carl" name="Carl Yeksigian"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 357 | |
| 358 | <!-- Thrift dependencies list --> |
Jake Farrell | a0bd523 | 2012-10-12 14:44:14 +0000 | [diff] [blame] | 359 | <dependency groupId="org.slf4j" artifactId="slf4j-api" version="${slf4j.version}"/> |
Jake Farrell | a0bd523 | 2012-10-12 14:44:14 +0000 | [diff] [blame] | 360 | <dependency groupId="javax.servlet" artifactId="servlet-api" version="${servlet.version}" scope="provided"/> |
| 361 | <dependency groupId="org.apache.httpcomponents" artifactId="httpclient" version="${httpclient.version}"/> |
| 362 | <dependency groupId="org.apache.httpcomponents" artifactId="httpcore" version="${httpcore.version}"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 363 | </artifact:pom> |
| 364 | |
| 365 | <!-- Generate the pom file --> |
| 366 | <artifact:writepom pomRefId="pom" file="${pom.xml}"/> |
| 367 | |
| 368 | <!-- Download the dependencies --> |
| 369 | <artifact:dependencies filesetId="build-dependency-jars" pomRefId="pom"/> |
| 370 | |
| 371 | <!-- Copy the dependencies to the build/lib dir --> |
| 372 | <copy todir="${build.dir}/lib"> |
| 373 | <fileset refid="build-dependency-jars"/> |
| 374 | <mapper type="flatten"/> |
| 375 | </copy> |
| 376 | |
Jake Farrell | 6ece9be | 2011-04-26 15:44:50 +0000 | [diff] [blame] | 377 | <!-- Dependencies needed for testing --> |
| 378 | <artifact:dependencies filesetId="test-dependency-jars" useScope="runtime"> |
Nobuaki Sukegawa | aa7d0d5 | 2016-02-27 03:04:34 +0900 | [diff] [blame] | 379 | <dependency groupId="org.slf4j" artifactId="slf4j-log4j12" version="${slf4j.version}"/> |
Jake Farrell | 6ece9be | 2011-04-26 15:44:50 +0000 | [diff] [blame] | 380 | <dependency groupId="junit" artifactId="junit" version="4.4"/> |
Aleksey Pesternikov | 400b346 | 2014-05-01 13:58:18 -0700 | [diff] [blame] | 381 | <dependency groupId="org.mockito" artifactId="mockito-all" version="1.9.5"/> |
Jake Farrell | 6ece9be | 2011-04-26 15:44:50 +0000 | [diff] [blame] | 382 | </artifact:dependencies> |
| 383 | |
| 384 | <!-- Copy the test dependencies to the build/lib dir --> |
| 385 | <copy todir="${build.dir}/lib"> |
| 386 | <fileset refid="test-dependency-jars"/> |
| 387 | <mapper type="flatten"/> |
| 388 | </copy> |
| 389 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 390 | <property name="mvn.finished" value="true"/> |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 391 | </target> |
| 392 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 393 | <macrodef name="signAndDeploy"> |
| 394 | <!-- Sign and deploy jars to apache repo --> |
| 395 | <attribute name="file"/> |
| 396 | <attribute name="classifier" default=""/> |
| 397 | <attribute name="packaging" default="jar"/> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 398 | <attribute name="pom" default=""/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 399 | <sequential> |
| 400 | <artifact:mvn fork="true"> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 401 | <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 402 | <arg value="-DrepositoryId=${maven-repository-id}"/> |
| 403 | <arg value="-Durl=${maven-repository-url}"/> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 404 | <arg value="-DpomFile=@{pom}"/> |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 405 | <arg value="-Dfile=@{file}"/> |
| 406 | <arg value="-Dclassifier=@{classifier}"/> |
| 407 | <arg value="-Dpackaging=@{packaging}"/> |
| 408 | <arg value="-Pgpg"/> |
| 409 | </artifact:mvn> |
| 410 | </sequential> |
| 411 | </macrodef> |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 412 | |
Bryan Duxbury | 55f7ffe | 2011-03-24 17:24:27 +0000 | [diff] [blame] | 413 | <target name="publish" depends="clean,init,test,dist,javadoc,pack.src"> |
| 414 | <!-- Compile, package, test and then send release to apache maven repo --> |
| 415 | <!-- run with: ant -Drelease=true publish--> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 416 | <signAndDeploy file="${pom.xml}" packaging="pom" classifier="" pom="${pom.xml}"/> |
jfarrell | 400d02c | 2015-08-25 01:14:12 -0400 | [diff] [blame] | 417 | <signAndDeploy file="${jar.file}" classifier="" pom="${pom.xml}"/> |
| 418 | <signAndDeploy file="${javadoc.jar.file}" classifier="javadoc" pom="${pom.xml}"/> |
| 419 | <signAndDeploy file="${source.jar.file}" classifier="sources" pom="${pom.xml}"/> |
Bryan Duxbury | 547edc7 | 2010-03-28 21:02:38 +0000 | [diff] [blame] | 420 | </target> |
Mark Slee | 83c52a8 | 2006-06-07 06:51:18 +0000 | [diff] [blame] | 421 | </project> |