Permalink
Browse files

refactored build including git subsplit management and PEAR package g…

…eneration
  • Loading branch information...
claylo authored and mtdowling committed Oct 11, 2012
1 parent b9e63ad commit 637d5f76bb1d02b6560cfae24e66716f2dcf0db3
Showing with 536 additions and 208 deletions.
  1. +4 −35 build.xml
  2. +1 −1 phing/imports/dependencies.xml
  3. +140 −119 phing/imports/deploy.xml
  4. +333 −0 phing/tasks/GuzzlePearPharPackageTask.php
  5. +58 −53 phing/tasks/GuzzleSubSplitTask.php
View
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
+<<<<<<< HEAD
<project name="guzzle" default="package">
+=======
+<project name="guzzle" default="test">
+>>>>>>> refactored build including git subsplit management and PEAR package generation
<!-- set local values, like git location -->
<property file="phing/build.properties" override="true" />
@@ -45,39 +49,4 @@
<exec passthru="true" command="open ${dir.output}/coverage/index.html" />
</target>
- <target name="package" depends="test-init" description="Create a phar with an autoloader">
- <pharpackage
- destfile="${dir.output}/guzzle.phar"
- basedir="."
- stub="phar-stub.php"
- signature="md5">
- <fileset dir=".">
- <include name="src/**/*.php" />
- <include name="vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php" />
- <include name="vendor/symfony/event-dispatcher/**/*.php" />
- <include name="vendor/doctrine/common/lib/Doctrine/Common/Cache/*.php" />
- <include name="vendor/monolog/monolog/src/**/*.php" />
- </fileset>
- <metadata>
- <element name="author" value="Michael Dowling" />
- </metadata>
- </pharpackage>
- <exec command="php -d guzzle_phar=${dir.output}/guzzle.phar `which phpunit`" passthru="true" />
- </target>
-
- <target name="package-min" depends="test-init" description="Create a minimal phar">
- <pharpackage
- destfile="${dir.output}/guzzle-min.phar"
- basedir="."
- stub="phar-stub-min.php"
- signature="md5">
- <fileset dir=".">
- <include name="src/**/*.php" />
- </fileset>
- <metadata>
- <element name="author" value="Michael Dowling" />
- </metadata>
- </pharpackage>
- <exec command="php -d guzzle_phar=${dir.output}/guzzle-min.phar `which phpunit`" passthru="true" />
- </target>
</project>
@@ -11,7 +11,7 @@
<taskdef name="composerlint" classname="phing.tasks.ComposerLintTask" />
<taskdef name="testserver" classname="phing.tasks.NodeServerTask" />
<taskdef name="guzzlesubsplit" classname="phing.tasks.GuzzleSubSplitTask" />
- <taskdef name="guzzlepear" classname="phing.tasks.GuzzlePEARPackageTask" />
+ <taskdef name="guzzlepear" classname="phing.tasks.GuzzlePearPharPackageTask" />
<!--
Handle locating composer (global) or composer.phar, and
View
@@ -1,124 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="../../" default="deploy">
-
-
- <property name="git.status" value=""/>
- <property name="git.currentbranch" value=""/>
- <target name="check-git-branch-status">
- <exec command="git status -s -b" outputProperty="git.currentbranch" />
- <if>
- <equals arg1="${git.currentbranch}" arg2="## ${head}" trim="true"/>
- <then>
- <echo>On branch ${head}</echo>
- </then>
- <else>
- <fail message="-Dhead=${head} arg did not match ${git.currentbranch}"/>
- </else>
- </if>
- <exec command="git status -s" outputProperty="git.status" />
- <if>
- <equals arg1="${git.status}" arg2="" trim="true"/>
- <then>
- <echo>working directory clean</echo>
- </then>
- <else>
- <echo>${git.status}</echo>
- <fail message="Working directory isn't clean." />
- </else>
- </if>
- </target>
-
- <property name="version.changelog" value=""/>
- <property name="version.version" value=""/>
- <target name="check-changelog-version">
- <exec executable="fgrep" outputProperty="version.changelog">
- <arg value="* ${new.version} ("/>
- <arg value="${project.basedir}/CHANGELOG.md"/>
- </exec>
- <if>
- <equals arg1="${version.changelog}" arg2="" trim="true"/>
- <then>
- <fail message="${new.version} not mentioned in CHANGELOG"/>
- </then>
- </if>
-
- <exec executable="fgrep" outputProperty="version.version">
- <arg value="const VERSION = '${new.version}'"/>
- <arg value="${project.basedir}/src/Guzzle/Common/Version.php"/>
- </exec>
- <if>
- <equals arg1="${version.version}" arg2="" trim="true"/>
- <then>
- <fail message="${new.version} not mentioned in Guzzle\Common\Version"/>
- </then>
- </if>
-
- <echo>ChangeLog Match: ${version.changelog}</echo>
- <echo>Guzzle\Common\Version Match: ${version.version}</echo>
- </target>
-
- <target name="help" description="HELP AND REMINDERS about what you can do with this project">
- <echo>releasing: phing -Dnew.version=3.0.x -Dhead=master release</echo>
- <echo>--</echo>
- <exec command="phing -l" passthru="true"/>
- </target>
-
- <target name="release" depends="check-changelog-version,check-git-branch-status"
- description="tag, subtree split, package, deploy: Use: phing -Dnew.version=[TAG] -Dhead=[BRANCH] release">
- <if>
- <isset property="new.version" />
- <then>
+
+ <property name="git.status" value=""/>
+ <property name="git.currentbranch" value=""/>
+ <target name="check-git-branch-status">
+ <exec command="git status -s -b" outputProperty="git.currentbranch" />
+ <if>
+ <equals arg1="${git.currentbranch}" arg2="## ${head}" trim="true"/>
+ <then>
+ <echo>On branch ${head}</echo>
+ </then>
+ <else>
+ <fail message="-Dhead=${head} arg did not match ${git.currentbranch}"/>
+ </else>
+ </if>
+ <exec command="git status -s" outputProperty="git.status" />
+ <if>
+ <equals arg1="${git.status}" arg2="" trim="true"/>
+ <then>
+ <echo>working directory clean</echo>
+ </then>
+ <else>
+ <echo>${git.status}</echo>
+ <fail message="Working directory isn't clean." />
+ </else>
+ </if>
+ </target>
+
+ <property name="version.changelog" value=""/>
+ <property name="version.version" value=""/>
+ <target name="check-changelog-version">
+ <exec executable="fgrep" outputProperty="version.changelog">
+ <arg value="* ${new.version} ("/>
+ <arg value="${project.basedir}/CHANGELOG.md"/>
+ </exec>
+ <if>
+ <equals arg1="${version.changelog}" arg2="" trim="true"/>
+ <then>
+ <fail message="${new.version} not mentioned in CHANGELOG"/>
+ </then>
+ </if>
+
+ <exec executable="fgrep" outputProperty="version.version">
+ <arg value="const VERSION = '${new.version}'"/>
+ <arg value="${project.basedir}/src/Guzzle/Common/Version.php"/>
+ </exec>
+ <if>
+ <equals arg1="${version.version}" arg2="" trim="true"/>
+ <then>
+ <fail message="${new.version} not mentioned in Guzzle\Common\Version"/>
+ </then>
+ </if>
+
+ <echo>ChangeLog Match: ${version.changelog}</echo>
+ <echo>Guzzle\Common\Version Match: ${version.version}</echo>
+ </target>
+
+ <target name="help" description="HELP AND REMINDERS about what you can do with this project">
+ <echo>releasing: phing -Dnew.version=3.0.x -Dhead=master release</echo>
+ <echo>--</echo>
+ <exec command="phing -l" passthru="true"/>
+ </target>
+
+ <target name="release" depends="check-changelog-version,check-git-branch-status"
+ description="tag, subtree split, package, deploy: Use: phing -Dnew.version=[TAG] -Dhead=[BRANCH] release">
<if>
- <contains string="${new.version}" substring="v" casesensitive="false" />
- <then>
- <fail message="Please specify version as [0-9].[0-9].[0-9]. (I'll add v for you.)"/>
- </then>
-
-
- <else>
-
- <echo>BEGINNING RELEASE FOR ${new.version}</echo>
-
- <!-- checkout the specified branch -->
- <!-- <gitcheckout repository="${repo.dir}" branchname="${head}" gitPath="${cmd.git}" /> -->
-
- <!-- tag the release -->
- <gittag repository="${repo.dir}" name="v${new.version}" gitPath="${cmd.git}" />
-
- <!-- push the tag up so subsplit will get it -->
- <gitpush repository="${repo.dir}" tags="true" gitPath="${cmd.git}" />
-
- <!-- now do the subsplits -->
- <guzzlesubsplit
- repository="${repo.dir}"
- remote="${guzzle.remote}"
- heads="${head}"
- base="src"
- subIndicatorFile="composer.json"
- gitPath="${cmd.git}" />
-
-
- <!-- and now the pear packages -->
- <guzzlepear
- version="${new.version}"
- />
- </else>
+ <isset property="new.version" />
+ <then>
+ <if>
+ <contains string="${new.version}" substring="v" casesensitive="false" />
+ <then>
+ <fail message="Please specify version as [0-9].[0-9].[0-9]. (I'll add v for you.)"/>
+ </then>
+
+
+ <else>
+
+ <echo>BEGINNING RELEASE FOR ${new.version}</echo>
+
+ <!-- checkout the specified branch -->
+ <!-- <gitcheckout repository="${repo.dir}" branchname="${head}" gitPath="${cmd.git}" /> -->
+
+ <!-- tag the release -->
+ <gittag repository="${repo.dir}" name="v${new.version}" gitPath="${cmd.git}" />
+
+ <!-- push the tag up so subsplit will get it -->
+ <gitpush repository="${repo.dir}" tags="true" gitPath="${cmd.git}" />
+
+ <!-- now do the subsplits -->
+ <guzzlesubsplit
+ repository="${repo.dir}"
+ remote="${guzzle.remote}"
+ heads="${head}"
+ base="src"
+ subIndicatorFile="composer.json"
+ gitPath="${cmd.git}" />
+
+
+ <!-- and now the pear packages -->
+ <guzzlepear
+ version="${new.version}"
+ makephar="true"
+ />
+ </else>
+
+ </if>
+ </then>
+
+ <else>
+ <echo>Tip: to create a new release, do: phing -Dnew.version=[TAG] -Dhead=[BRANCH] release</echo>
+ </else>
</if>
- </then>
-
- <else>
- <echo>Tip: to create a new release, do: phing -Dnew.version=[TAG] release</echo>
- </else>
-
- </if>
- </target>
-
- <target name="peartest">
- <guzzlepear
- version="${new.version}"
- />
- </target>
-
-
-</project>
+ </target>
+
+ <target name="peartest">
+ <guzzlepear
+ version="${new.version}"
+ deploy="false"
+ makephar="false"
+ />
+ </target>
+
+ <target name="package-phar" depends="test-init" description="Create a phar with an autoloader">
+ <pharpackage
+ destfile="${dir.output}/guzzle.phar"
+ basedir="${project.basedir}/.subsplit"
+ stub="phar-stub.php"
+ signature="md5">
+ <fileset dir="${project.basedir}/.subsplit">
+ <include name="src/**/*.php" />
+ <include name="vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php" />
+ <include name="vendor/symfony/event-dispatcher/**/*.php" />
+ <include name="vendor/doctrine/common/lib/Doctrine/Common/Cache/*.php" />
+ <include name="vendor/monolog/monolog/src/**/*.php" />
+ </fileset>
+ <metadata>
+ <element name="author" value="Michael Dowling" />
+ </metadata>
+ </pharpackage>
+ <exec command="php -d guzzle_phar=${dir.output}/guzzle.phar `which phpunit`" passthru="true" />
+ </target>
+
+</project>
Oops, something went wrong.

0 comments on commit 637d5f7

Please sign in to comment.