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