123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project name="Phergie" default="core">
- <tstamp>
- <format property="DSTAMP" pattern="%Y-%m-%d" />
- </tstamp>
- <taskdef name="phergiepkg" classname="PhergiePackageTask" />
- <taskdef name="phpdocumentor" classname="phing.tasks.ext.phpdoc.PhpDocumentorTask" />
- <available file="./build.properties" property="have_properties_file" />
- <property name="clean" value="true" />
- <target name="input">
- <if>
- <equals arg1="${have_properties_file}" arg2="true" />
- <then>
- <property file="./build.properties" />
- </then>
- <else>
- <input propertyname="build.srcdir" defaultvalue="./" message="Source directory" />
- <input propertyname="build.dstdir" defaultvalue="./" message="Destination directory" />
- <input propertyname="build.version.release" message="Release version" />
- <input propertyname="build.version.api" message="API version" />
- <input propertyname="build.stability.release" defaultvalue="stable" message="Release stability" validArgs="snapshot,devel,alpha,beta,stable" />
- <input propertyname="build.stability.api" defaultvalue="stable" message="API stability" validArgs="snapshot,devel,alpha,beta,stable" />
- <input propertyname="build.notes" message="Release notes" />
- <input propertyname="build.phpdep" defaultvalue="5.2.0" message="PHP version required" />
- <input propertyname="build.pearinstallerdep" defaultvalue="1.9.0" message="PEAR installer version required" />
- </else>
- </if>
- <fileset dir="${build.srcdir}" id="core">
- <include name="phergie.php" />
- <include name="phergie.bat" />
- <include name="LICENSE" />
- <include name="Settings.php.dist" />
- <include name="Phergie/Autoload.php" />
- <include name="Phergie/Bot.php" />
- <include name="Phergie/Config/Exception.php" />
- <include name="Phergie/Config.php" />
- <include name="Phergie/Connection/Exception.php" />
- <include name="Phergie/Connection/Handler.php" />
- <include name="Phergie/Connection.php" />
- <include name="Phergie/Db/Exception.php" />
- <include name="Phergie/Db/Manager.php" />
- <include name="Phergie/Db/Sqlite.php" />
- <include name="Phergie/Driver/Abstract.php" />
- <include name="Phergie/Driver/Exception.php" />
- <include name="Phergie/Driver/Streams.php" />
- <include name="Phergie/Event/Abstract.php" />
- <include name="Phergie/Event/Command.php" />
- <include name="Phergie/Event/Exception.php" />
- <include name="Phergie/Event/Handler.php" />
- <include name="Phergie/Event/Request.php" />
- <include name="Phergie/Event/Response.php" />
- <include name="Phergie/Exception.php" />
- <include name="Phergie/Hostmask/Exception.php" />
- <include name="Phergie/Hostmask.php" />
- <include name="Phergie/Plugin/Abstract.php" />
- <include name="Phergie/Plugin/Exception.php" />
- <include name="Phergie/Plugin/Handler.php" />
- <include name="Phergie/Ui/Abstract.php" />
- <include name="Phergie/Ui/Console.php" />
- </fileset>
- </target>
- <target name="core" depends="input">
- <property name="build.tmpdir" value="Phergie-${build.version.release}" />
- <property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
- <delete file="${build.tarball}" quiet="true" />
- <mkdir dir="${build.tmpdir}" />
- <copy todir="${build.tmpdir}">
- <fileset refid="core" />
- </copy>
- <reflexive file="${build.tmpdir}/Phergie/Bot.php">
- <filterchain>
- <replaceregexp>
- <regexp
- pattern="const VERSION = '[^']+';"
- replace="const VERSION = '${build.version.release}';"
- />
- </replaceregexp>
- </filterchain>
- </reflexive>
- <phergiepkg name="Phergie" dir="${build.tmpdir}">
- <fileset refid="core" />
- <option name="baseinstalldir" value="/" />
- <option name="outputdirectory" value="${build.dstdir}" />
- <option name="channel" value="pear.phergie.org" />
- <option name="summary" value="Phergie core library" />
- <option name="description" value="The Phergie package provides all files necessary to run a basic IRC bot." />
- <option name="apiversion" value="${build.version.api}" />
- <option name="apistability" value="${build.stability.api}" />
- <option name="releaseversion" value="${build.version.release}" />
- <option name="releasestability" value="${build.stability.release}" />
- <option name="phpdep" value="${build.phpdep}" />
- <option name="pearinstallerdep" value="${build.pearinstallerdep}" />
- <option name="license" value="http://phergie.org/license New BSD License" />
- <option name="packagetype" value="php" />
- <option name="notes" value="${build.notes}" />
- <mapping name="replacements">
- <element>
- <element key="path" value="phergie.php" />
- <element key="type" value="pear-config" />
- <element key="from" value="/usr/bin/env php" />
- <element key="to" value="php_bin" />
- </element>
- <element>
- <element key="path" value="phergie.bat" />
- <element key="type" value="pear-config" />
- <element key="from" value="@php_bin@" />
- <element key="to" value="php_bin" />
- </element>
- <element>
- <element key="path" value="phergie.bat" />
- <element key="type" value="pear-config" />
- <element key="from" value="@bin_dir@" />
- <element key="to" value="bin_dir" />
- </element>
- </mapping>
- <mapping name="exceptions">
- <element key="phergie.php" value="script" />
- <element key="phergie.bat" value="script" />
- </mapping>
- <mapping name="releases">
- <element>
- <element key="installconditions">
- <element key="os" value="windows" />
- </element>
- <element key="filelist">
- <element key="install">
- <element key="phergie.php" value="phergie" />
- </element>
- </element>
- </element>
- <element>
- <element key="filelist">
- <element key="install">
- <element key="phergie.php" value="phergie" />
- </element>
- <element key="ignore">
- <element value="phergie.bat" />
- </element>
- </element>
- </element>
- </mapping>
- <mapping name="deps">
- <element>
- <element key="type" value="ext" />
- <element key="name" value="pcre" />
- </element>
- <element>
- <element key="type" value="ext" />
- <element key="name" value="reflection" />
- </element>
- </mapping>
- </phergiepkg>
- <phingcall target="build" />
- <phingcall target="clean" />
- </target>
- <target name="plugin" depends="input">
-
- <if>
- <equals arg1="${have_properties_file}" arg2="true" />
- <then>
- <property file="./build.properties" />
- </then>
- <else>
- <input propertyname="build.plugin" message="Short plugin name" />
- <input propertyname="build.summary" message="Plugin summary" />
- <input propertyname="build.description" message="Plugin description" />
- </else>
- </if>
- <property name="build.class" value="Phergie_Plugin_${build.plugin}" />
- <property name="build.tmpdir" value="${build.class}-${build.version.release}" />
- <property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
- <fileset dir="${build.srcdir}" id="plugin">
- <include name="Phergie/Plugin/${build.plugin}.php" />
- <include name="Phergie/Plugin/${build.plugin}/**" />
- </fileset>
- <delete file="${build.tarball}" quiet="true" />
- <mkdir dir="${build.tmpdir}" />
- <copy todir="${build.tmpdir}">
- <fileset refid="plugin" />
- </copy>
- <phergiepkg name="${build.class}" dir="${build.tmpdir}">
- <fileset refid="plugin" />
- <option name="baseinstalldir" value="/" />
- <option name="outputdirectory" value="${build.dstdir}" />
- <option name="channel" value="pear.phergie.org"/>
- <option name="summary" value="${build.summary}"/>
- <option name="description" value="${build.description}"/>
- <option name="apiversion" value="${build.version.api}"/>
- <option name="apistability" value="${build.stability.api}"/>
- <option name="releaseversion" value="${build.version.release}"/>
- <option name="releasestability" value="${build.stability.release}"/>
- <option name="phpdep" value="${build.phpdep}" />
- <option name="pearinstallerdep" value="${build.pearinstallerdep}" />
- <option name="license" value="http://phergie.org/license New BSD License"/>
- <option name="packagetype" value="php"/>
- <option name="notes" value="${build.notes}"/>
- </phergiepkg>
- <phingcall target="build" />
- <phingcall target="clean" />
- </target>
- <target name="docs" depends="input">
-
- <property name="build.tmpdir" value="Phergie_Docs-${build.version.release}" />
- <property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
- <delete file="${build.tarball}" quiet="true" />
- <mkdir dir="${build.tmpdir}" />
- <phpdocumentor title="API Documentation"
- destdir="${build.tmpdir}/api"
- output="HTML:Smarty:PHP">
- <fileset refid="core" />
- <projdocfileset dir=".">
- <include name="LICENSE" />
- </projdocfileset>
- </phpdocumentor>
- <phergiepkg name="Phergie_Docs" dir="${build.tmpdir}">
- <fileset dir="${build.tmpdir}">
- <include name="api**" />
- </fileset>
- <option name="baseinstalldir" value="/" />
- <option name="outputdirectory" value="${build.dstdir}" />
- <option name="channel" value="pear.phergie.org" />
- <option name="summary" value="Phergie core library documentation" />
- <option name="description" value="The Phergie_Docs package provides documentation for the Phergie core libraries." />
- <option name="apiversion" value="${build.version.api}" />
- <option name="apistability" value="${build.stability.api}" />
- <option name="releaseversion" value="${build.version.release}" />
- <option name="releasestability" value="${build.stability.release}" />
- <option name="phpdep" value="${build.phpdep}" />
- <option name="pearinstallerdep" value="${build.pearinstallerdep}" />
- <option name="license" value="http://phergie.org/license New BSD License" />
- <option name="packagetype" value="php" />
- <option name="notes" value="${build.notes}" />
- <mapping name="exceptions">
- <element key="api" value="doc" />
- </mapping>
- </phergiepkg>
- <phingcall target="build" />
- <phingcall target="clean" />
- </target>
- <target name="build">
- <tar destfile="${build.tarball}" compression="gzip">
- <fileset dir="${build.dstdir}">
- <include name="${build.tmpdir}**" />
- <include name="package.xml" />
- </fileset>
- </tar>
- </target>
- <target name="clean">
- <if>
- <istrue value="${clean}" />
- <then>
- <delete dir="${build.tmpdir}" />
- <delete file="${build.dstdir}package.xml" />
- </then>
- </if>
- </target>
- </project>
|