blob: 604da42e530927207259c0ab004174fbdcc44ccc [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
Jake Farrellc023d902011-05-20 19:04:13 +000010
11 http://www.apache.org/licenses/LICENSE-2.0
12
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">
22
23 <property name="as3.artifactid" value="${ant.project.name}"/>
24
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/"/>
28 <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000029
Jake Farrellc023d902011-05-20 19:04:13 +000030 <!-- inherit from the java build file for version and other properties -->
31 <property file="${thrift.java.dir}/build.properties" />
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000032
Jake Farrellc023d902011-05-20 19:04:13 +000033 <property environment="env"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000034
Jake Farrellc023d902011-05-20 19:04:13 +000035 <condition property="version" value="${thrift.version}">
36 <isset property="release"/>
37 </condition>
38 <property name="version" value="${thrift.version}-snapshot"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000039
Jake Farrellc023d902011-05-20 19:04:13 +000040 <property name="as3.final.name" value="${as3.artifactid}-${version}"/>
41
42 <property name="src" value="${basedir}/src"/>
43 <property name="build.dir" value="${basedir}/build"/>
44
45 <property name="as3.swc.file" location="${build.dir}/${as3.final.name}.swc"/>
46 <property name="as3.pom.xml" location="${build.dir}/${as3.final.name}.pom"/>
47
48 <target name="init" depends="setup.init,flex.init" unless="init.finished">
49 <property name="init.finished" value="true"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000050 </target>
51
Jake Farrellc023d902011-05-20 19:04:13 +000052 <target name="setup.init">
53 <tstamp/>
54 <mkdir dir="${build.dir}"/>
55 </target>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000056
Jake Farrellc023d902011-05-20 19:04:13 +000057 <target name="flex.check" unless="FLEX_HOME">
58 <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"'/>
59 </target>
60
61 <target name="flex.init" depends="flex.check" unless="flex.finished">
62 <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
63 <property name="flex.finished" value="true"/>
64 </target>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000065
Jake Farrellc023d902011-05-20 19:04:13 +000066 <target name="compile" depends="init">
67 <path id="as.src.files">
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000068 <fileset dir="${src}/">
Jake Farrellc023d902011-05-20 19:04:13 +000069 <include name="**/*.as"/>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000070 </fileset>
71 </path>
72 <pathconvert
Jake Farrellc023d902011-05-20 19:04:13 +000073 property="as.src.classes"
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000074 pathsep=" "
75 dirsep="."
Jake Farrellc023d902011-05-20 19:04:13 +000076 refid="as.src.files"
77 >
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000078 <map from="${src}/" to=""/>
79 <mapper type="glob" from="*.as" to="*"/>
80 </pathconvert>
81
Jake Farrellc023d902011-05-20 19:04:13 +000082 <compc output="${as3.swc.file}" include-classes="${as.src.classes}">
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000083 <source-path path-element="${src}"/>
84 </compc>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000085 </target>
86
87 <target name="clean">
Jake Farrellc023d902011-05-20 19:04:13 +000088 <delete dir="${build.dir}" />
Bryan Duxbury321eb7a2010-04-22 21:17:39 +000089 </target>
90
Jake Farrellc023d902011-05-20 19:04:13 +000091 <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check" unless="mvn.ant.tasks.found">
92 <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
93 </target>
94
95 <target name="mvn.ant.tasks.check">
96 <condition property="mvn.ant.tasks.found">
97 <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
98 </condition>
99 </target>
100
101 <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
102 <echo message="${mvn.ant.task.jar}"/>
103 <!-- Download mvn ant tasks, download dependencies, and setup pom file -->
104 <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
105
106 <!-- remote repositories used to download dependencies from -->
107 <artifact:remoteRepository id="central" url="${mvn.repo}"/>
108 <artifact:remoteRepository id="apache" url="${apache.repo}"/>
109
110 <!-- Pom file information -->
111 <artifact:pom id="pom"
112 groupId="${thrift.groupid}"
113 artifactId="${as3.artifactid}"
114 version="${version}"
115 url="http://thrift.apache.org"
116 name="Apache Thrift"
117 description="Thrift is a software framework for scalable cross-language services development."
118 packaging="pom"
119 >
120 <remoteRepository refid="central"/>
121 <remoteRepository refid="apache"/>
122 <license name="The Apache Software License, Version 2.0" url="${license}"/>
Roger Meier565517a2013-03-22 21:08:39 +0100123 <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
124 developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
125 url="https://git-wip-us.apache.org/repos/asf?p=thrift.git"
Jake Farrellc023d902011-05-20 19:04:13 +0000126 />
127 <!-- Thrift Developers -->
128 <developer id="mcslee" name="Mark Slee"/>
129 <developer id="dreiss" name="David Reiss"/>
130 <developer id="aditya" name="Aditya Agarwal"/>
131 <developer id="marck" name="Marc Kwiatkowski"/>
132 <developer id="jwang" name="James Wang"/>
133 <developer id="cpiro" name="Chris Piro"/>
134 <developer id="bmaurer" name="Ben Maurer"/>
135 <developer id="kclark" name="Kevin Clark"/>
136 <developer id="jake" name="Jake Luciani"/>
137 <developer id="bryanduxbury" name="Bryan Duxbury"/>
138 <developer id="esteve" name="Esteve Fernandez"/>
139 <developer id="todd" name="Todd Lipcon"/>
140 <developer id="geechorama" name="Andrew McGeachie"/>
141 <developer id="molinaro" name="Anthony Molinaro"/>
142 <developer id="roger" name="Roger Meier"/>
143 <developer id="jfarrell" name="Jake Farrell"/>
Jens Geyer111d8f22013-06-03 16:49:55 +0200144 <developer id="jensg" name="Jens Geyer"/>
Carl Yeksigian350860f2013-06-01 22:48:52 -0400145 <developer id="carl" name="Carl Yeksigian"/>
Jake Farrellc023d902011-05-20 19:04:13 +0000146 </artifact:pom>
147
148 <!-- Generate the pom file -->
149 <artifact:writepom pomRefId="pom" file="${as3.pom.xml}"/>
150
151 <property name="mvn.finished" value="true"/>
152 </target>
153
154 <macrodef name="signAndDeploy">
155 <!-- Sign and deploy jars to apache repo -->
156 <attribute name="file"/>
157 <attribute name="classifier" default=""/>
158 <attribute name="packaging" default="jar"/>
159 <attribute name="pom" default=""/>
160 <sequential>
161 <artifact:mvn fork="true">
162 <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/>
163 <arg value="-DrepositoryId=${maven-repository-id}"/>
164 <arg value="-Durl=${maven-repository-url}"/>
165 <arg value="-DpomFile=@{pom}"/>
166 <arg value="-Dfile=@{file}"/>
167 <arg value="-Dclassifier=@{classifier}"/>
168 <arg value="-Dpackaging=@{packaging}"/>
169 <arg value="-Pgpg"/>
170 </artifact:mvn>
171 </sequential>
172 </macrodef>
173
174 <target name="publish" depends="clean,compile,mvn.init">
175 <!-- Compile, packages and then send release to apache maven repo -->
176 <!-- run with: ant -Drelease=true publish -->
177 <signAndDeploy file="${as3.pom.xml}" packaging="pom" classifier="" pom="${as3.pom.xml}"/>
178 <signAndDeploy file="${as3.swc.file}" packaging="swc" classifier="" pom="${as3.pom.xml}"/>
179 </target>
Bryan Duxbury321eb7a2010-04-22 21:17:39 +0000180</project>