Newer
Older
<?xml version="1.0"?>
<!--
Doctrine 2 build file.
-->
<project name="Doctrine DBAL" default="build" basedir=".">
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
Fileset for artifacts shared across all distributed packages.
-->
<fileset id="shared-artifacts" dir=".">
<include name="LICENSE"/>
</fileset>
<!--
Fileset for command line scripts
-->
<fileset id="bin-scripts" dir="./bin">
Benjamin Eberlei
committed
<include name="doctrine-dbal"/>
<include name="doctrine-dbal.php"/>
<!--
Fileset for the sources of the Doctrine Common dependency.
-->
<fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
<include name="Doctrine/Common/**"/>
</fileset>
Fileset for the sources of the Doctrine DBAL package.
-->
<fileset id="dbal-sources" dir="./lib">
<include name="Doctrine/DBAL/**"/>
<!--
Fileset for source of the Symfony YAML and Console components.
-->
<fileset id="symfony-sources" dir="./lib/vendor">
Benjamin Eberlei
committed
<include name="Symfony/Component**"/>
</fileset>
<!--
Clean the directory for the next build.
-->
<available file="./build.properties" property="build_properties_exist" value="true"/>
<fail unless="build_properties_exist" message="The build.properties file is missing." />
<delete dir="${build.dir}" includeemptydirs="true" />
<delete dir="${dist.dir}" includeemptydirs="true" />
<delete dir="${report.dir}" includeemptydirs="true" />
<!--
Prepare the new build directories after cleaning
-->
<target name="prepare" depends="clean">
<echo msg="Creating build directory: ${build.dir}" />
<echo msg="Creating distribution directory: ${dist.dir}" />
<echo msg="Creating report directory: ${report.dir}" />
<mkdir dir="${report.dir}" />
<mkdir dir="${build.dir}/logs"/>
<mkdir dir="${report.dir}/tests"/>
<!--
Builds DBAL package, preparing it for distribution.
-->
<target name="build-dbal" depends="prepare">
Benjamin Eberlei
committed
<copy todir="${build.dir}/doctrine-dbal">
Benjamin Eberlei
committed
<copy todir="${build.dir}/doctrine-dbal">
<fileset refid="dbal-sources"/>
</copy>
Benjamin Eberlei
committed
<copy todir="${build.dir}/doctrine-dbal/Doctrine">
<fileset refid="symfony-sources"/>
</copy>
Benjamin Eberlei
committed
<copy todir="${build.dir}/doctrine-dbal/bin">
<fileset refid="bin-scripts"/>
</copy>
Benjamin Eberlei
committed
<exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version.php > ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="mv ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version2.php ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version.php" passthru="true" />
Benjamin Eberlei
committed
<target name="build" depends="test,build-dbal"/>
Runs the full test suite.
-->
<target name="test" depends="prepare">
<if><equals arg1="${test.phpunit_generate_coverage}" arg2="1" />
<then>
Benjamin Eberlei
committed
<property name="test.phpunit_coverage_option" value="--coverage-clover ${build.dir}/logs/clover.xml" />
</then>
<else>
Benjamin Eberlei
committed
<property name="test.phpunit_coverage_option" value="" />
</else>
</if>
Benjamin Eberlei
committed
<if><equals arg1="${test.phpunit_configuration_file}" arg2="" />
<then>
<property name="test.phpunit_configuration_option" value="" />
</then>
<else>
<property name="test.phpunit_configuration_option" value="--configuration ${test.phpunit_configuration_file}" />
</else>
</if>
<exec command="phpunit ${test.phpunit_configuration_option} ${test.phpunit_coverage_option} --log-junit ../${build.dir}/logs/testsuites.xml Doctrine/Tests/AllTests.php" dir="./tests" />
<phpunitreport infile="${build.dir}/logs/testsuites.xml" format="frames" todir="${report.dir}/tests" />
<tstamp/>
Roman S. Borschel
committed
<copy file="${build.dir}/logs/testsuites.xml" tofile="${log.archive.dir}/latest/log.xml" overwrite="true"/>
<if><equals arg1="${test.pmd_reports}" arg2="1" />
<then>
<exec command="${test.pdepend_exec} --jdepend-xml=${build.dir}/logs/jdepend.xml ./lib/Doctrine" />
<exec command="${test.phpmd_exec} ./lib/Doctrine xml codesize --reportfile ${build.dir}/logs/phpmd.xml" />
Roman S. Borschel
committed
<copy file="${build.dir}/logs/jdepend.xml" tofile="${log.archive.dir}/latest/jdepend.xml" overwrite="true"/>
<copy file="${build.dir}/logs/phpmd.xml" tofile="${log.archive.dir}/latest/phpmd.xml" overwrite="true"/>
</then>
</if>
Builds distributable PEAR packages.
-->
<target name="build-packages" depends="build-dbal">
Benjamin Eberlei
committed
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/doctrine-dbal">
<name>DoctrineDBAL</name>
<summary>Doctrine Database Abstraction Layer</summary>
<channel>pear.doctrine-project.org</channel>
<description>The Doctrine DBAL package is the database abstraction layer used to power the ORM package.</description>
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
<lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
<lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
<license>LGPL</license>
<version release="${version}" api="${version}" />
<stability release="${stability}" api="${stability}" />
<notes>-</notes>
<dependencies>
<php minimum_version="5.3.2" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
Benjamin Eberlei
committed
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="2.0.0BETA4" />
<dirroles key="bin">script</dirroles>
Benjamin Eberlei
committed
<ignore>Doctrine/Common/</ignore>
Benjamin Eberlei
committed
<install as="doctrine-dbal" name="bin/doctrine-dbal" />
<install as="doctrine-dbal.php" name="bin/doctrine-dbal.php" />
Benjamin Eberlei
committed
<exec command="pear package" dir="${build.dir}/doctrine-dbal" passthru="true" />
<exec command="mv DoctrineDBAL-${version}.tgz ../../dist" dir="${build.dir}/doctrine-dbal" passthru="true" />
<tar destfile="dist/DoctrineDBAL-${version}-full.tar.gz" compression="gzip" basedir="${build.dir}">
<fileset dir="${build.dir}">
<include name="**/**" />
<exclude name="logs/" />
</fileset>
</tar>
Benjamin Eberlei
committed
<target name="git-tag">
<exec command="git tag -a ${version}" passthru="true" />
<exec command="git push origin ${version}" passthru="true" />
</target>
<target name="pirum-release">
<exec command="pirum add ${project.pirum_dir} ${project.basedir}/dist/DoctrineDBAL-${version}.tgz" dir="." passthru="true" />
<exec command="pirum build ${project.pirum_dir}" passthru="true" />
</target>
<target name="distribute-download">
<copy file="dist/DoctrineDBAL-${version}-full.tar.gz" todir="${project.download_dir}" />
</target>
<target name="update-dev-version">
<propertyprompt propertyName="next_version" defaultValue="${version}" promptText="Enter next version string (without -DEV)" />
<exec command="sed 's/${version}-DEV/${next_version}-DEV/' ${project.basedir}/lib/Doctrine/DBAL/Version.php > ${project.basedir}/lib/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="mv ${project.basedir}/lib/Doctrine/DBAL/Version2.php ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git add ${project.basedir}/lib/Doctrine/DBAL/Version.php" passthru="true" />
<exec command="git commit -m 'Bump Dev Version to ${next_version}'" passthru="true" />
<exec command="git push origin master" passthru="true" />
</target>
<target name="release" depends="git-tag,build-packages,distribute-download,pirum-release,update-dev-version" />