Add location header to --dry-run fake response
[shpub.git] / build.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="shpub" 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="bin/**"/>
10   <include name="lib/**"/>
11   <include name="src/**"/>
12
13   <include name="README.rst"/>
14
15   <exclude name="bin/shpub.php"/>
16  </fileset>
17
18
19  <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
20
21  <target name="phar" depends="collectdeps"
22          description="Create zip file for release"
23  >
24   <!-- strip the shebang  -->
25   <copy file="${phing.dir}/bin/shpub.php" tofile="${phing.dir}/bin/phar-shpub.php">
26    <filterchain>
27     <striplinecomments>
28      <comment value="#" />
29     </striplinecomments>
30    </filterchain>
31   </copy>
32
33   <mkdir dir="${phing.dir}/dist"/>
34
35   <available file="${pharfile}" property="phar_exists" value="1"/>
36   <fail if="phar_exists" message="File exists already: ${pharfile}"/>
37
38   <pharpackage basedir="${phing.dir}"
39    destfile="${pharfile}"
40    stub="${phing.dir}/src/phar-stub.php"
41    alias="shpub.phar"
42   >
43    <fileset refid="fs.phar"/>
44   </pharpackage>
45
46   <exec executable="chmod" checkreturn="1">
47    <arg value="+x"/>
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_CommandLine" package="pear.php.net/Console_CommandLine"/>
58   <pearPackageFileset id="dep-HTTP_Request2" package="pear.php.net/HTTP_Request2"/>
59   <pearPackageFileset id="dep-MIME_Type" package="pear.php.net/MIME_Type"/>
60   <pearPackageFileset id="dep-Net_URL2" package="pear.php.net/Net_URL2"/>
61   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
62    <include name="PEAR.php"/>
63    <include name="PEAR/Exception.php"/>
64   </pearPackageFileset>
65
66   <copy todir="${libdir}">
67    <fileset refid="dep-Console_CommandLine"/>
68    <fileset refid="dep-HTTP_Request2"/>
69    <fileset refid="dep-MIME_Type"/>
70    <fileset refid="dep-Net_URL2"/>
71    <fileset refid="dep-PEAR"/>
72   </copy>
73  </target>
74
75
76  <target name="docs" description="render documentation">
77   <rst file="README.rst"/>
78  </target>
79
80 </project>