Commit ea184c94 authored by Roman S. Borschel's avatar Roman S. Borschel

Updates for dependency management.

parent 705b61aa
......@@ -3,3 +3,5 @@ build/
logs/
reports/
dist/
download/
lib/Doctrine/Common
dependencies=common
common.version=2.0.0-BETA1
common.srcdir=lib/Doctrine/Common
common.targetdir=lib/Doctrine/Common
<?xml version="1.0"?>
<project name="Doctrine Dependency Management" default="resolve-dependencies" basedir=".">
<property file="build-dependencies.properties" />
<property name="download.dir" value="download"/>
<target name="resolve-dependencies" description="Resolves the project dependencies.">
<echo message="Resolving dependencies"/>
<foreach list="${dependencies}" param="dependency" target="resolve-dependency" />
</target>
<target name="resolve-dependency">
<fail unless="${dependency}.version" message="${dependency}.version not set."/>
<fail unless="${dependency}.srcdir" message="${dependency}.srcdir not set."/>
<fail unless="${dependency}.targetdir" message="${dependency}.targetdir not set."/>
<property name="dependency.version" value="${${dependency}.version}"/>
<property name="dependency.srcdir" value="${${dependency}.srcdir}"/>
<property name="dependency.targetdir" value="${${dependency}.targetdir}"/>
<echo message="${dependency.targetdir}"/>
<!--
Check out dependency. If ${dependency.targetdir} does not exist or versions dont match.
When done, place version info file into ${dependency.targetdir}.
-->
<available file="${dependency.targetdir}" type="dir" property="target.dir.exists" />
<if>
<istrue value="${target.dir.exists}"/>
<then>
<property file="${dependency.targetdir}/current-version.properties" />
</then>
</if>
<if>
<or>
<isfalse value="${target.dir.exists}" />
<not><equals arg1="${dependency.version}" arg2="${current.version}"/></not>
</or>
<then>
<echo message="Fetching dependency '${dependency}' at version '${dependency.version}'." />
<delete dir="${download.dir}/${dependency}" includeemptydirs="true" />
<mkdir dir="${download.dir}/${dependency}" />
<exec command="git clone git://github.com/doctrine/${dependency}.git ${download.dir}/${dependency}" />
<exec command="git checkout ${dependency.version}" dir="${download.dir}/${dependency}" />
<delete dir="${dependency.targetdir}" includeemptydirs="true" />
<copy todir="${dependency.targetdir}">
<fileset dir="${download.dir}/${dependency}/${dependency.srcdir}">
<include name="**" />
</fileset>
</copy>
<delete file="${dependency.targetdir}/current-version.properties" />
<touch file="${dependency.targetdir}/current-version.properties"/>
<append destFile="${dependency.targetdir}/current-version.properties" text="current.version=${dependency.version}"/>
<delete dir="${download.dir}/${dependency}" includeemptydirs="true" />
</then>
<else>
<echo message="Dependency ${dependency} is available in the correct version: ${dependency.version}." />
</else>
</if>
</target>
</project>
......@@ -4,7 +4,9 @@
Doctrine 2 build file.
-->
<project name="Doctrine2" default="build" basedir=".">
<project name="Doctrine DBAL" default="build" basedir=".">
<import file="build-dependencies.xml"/>
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<taskdef classname="NativePhpunitTask" classpath="./tools/" name="nativephpunit" />
......@@ -27,6 +29,13 @@
<include name="doctrine.php"/>
</fileset>
<!--
Fileset for the sources of the Doctrine Common dependency.
-->
<fileset id="common-sources" dir="./lib">
<include name="Doctrine/Common/**"/>
</fileset>
<!--
Fileset for the sources of the Doctrine DBAL package.
-->
......@@ -44,6 +53,7 @@
</target>
<target name="prepare" depends="clean">
<phingcall target="resolve-dependencies"/>
<echo msg="Creating build directory: ${build.dir}" />
<mkdir dir="${build.dir}" />
<echo msg="Creating distribution directory: ${dist.dir}" />
......@@ -59,6 +69,7 @@
<fileset refid="shared-artifacts"/>
</copy>
<copy todir="${build.dir}/dbal/DoctrineDBAL-${version}">
<fileset refid="common-sources"/>
<fileset refid="dbal-sources"/>
</copy>
</target>
......
......@@ -8,10 +8,7 @@ error_reporting(E_ALL | E_STRICT);
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . "/../../../lib/vendor/doctrine-common/lib");
$classLoader->register();
require_once __DIR__ . '/../../../lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment