Make "readme" and "config" commands work again
[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.6.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
46   <exec executable="bzip2" dir="${phing.dir}/dist">
47    <arg value="-kf"/>
48    <arg file="${pharfile}"/>
49   </exec>
50  </target>
51
52
53  <target name="collectdeps" description="Copy package dependencies to lib/">
54   <delete dir="${libdir}"/>
55   <mkdir dir="${libdir}"/>
56
57   <pearPackageFileset id="dep-Console_Color2" package="pear.php.net/Console_Color2"/>
58   <pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/>
59   <pearPackageFileset id="dep-Console_Table" package="pear.php.net/Console_Table"/>
60   <pearPackageFileset id="dep-Mail_mime" package="pear.php.net/Mail_mime"/>
61   <pearPackageFileset id="dep-Net_LDAP2" package="pear.php.net/Net_LDAP2"/>
62   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
63    <include name="PEAR/Exception.php"/>
64    <include name="PEAR.php"/>
65    <include name="PEAR5.php"/>
66   </pearPackageFileset>
67
68   <copy todir="${libdir}">
69    <fileset refid="dep-Console_Color2"/>
70    <fileset refid="dep-Console_CommandLine"/>
71    <fileset refid="dep-Console_Table"/>
72    <fileset refid="dep-Mail_mime"/>
73    <fileset refid="dep-Net_LDAP2"/>
74    <fileset refid="dep-PEAR"/>
75   </copy>
76  </target>
77
78
79  <target name="docs" description="render documentation">
80   <rst file="README.rst"/>
81  </target>
82
83 </project>