Use phpmyadmin/sql-parser, the udan11 one is not maintained
[php-sqllint.git] / build.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="php-sqllint" default="phar" basedir=".">
3
4  <property name="version"  value="dev" />
5  <loadfile property="version" file="VERSION">
6   <filterchain>
7    <striplinebreaks />
8   </filterchain>
9  </loadfile>
10
11  <property name="pharfile" value="${phing.dir}/dist/${phing.project.name}-${version}.phar" />
12  <property name="pharfilebz2" value="${phing.dir}/dist/${phing.project.name}-${version}.bz2.phar" />
13  <property name="libdir" value="${phing.dir}/lib"/>
14
15  <fileset id="fs.phar" dir="${phing.dir}">
16   <include name="bin/**"/>
17   <include name="lib/**"/>
18   <include name="src/**"/>
19
20   <include name="README.rst"/>
21   <include name="VERSION"/>
22
23   <include name="vendor/autoload.php"/>
24   <include name="vendor/composer/*.php"/>
25   <include name="vendor/pear/console_commandline/Console/**"/>
26   <include name="vendor/pear/pear_exception/PEAR/**"/>
27   <include name="vendor/phpmyadmin/sql-parser/src/**"/>
28  </fileset>
29
30
31  <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
32
33  <target name="phar" depends="collectdeps"
34          description="Create zip file for release"
35  >
36   <!-- strip the shebang from bin script -->
37   <copy file="${phing.dir}/bin/php-sqllint" tofile="${phing.dir}/bin/phar-php-sqllint.php">
38    <filterchain>
39     <striplinecomments>
40      <comment value="#" />
41     </striplinecomments>
42    </filterchain>
43   </copy>
44
45   <mkdir dir="${phing.dir}/dist"/>
46   <delete file="${pharfile}"/>
47   <pharpackage basedir="${phing.dir}"
48    destfile="${pharfile}"
49    stub="${phing.dir}/src/stub-phar.php"
50    alias="php-sqllint.phar"
51    compression="none"
52   >
53    <fileset refid="fs.phar"/>
54   </pharpackage>
55
56   <pharpackage basedir="${phing.dir}"
57    destfile="${pharfilebz2}"
58    stub="${phing.dir}/src/stub-phar.php"
59    alias="php-sqllint.phar"
60    compression="bzip2"
61   >
62    <fileset refid="fs.phar"/>
63   </pharpackage>
64
65   <exec executable="chmod">
66    <arg value="+x"/>
67    <arg value="${pharfile}"/>
68    <arg value="${pharfilebz2}"/>
69   </exec>
70  </target>
71
72
73  <target name="collectdeps" description="Copy package dependencies to lib/">
74   <exec command="composer install"/>
75   <!--
76   <delete dir="${libdir}"/>
77   <mkdir dir="${libdir}"/>
78
79   <pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/>
80   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
81    <include name="PEAR/Exception.php"/>
82   </pearPackageFileset>
83
84   <copy todir="${libdir}">
85    <fileset refid="dep-Console_CommandLine"/>
86    <fileset refid="dep-PEAR"/>
87   </copy>
88   -->
89  </target>
90
91
92  <target name="docs" description="render documentation">
93   <rst file="README.rst"/>
94  </target>
95
96  <target name="update-website" depends="docs">
97   <exec command="xmlstarlet sel -t -c '/_:html/_:body/_:div' README.html
98    | xmllint --format -
99    |grep -v '?xml version'
100    > ~/Dev/html/cweiske.de/www/php-sqllint.htm"/>
101  </target>
102
103 </project>