Commit 8b5f4ccd authored by Jonathan H. Wage's avatar Jonathan H. Wage

Fixing DBAL phing dependencies and version.

parent 5c263075
......@@ -30,7 +30,7 @@ if (file_exists($configFile)) {
$helperSet = ($helperSet) ?: new \Symfony\Components\Console\Helper\HelperSet();
$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION);
$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->addCommands(array(
......
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>
......@@ -5,8 +5,6 @@
-->
<project name="Doctrine DBAL" default="build" basedir=".">
<import file="build-dependencies.xml"/>
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<taskdef classname="NativePhpunitTask" classpath="./tests/" name="nativephpunit" />
......@@ -30,7 +28,7 @@
<!--
Fileset for the sources of the Doctrine Common dependency.
-->
<fileset id="common-sources" dir="./lib">
<fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
<include name="Doctrine/Common/**"/>
</fileset>
......@@ -64,7 +62,6 @@
Prepare the new build directories after cleaning
-->
<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}" />
......@@ -92,6 +89,8 @@
<copy todir="${build.dir}/dbal/bin">
<fileset refid="bin-scripts"/>
</copy>
<exec command="sed 's/${version}-DEV/${version}/' ${build.dir}/dbal/Doctrine/DBAL/Version.php > ${build.dir}/dbal/Doctrine/DBAL/Version2.php" passthru="true" />
<exec command="mv ${build.dir}/dbal/Doctrine/DBAL/Version2.php ${build.dir}/dbal/Doctrine/DBAL/Version.php" passthru="true" />
</target>
<target name="build" depends="test, build-dbal"/>
......
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\DBAL;
/**
* Class to store and retrieve the version of Doctrine
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class Version
{
/**
* Current Doctrine Version
*/
const VERSION = '2.0.0BETA2-DEV';
/**
* Compares a Doctrine version with the current one.
*
* @param string $version Doctrine version to compare.
* @return int Returns -1 if older, 0 if it is the same, 1 if version
* passed as argument is newer.
*/
public static function compare($version)
{
$currentVersion = str_replace(' ', '', strtolower(self::VERSION));
$version = str_replace(' ', '', $version);
return version_compare($version, $currentVersion);
}
}
\ No newline at end of file
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