Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reimplement build process

- Introduce Composer Archiving for release packaging
- Replace Phing build.xml with Ant implementation
- Removed PEAR package building
  • Loading branch information...
commit 94956cb60a1bf3ac1ebc46d3f3090d769ad4924c 1 parent 8a3b660
@beberlei beberlei authored
View
2  .gitignore
@@ -5,3 +5,5 @@ dist/
tests/Doctrine/Tests/Common/Proxy/generated/
vendor/
.idea
+doctrine-common-*.tar
+doctrine-common-*.tar.gz
View
5 build.properties
@@ -1,6 +1,3 @@
-# Project Name
-project.name=DoctrineCommon
-
# Version class and file
-project.version_class = Doctrine\Common\Version
+project.version_class = Doctrine\\Common\\Version
project.version_file = lib/Doctrine/Common/Version.php
View
152 build.xml
@@ -1,59 +1,101 @@
<?xml version="1.0"?>
-<project name="Doctrine2" default="build" basedir=".">
- <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
- <import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
-
+<project name="DoctrineCommon" default="build" basedir=".">
<property file="build.properties" />
-
- <!--
- Fileset for artifacts shared across all distributed packages.
- -->
- <fileset id="shared-artifacts" dir=".">
- <include name="LICENSE"/>
- <include name="COPYRIGHT"/>
- <include name="CHANGELOG"/>
- </fileset>
-
- <!--
- Fileset for the sources of the Doctrine Common package.
- -->
- <fileset id="common-sources" dir="./lib">
- <include name="Doctrine/Common/**"/>
- </fileset>
-
- <!--
- Builds Common package, preparing it for distribution.
- -->
- <target name="copy-files" depends="prepare">
- <copy todir="${build.dir}/${project.name}-${version}">
- <fileset refid="shared-artifacts"/>
- </copy>
- <copy todir="${build.dir}/${project.name}-${version}">
- <fileset refid="common-sources"/>
- </copy>
- </target>
-
- <!--
- Builds distributable PEAR packages.
- -->
- <target name="define-pear-package" depends="copy-files">
- <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
- <name>DoctrineCommon</name>
- <summary>Doctrine Common PHP Extensions</summary>
- <channel>pear.doctrine-project.org</channel>
- <description>The Doctrine Common package contains shared code between the other packages.</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>MIT</license>
- <version release="${pear.version}" api="${pear.version}" />
- <stability release="${pear.stability}" api="${pear.stability}" />
- <notes>-</notes>
- <dependencies>
- <php minimum_version="5.3.0" />
- <pear minimum_version="1.6.0" recommended_version="1.6.1" />
- </dependencies>
- </d51pearpkg2>
+
+ <target name="php">
+ <exec executable="which" outputproperty="php_executable">
+ <arg value="php" />
+ </exec>
+ </target>
+
+ <target name="prepare">
+ <mkdir dir="build" />
+ </target>
+
+ <target name="build" depends="check-git-checkout-clean,prepare,php,composer">
+ <exec executable="${php_executable}">
+ <arg value="build/composer.phar" />
+ <arg value="archive" />
+ <arg value="--dir=build" />
+ </exec>
</target>
+
+ <target name="composer" depends="php,composer-check,composer-download">
+ <exec executable="${php_executable}">
+ <arg value="build/composer.phar" />
+ <arg value="install" />
+ </exec>
+ </target>
+
+ <target name="composer-check" depends="prepare">
+ <available file="build/composer.phar" property="composer.present"/>
+ </target>
+
+ <target name="composer-download" unless="composer.present">
+ <exec executable="wget">
+ <arg value="-Obuild/composer.phar" />
+ <arg value="http://getcomposer.org/composer.phar" />
+ </exec>
+ </target>
+
+ <target name="make-release" depends="check-git-checkout-clean,prepare,php">
+ <replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
+ <exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
+ <arg value="-r" />
+ <arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
+ </exec>
+ <exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
+ <arg value="-r" />
+ <arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
+ if (count($parts) != 3) {
+ throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
+ }
+ $parts[2]++;
+ echo implode('.', $parts);
+ " />
+ </exec>
+
+ <git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
+ <git-tag version="${doctrine.current_version}" />
+ <replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
+ <git-commit file="${project.version_file}" message="Bump version to ${doctrine.current_version}" />
+ </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>
View
3  composer.json
@@ -27,5 +27,8 @@
"branch-alias": {
"dev-master": "2.5.x-dev"
}
+ },
+ "archive": {
+ "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
}
}
View
2  lib/Doctrine/Common/Version.php
@@ -34,7 +34,7 @@ class Version
/**
* Current Doctrine Version.
*/
- const VERSION = '2.4.1';
+ const VERSION = '2.5.0-DEV';
/**
* Compares a Doctrine version with the current one.
Please sign in to comment.
Something went wrong with that request. Please try again.