94e425a508bef8c219642b9675a2b84c82b3efa7
[bdrem.git] / build.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="bdrem" default="phar" basedir=".">
3
4  <property name="version"  value="0.1.0" />
5  <property name="pharfile" value="${phing.dir}/dist/${phing.project.name}-${version}.phar" />
6  <property name="libdir" value="${phing.dir}/lib"/>
7
8  <fileset id="fs.phar" dir="${phing.dir}">
9   <include name="data/**"/>
10   <include name="bin/**"/>
11   <include name="lib/**"/>
12   <include name="src/**"/>
13   <include name="www/**"/>
14
15   <include name="README.rst"/>
16
17   <exclude name="data/config.php"/>
18   <exclude name="bin/fetch-deps.php"/>
19   <exclude name="bin/makephar.php"/>
20  </fileset>
21
22
23  <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
24
25  <target name="phar" depends="collectdeps"
26          description="Create zip file for release"
27  >
28   <!-- strip the shebang  -->
29   <copy file="${phing.dir}/bin/bdrem.php" tofile="${phing.dir}/bin/phar-bdrem.php">
30    <filterchain>
31     <striplinecomments>
32      <comment value="#" />
33     </striplinecomments>
34    </filterchain>
35   </copy>
36
37   <delete file="${pharfile}"/>
38   <pharpackage basedir="${phing.dir}"
39    destfile="${pharfile}"
40    stub="${phing.dir}/src/phar-stub.php"
41    alias="bdrem.phar"
42   >
43    <fileset refid="fs.phar"/>
44   </pharpackage>
45  </target>
46
47
48  <target name="collectdeps" description="Copy package dependencies to lib/">
49   <delete dir="${libdir}"/>
50   <mkdir dir="${libdir}"/>
51
52   <pearPackageFileset id="dep-Console_Color2" package="pear.php.net/Console_Color2"/>
53   <pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/>
54   <pearPackageFileset id="dep-Console_Table" package="pear.php.net/Console_Table"/>
55   <pearPackageFileset id="dep-Mail_mime" package="pear.php.net/Mail_mime"/>
56   <pearPackageFileset id="dep-Net_LDAP2" package="pear.php.net/Net_LDAP2"/>
57   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
58    <include name="PEAR/Exception.php"/>
59    <include name="PEAR.php"/>
60   </pearPackageFileset>
61
62   <copy todir="${libdir}">
63    <fileset refid="dep-Console_Color2"/>
64    <fileset refid="dep-Console_CommandLine"/>
65    <fileset refid="dep-Console_Table"/>
66    <fileset refid="dep-Mail_mime"/>
67    <fileset refid="dep-Net_LDAP2"/>
68    <fileset refid="dep-PEAR"/>
69   </copy>
70  </target>
71
72 </project>