Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 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 |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 10 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 11 | http://www.apache.org/licenses/LICENSE-2.0 |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 12 | |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +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 | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 19 | --> |
| 20 | <project name="libthrift-as3" default="compile" basedir="." |
| 21 | xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 22 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 23 | <property name="as3.artifactid" value="${ant.project.name}"/> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 24 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 25 | <property name="thrift.root" location="${basedir}/../../"/> |
| 26 | <property name="thrift.java.dir" location="${thrift.root}/lib/java"/> |
| 27 | <property name="build.tools.dir" location="${thrift.java.dir}/build/tools/"/> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 28 | <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/> |
| 29 | <property file="${basedir}/build.properties"/> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 30 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 31 | <!-- inherit from the java build file for version and other properties --> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 32 | <property file="${thrift.java.dir}/gradle.properties" /> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 33 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 34 | <property environment="env"/> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 35 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 36 | <condition property="version" value="${thrift.version}"> |
| 37 | <isset property="release"/> |
| 38 | </condition> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 39 | <property name="version" value="${thrift.version}-SNAPSHOT"/> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 40 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 41 | <property name="as3.final.name" value="${as3.artifactid}-${version}"/> |
| 42 | |
| 43 | <property name="src" value="${basedir}/src"/> |
| 44 | <property name="build.dir" value="${basedir}/build"/> |
| 45 | |
| 46 | <property name="as3.swc.file" location="${build.dir}/${as3.final.name}.swc"/> |
| 47 | <property name="as3.pom.xml" location="${build.dir}/${as3.final.name}.pom"/> |
| 48 | |
| 49 | <target name="init" depends="setup.init,flex.init" unless="init.finished"> |
| 50 | <property name="init.finished" value="true"/> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 51 | </target> |
| 52 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 53 | <target name="setup.init"> |
| 54 | <tstamp/> |
| 55 | <mkdir dir="${build.dir}"/> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 56 | <mkdir dir="${build.tools.dir}"/> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 57 | </target> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 58 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 59 | <target name="flex.check" unless="FLEX_HOME"> |
| 60 | <fail message='You must set the FLEX_HOME property pointing to your flex SDK, eg. ant -DFLEX_HOME="/Applications/Adobe Flex Builder 3/sdks/3.2.0"'/> |
| 61 | </target> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 62 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 63 | <target name="flex.init" depends="flex.check" unless="flex.finished"> |
| 64 | <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" /> |
| 65 | <property name="flex.finished" value="true"/> |
| 66 | </target> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 67 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 68 | <target name="compile" depends="init"> |
| 69 | <path id="as.src.files"> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 70 | <fileset dir="${src}/"> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 71 | <include name="**/*.as"/> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 72 | </fileset> |
| 73 | </path> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 74 | <pathconvert |
| 75 | property="as.src.classes" |
| 76 | pathsep=" " |
| 77 | dirsep="." |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 78 | refid="as.src.files" |
| 79 | > |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 80 | <map from="${src}/" to=""/> |
| 81 | <mapper type="glob" from="*.as" to="*"/> |
| 82 | </pathconvert> |
| 83 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 84 | <compc output="${as3.swc.file}" include-classes="${as.src.classes}"> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 85 | <source-path path-element="${src}"/> |
| 86 | </compc> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 87 | </target> |
| 88 | |
| 89 | <target name="clean"> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 90 | <delete dir="${build.dir}" /> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 91 | </target> |
| 92 | |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 93 | <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check" unless="mvn.ant.tasks.found"> |
| 94 | <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/> |
| 95 | </target> |
| 96 | |
| 97 | <target name="mvn.ant.tasks.check"> |
| 98 | <condition property="mvn.ant.tasks.found"> |
| 99 | <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> |
| 100 | </condition> |
| 101 | </target> |
| 102 | |
| 103 | <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished"> |
| 104 | <echo message="${mvn.ant.task.jar}"/> |
| 105 | <!-- Download mvn ant tasks, download dependencies, and setup pom file --> |
| 106 | <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/> |
| 107 | |
| 108 | <!-- remote repositories used to download dependencies from --> |
| 109 | <artifact:remoteRepository id="central" url="${mvn.repo}"/> |
| 110 | <artifact:remoteRepository id="apache" url="${apache.repo}"/> |
| 111 | |
| 112 | <!-- Pom file information --> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 113 | <artifact:pom id="pom" |
| 114 | groupId="${thrift.groupid}" |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 115 | artifactId="${as3.artifactid}" |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 116 | version="${version}" |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 117 | url="http://thrift.apache.org" |
| 118 | name="Apache Thrift" |
| 119 | description="Thrift is a software framework for scalable cross-language services development." |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 120 | packaging="swc" |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 121 | > |
| 122 | <remoteRepository refid="central"/> |
| 123 | <remoteRepository refid="apache"/> |
| 124 | <license name="The Apache Software License, Version 2.0" url="${license}"/> |
Robert Lu | a139082 | 2018-12-27 23:57:35 +0800 | [diff] [blame^] | 125 | <scm connection="scm:git:https://github.com/apache/thrift.git" |
| 126 | developerConnection="scm:git:https://github.com/apache/thrift.git" |
| 127 | url="https://github.com/apache/thrift" |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 128 | /> |
| 129 | <!-- Thrift Developers --> |
| 130 | <developer id="mcslee" name="Mark Slee"/> |
| 131 | <developer id="dreiss" name="David Reiss"/> |
| 132 | <developer id="aditya" name="Aditya Agarwal"/> |
| 133 | <developer id="marck" name="Marc Kwiatkowski"/> |
| 134 | <developer id="jwang" name="James Wang"/> |
| 135 | <developer id="cpiro" name="Chris Piro"/> |
| 136 | <developer id="bmaurer" name="Ben Maurer"/> |
| 137 | <developer id="kclark" name="Kevin Clark"/> |
| 138 | <developer id="jake" name="Jake Luciani"/> |
| 139 | <developer id="bryanduxbury" name="Bryan Duxbury"/> |
| 140 | <developer id="esteve" name="Esteve Fernandez"/> |
| 141 | <developer id="todd" name="Todd Lipcon"/> |
| 142 | <developer id="geechorama" name="Andrew McGeachie"/> |
| 143 | <developer id="molinaro" name="Anthony Molinaro"/> |
| 144 | <developer id="roger" name="Roger Meier"/> |
| 145 | <developer id="jfarrell" name="Jake Farrell"/> |
Jens Geyer | 111d8f2 | 2013-06-03 16:49:55 +0200 | [diff] [blame] | 146 | <developer id="jensg" name="Jens Geyer"/> |
Carl Yeksigian | 350860f | 2013-06-01 22:48:52 -0400 | [diff] [blame] | 147 | <developer id="carl" name="Carl Yeksigian"/> |
Jake Farrell | c023d90 | 2011-05-20 19:04:13 +0000 | [diff] [blame] | 148 | </artifact:pom> |
| 149 | |
| 150 | <!-- Generate the pom file --> |
| 151 | <artifact:writepom pomRefId="pom" file="${as3.pom.xml}"/> |
| 152 | |
| 153 | <property name="mvn.finished" value="true"/> |
| 154 | </target> |
| 155 | |
| 156 | <macrodef name="signAndDeploy"> |
| 157 | <!-- Sign and deploy jars to apache repo --> |
| 158 | <attribute name="file"/> |
| 159 | <attribute name="classifier" default=""/> |
| 160 | <attribute name="packaging" default="jar"/> |
| 161 | <attribute name="pom" default=""/> |
| 162 | <sequential> |
| 163 | <artifact:mvn fork="true"> |
| 164 | <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/> |
| 165 | <arg value="-DrepositoryId=${maven-repository-id}"/> |
| 166 | <arg value="-Durl=${maven-repository-url}"/> |
| 167 | <arg value="-DpomFile=@{pom}"/> |
| 168 | <arg value="-Dfile=@{file}"/> |
| 169 | <arg value="-Dclassifier=@{classifier}"/> |
| 170 | <arg value="-Dpackaging=@{packaging}"/> |
| 171 | <arg value="-Pgpg"/> |
| 172 | </artifact:mvn> |
| 173 | </sequential> |
| 174 | </macrodef> |
| 175 | |
| 176 | <target name="publish" depends="clean,compile,mvn.init"> |
| 177 | <!-- Compile, packages and then send release to apache maven repo --> |
| 178 | <!-- run with: ant -Drelease=true publish --> |
| 179 | <signAndDeploy file="${as3.pom.xml}" packaging="pom" classifier="" pom="${as3.pom.xml}"/> |
| 180 | <signAndDeploy file="${as3.swc.file}" packaging="swc" classifier="" pom="${as3.pom.xml}"/> |
Alex Volanis | 7004a61 | 2018-01-24 10:30:13 -0500 | [diff] [blame] | 181 | </target> |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 182 | </project> |