Send "type" as array for JSON requests
[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.3.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   <delete file="${pharfile}"/>
35   <pharpackage basedir="${phing.dir}"
36    destfile="${pharfile}"
37    stub="${phing.dir}/src/phar-stub.php"
38    alias="shpub.phar"
39   >
40    <fileset refid="fs.phar"/>
41   </pharpackage>
42
43   <exec executable="chmod" checkreturn="1">
44    <arg value="+x"/>
45    <arg file="${pharfile}"/>
46   </exec>
47  </target>
48
49
50  <target name="collectdeps" description="Copy package dependencies to lib/">
51   <delete dir="${libdir}"/>
52   <mkdir dir="${libdir}"/>
53
54   <pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/>
55   <pearPackageFileset id="dep-HTTP_Request2" package="pear.php.net/HTTP_Request2"/>
56   <pearPackageFileset id="dep-MIME_Type" package="pear.php.net/MIME_Type"/>
57   <pearPackageFileset id="dep-Net_URL2" package="pear.php.net/Net_URL2"/>
58   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
59    <include name="PEAR/Exception.php"/>
60   </pearPackageFileset>
61
62   <copy todir="${libdir}">
63    <fileset refid="dep-Console_CommandLine"/>
64    <fileset refid="dep-HTTP_Request2"/>
65    <fileset refid="dep-MIME_Type"/>
66    <fileset refid="dep-Net_URL2"/>
67    <fileset refid="dep-PEAR"/>
68   </copy>
69  </target>
70
71
72  <target name="docs" description="render documentation">
73   <rst file="README.rst"/>
74  </target>
75
76 </project>