Commit 8054984a authored by Benjamin Eberlei's avatar Benjamin Eberlei

DDC-684 - Fix flaw in build process, DBAL PEAR package now does not contain...

DDC-684 - Fix flaw in build process, DBAL PEAR package now does not contain Common code and just adds a dependency on the PEAR channel. Additional full package is generated into dist/
parent 9f1de0ee
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
include('doctrine.php'); include('doctrine-dbal.php');
\ No newline at end of file \ No newline at end of file
<?php
require_once 'Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine');
$classLoader->register();
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
$helperSet = null;
if (file_exists($configFile)) {
if ( ! is_readable($configFile)) {
trigger_error(
'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
);
}
require $configFile;
foreach ($GLOBALS as $helperSetCandidate) {
if ($helperSetCandidate instanceof \Symfony\Components\Console\Helper\HelperSet) {
$helperSet = $helperSetCandidate;
break;
}
}
}
$helperSet = ($helperSet) ?: new \Symfony\Components\Console\Helper\HelperSet();
$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\DBAL\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->addCommands(array(
// DBAL Commands
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
));
$cli->run();
\ No newline at end of file
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
Fileset for command line scripts Fileset for command line scripts
--> -->
<fileset id="bin-scripts" dir="./bin"> <fileset id="bin-scripts" dir="./bin">
<include name="doctrine"/> <include name="doctrine-dbal"/>
<include name="doctrine.php"/> <include name="doctrine-dbal.php"/>
</fileset> </fileset>
<!-- <!--
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
Fileset for source of the Symfony YAML and Console components. Fileset for source of the Symfony YAML and Console components.
--> -->
<fileset id="symfony-sources" dir="./lib/vendor"> <fileset id="symfony-sources" dir="./lib/vendor">
<include name="Symfony/Components/**"/> <include name="Symfony/Component**"/>
</fileset> </fileset>
<!-- <!--
...@@ -76,21 +76,21 @@ ...@@ -76,21 +76,21 @@
Builds DBAL package, preparing it for distribution. Builds DBAL package, preparing it for distribution.
--> -->
<target name="build-dbal" depends="test"> <target name="build-dbal" depends="test">
<copy todir="${build.dir}/dbal"> <copy todir="${build.dir}/doctrine-dbal">
<fileset refid="shared-artifacts"/> <fileset refid="shared-artifacts"/>
</copy> </copy>
<copy todir="${build.dir}/dbal"> <copy todir="${build.dir}/doctrine-dbal">
<fileset refid="common-sources"/> <fileset refid="common-sources"/>
<fileset refid="dbal-sources"/> <fileset refid="dbal-sources"/>
</copy> </copy>
<copy todir="${build.dir}/dbal/Doctrine"> <copy todir="${build.dir}/doctrine-dbal/Doctrine">
<fileset refid="symfony-sources"/> <fileset refid="symfony-sources"/>
</copy> </copy>
<copy todir="${build.dir}/dbal/bin"> <copy todir="${build.dir}/doctrine-dbal/bin">
<fileset refid="bin-scripts"/> <fileset refid="bin-scripts"/>
</copy> </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="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}/dbal/Doctrine/DBAL/Version2.php ${build.dir}/dbal/Doctrine/DBAL/Version.php" passthru="true" /> <exec command="mv ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version2.php ${build.dir}/doctrine-dbal/Doctrine/DBAL/Version.php" passthru="true" />
</target> </target>
<target name="build" depends="test, build-dbal"/> <target name="build" depends="test, build-dbal"/>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
Builds distributable PEAR packages. Builds distributable PEAR packages.
--> -->
<target name="build-packages" depends="build"> <target name="build-packages" depends="build">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/dbal"> <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/doctrine-dbal">
<name>DoctrineDBAL</name> <name>DoctrineDBAL</name>
<summary>Doctrine Database Abstraction Layer</summary> <summary>Doctrine Database Abstraction Layer</summary>
<channel>pear.doctrine-project.org</channel> <channel>pear.doctrine-project.org</channel>
...@@ -148,17 +148,22 @@ ...@@ -148,17 +148,22 @@
<dependencies> <dependencies>
<php minimum_version="5.3.2" /> <php minimum_version="5.3.2" />
<pear minimum_version="1.6.0" recommended_version="1.6.1" /> <pear minimum_version="1.6.0" recommended_version="1.6.1" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="2.0.0BETA4" />
</dependencies> </dependencies>
<dirroles key="bin">script</dirroles> <dirroles key="bin">script</dirroles>
<replacement path="bin/doctrine" type="pear-config" from="@php_bin@" to="php_bin" /> <ignore>Doctrine/Common/</ignore>
<replacement path="bin/doctrine.php" type="pear-config" from="@php_bin@" to="php_bin" />
<replacement path="bin/doctrine.php" type="pear-config" from="@bin_dir@" to="bin_dir" />
<release> <release>
<install as="doctrine" name="bin/doctrine" /> <install as="doctrine-dbal" name="bin/doctrine-dbal" />
<install as="doctrine.php" name="bin/doctrine.php" /> <install as="doctrine-dbal.php" name="bin/doctrine-dbal.php" />
</release> </release>
</d51pearpkg2> </d51pearpkg2>
<exec command="pear package" dir="${build.dir}/dbal" passthru="true" /> <exec command="pear package" dir="${build.dir}/doctrine-dbal" passthru="true" />
<exec command="mv DoctrineDBAL-${version}.tgz ../../dist" dir="${build.dir}/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>
</target> </target>
</project> </project>
\ 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