Commit 2ebae44b authored by Benjamin Eberlei's avatar Benjamin Eberlei

New build process

- Switch from phing to ant
- Add composer archive for packages
- Remove PEAR package building
parent 64224564
# Project Name
project.name=DoctrineDBAL
# Dependency minimum versions
dependencies.common=2.0.1
dependencies.sfconsole=2.0.0
# Version class and file # Version class and file
project.version_class = Doctrine\DBAL\Version project.version_class = Doctrine\\DBAL\\Version
project.version_file = lib/Doctrine/DBAL/Version.php project.version_file = lib/Doctrine/DBAL/Version.php
<?xml version="1.0"?> <?xml version="1.0"?>
<project name="DoctrineDBAL" default="build" basedir="."> <project name="DoctrineDBAL" default="build" basedir=".">
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
<import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
<property file="build.properties" /> <property file="build.properties" />
<!-- <target name="php">
Fileset for artifacts shared across all distributed packages. <exec executable="which" outputproperty="php_executable">
--> <arg value="php" />
<fileset id="shared-artifacts" dir="."> </exec>
<include name="LICENSE"/> </target>
</fileset>
<!-- <target name="prepare">
Fileset for command line scripts <mkdir dir="build" />
--> </target>
<fileset id="bin-scripts" dir="./bin">
<include name="doctrine-dbal"/>
<include name="doctrine-dbal.php"/>
</fileset>
<!-- <target name="build" depends="check-git-checkout-clean,prepare,php,composer">
Fileset for the sources of the Doctrine Common dependency. <exec executable="${php_executable}">
--> <arg value="build/composer.phar" />
<fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib"> <arg value="archive" />
<include name="Doctrine/Common/**"/> <arg value="--dir=build" />
</fileset> </exec>
</target>
<!-- <target name="composer" depends="php,composer-check,composer-download">
Fileset for the sources of the Doctrine DBAL package. <exec executable="${php_executable}">
--> <arg value="build/composer.phar" />
<fileset id="dbal-sources" dir="./lib"> <arg value="install" />
<include name="Doctrine/DBAL/**"/> </exec>
</fileset> </target>
<!-- <target name="composer-check" depends="prepare">
Fileset for source of the Symfony YAML and Console components. <available file="build/composer.phar" property="composer.present"/>
--> </target>
<fileset id="external-sources" dir="./lib/vendor">
<include name="Symfony/Component**"/>
</fileset>
<target name="copy-files" depends="prepare"> <target name="composer-download" unless="composer.present">
<echo msg="Checking for ${version} in ${project.version_file}" /> <exec executable="wget">
<exec command="grep '${version}' ${project.basedir}/${project.version_file}" checkreturn="true"/> <arg value="-Obuild/composer.phar" />
<copy todir="${build.dir}/${project.name}-${version}"> <arg value="http://getcomposer.org/composer.phar" />
<fileset refid="shared-artifacts"/> </exec>
</copy>
<copy todir="${build.dir}/${project.name}-${version}">
<fileset refid="common-sources"/>
<fileset refid="dbal-sources"/>
</copy>
<copy todir="${build.dir}/${project.name}-${version}/Doctrine">
<fileset refid="external-sources"/>
</copy>
<copy todir="${build.dir}/${project.name}-${version}/bin">
<fileset refid="bin-scripts"/>
</copy>
</target> </target>
<target name="define-pear-package" depends="copy-files"> <target name="make-release" depends="check-git-checkout-clean,prepare,php">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}"> <replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
<name>${project.name}</name> <exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
<summary>Doctrine Database Abstraction Layer</summary> <arg value="-r" />
<channel>pear.doctrine-project.org</channel> <arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
<description>The Doctrine DBAL package is the database abstraction layer used to power the ORM package.</description> </exec>
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" /> <exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" /> <arg value="-r" />
<lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" /> <arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
<lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" /> if (count($parts) != 3) {
<license>LGPL</license> throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
<version release="${pear.version}" api="${pear.version}" /> }
<stability release="${pear.stability}" api="${pear.stability}" /> $parts[2]++;
<notes>-</notes> echo implode('.', $parts);
<dependencies> " />
<php minimum_version="5.3.2" /> </exec>
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="${dependencies.common}" /> <git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
<package name="Console" channel="pear.symfony.com" minimum_version="${dependencies.sfconsole}" /> <git-tag version="${doctrine.current_version}" />
</dependencies> <replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
<dirroles key="bin">script</dirroles> <git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
<ignore>Doctrine/Common/</ignore>
<ignore>Doctrine/Symfony/</ignore>
<release>
<install as="doctrine-dbal" name="bin/doctrine-dbal" />
<install as="doctrine-dbal.php" name="bin/doctrine-dbal.php" />
</release>
</d51pearpkg2>
</target> </target>
<target name="check-git-checkout-clean">
<exec executable="git" failonerror="true">
<arg value="diff-index" />
<arg value="--quiet" />
<arg value="HEAD" />
</exec>
</target>
<macrodef name="git-commit">
<attribute name="file" default="NOT SET"/>
<attribute name="message" default="NOT SET"/>
<sequential>
<exec executable="git">
<arg value="add" />
<arg value="@{file}" />
</exec>
<exec executable="git">
<arg value="commit" />
<arg value="-m" />
<arg value="@{message}" />
</exec>
</sequential>
</macrodef>
<macrodef name="git-tag">
<attribute name="version" default="NOT SET" />
<sequential>
<exec executable="git">
<arg value="tag" />
<arg value="-m" />
<arg value="v@{version}" />
<arg value="v@{version}" />
</exec>
</sequential>
</macrodef>
</project> </project>
...@@ -30,7 +30,10 @@ ...@@ -30,7 +30,10 @@
}, },
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.4.x-dev" "dev-master": "2.5.x-dev"
} }
},
"archive": {
"exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
} }
} }
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