blob: b0c4c858ddfcd4e1efae38001a62fc1f307e1c86 [file] [log] [blame]
Bryan Duxbury321eb7a2010-04-22 21:17:39 +00001<?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 Volanis7004a612018-01-24 10:30:13 -050010
Jake Farrellc023d902011-05-20 19:04:13 +000011 http://www.apache.org/licenses/LICENSE-2.0
Alex Volanis7004a612018-01-24 10:30:13 -050012
Bryan Duxbury321eb7a2010-04-22 21:17:39 +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 Farrellc023d902011-05-20 19:04:13 +000019 -->
20<project name="libthrift-as3" default="compile" basedir="."
21 xmlns:artifact="antlib:org.apache.maven.artifact.ant">
Alex Volanis7004a612018-01-24 10:30:13 -050022
Jake Farrellc023d902011-05-20 19:04:13 +000023 <property name="as3.artifactid" value="${ant.project.name}"/>
Alex Volanis7004a612018-01-24 10:30:13 -050024
Jake Farrellc023d902011-05-20 19:04:13 +000025 <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 Volanis7004a612018-01-24 10:30:13 -050028 <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/>
29 <property file="${basedir}/build.properties"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000030
Jake Farrellc023d902011-05-20 19:04:13 +000031 <!-- inherit from the java build file for version and other properties -->
Alex Volanis7004a612018-01-24 10:30:13 -050032 <property file="${thrift.java.dir}/gradle.properties" />
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000033
Jake Farrellc023d902011-05-20 19:04:13 +000034 <property environment="env"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000035
Jake Farrellc023d902011-05-20 19:04:13 +000036 <condition property="version" value="${thrift.version}">
37 <isset property="release"/>
38 </condition>
Alex Volanis7004a612018-01-24 10:30:13 -050039 <property name="version" value="${thrift.version}-SNAPSHOT"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000040
Jake Farrellc023d902011-05-20 19:04:13 +000041 <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 Duxbury321eb7a2010-04-22 21:17:39 +000051 </target>
52
Jake Farrellc023d902011-05-20 19:04:13 +000053 <target name="setup.init">
54 <tstamp/>
55 <mkdir dir="${build.dir}"/>
Alex Volanis7004a612018-01-24 10:30:13 -050056 <mkdir dir="${build.tools.dir}"/>
Jake Farrellc023d902011-05-20 19:04:13 +000057 </target>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000058
Jake Farrellc023d902011-05-20 19:04:13 +000059 <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 Volanis7004a612018-01-24 10:30:13 -050062
Jake Farrellc023d902011-05-20 19:04:13 +000063 <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 Duxbury321eb7a2010-04-22 21:17:39 +000067
Jake Farrellc023d902011-05-20 19:04:13 +000068 <target name="compile" depends="init">
69 <path id="as.src.files">
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000070 <fileset dir="${src}/">
Jake Farrellc023d902011-05-20 19:04:13 +000071 <include name="**/*.as"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000072 </fileset>
73 </path>
Alex Volanis7004a612018-01-24 10:30:13 -050074 <pathconvert
75 property="as.src.classes"
76 pathsep=" "
77 dirsep="."
Jake Farrellc023d902011-05-20 19:04:13 +000078 refid="as.src.files"
79 >
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000080 <map from="${src}/" to=""/>
81 <mapper type="glob" from="*.as" to="*"/>
82 </pathconvert>
83
Jake Farrellc023d902011-05-20 19:04:13 +000084 <compc output="${as3.swc.file}" include-classes="${as.src.classes}">
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000085 <source-path path-element="${src}"/>
86 </compc>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000087 </target>
88
89 <target name="clean">
Jake Farrellc023d902011-05-20 19:04:13 +000090 <delete dir="${build.dir}" />
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000091 </target>
92
Jake Farrellc023d902011-05-20 19:04:13 +000093 <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 Volanis7004a612018-01-24 10:30:13 -0500113 <artifact:pom id="pom"
114 groupId="${thrift.groupid}"
Jake Farrellc023d902011-05-20 19:04:13 +0000115 artifactId="${as3.artifactid}"
Alex Volanis7004a612018-01-24 10:30:13 -0500116 version="${version}"
Jake Farrellc023d902011-05-20 19:04:13 +0000117 url="http://thrift.apache.org"
118 name="Apache Thrift"
119 description="Thrift is a software framework for scalable cross-language services development."
Alex Volanis7004a612018-01-24 10:30:13 -0500120 packaging="swc"
Jake Farrellc023d902011-05-20 19:04:13 +0000121 >
122 <remoteRepository refid="central"/>
123 <remoteRepository refid="apache"/>
124 <license name="The Apache Software License, Version 2.0" url="${license}"/>
Robert Lua1390822018-12-27 23:57:35 +0800125 <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 Farrellc023d902011-05-20 19:04:13 +0000128 />
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 Geyer111d8f22013-06-03 16:49:55 +0200146 <developer id="jensg" name="Jens Geyer"/>
Carl Yeksigian350860f2013-06-01 22:48:52 -0400147 <developer id="carl" name="Carl Yeksigian"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000148 </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 Volanis7004a612018-01-24 10:30:13 -0500181 </target>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +0000182</project>