Permalink
Browse files

Modifying build to parameterise both version and channel

  • Loading branch information...
1 parent 2388b56 commit ae8d6a597caff79541ddfe96bfd09498db8e9ac7 Gavin Davies committed Oct 25, 2011
Showing with 12 additions and 6 deletions.
  1. +1 −1 build.xml
  2. +11 −5 package.php
View
@@ -16,7 +16,7 @@
<target name="test" depends="test-php,test-cs" description="Run all tests"></target>
<target name="pear-package">
- <exec command="php package.php ${version}" passthru="true" />
+ <exec command="php package.php ${version} ${channel}" passthru="true" />
<exec command="pear package lib/package.xml" passthru="true" />
</target>
View
@@ -3,25 +3,31 @@
* Package file for creating PEAR packages. This file defines how the PEAR
* package should be constructed.
*
- * Before a new tag is made, VERSION should be incremented to the new tag identifier.
+ * usage: php package.php VERSION {channel}
+ * VERSION is required
+ * {CHANNEL}
*
* @author Box UK <opensource@boxuk.com>
* @copyright Copyright (c) 2011, Box UK
* @license http://opensource.org/licenses/mit-license.php MIT License and http://www.gnu.org/licenses/gpl.ht$
* @link http://github.com/boxuk/describr
* @since 1.4.0
*/
-define( 'BOXUK_PEAR_CHANNEL', 'pear.boxuk.net' );
-
require_once( 'PEAR/PackageFileManager2.php' );
require_once( 'PEAR/PackageFileManager/File.php' );
-@list( $IGNORE, $version ) = $_SERVER['argv'];
+@list( $IGNORE, $version, $channel ) = $_SERVER['argv'];
if ( !$version ) {
- echo "usage: php package.php VERSION\n";
+ echo "usage: php package.php VERSION {CHANNEL}\n";
+ echo " VERSION is required\n";
+ echo " {CHANNEL} is optional\n";
exit( 1 );
}
+if( !$channel ) {
+ $channel = 'pear.boxuk.net';
+}
+define( 'BOXUK_PEAR_CHANNEL', $channel );
$aFilesToIgnore = array();
$aFilesToIgnore[] = 'bootstrap.php';

0 comments on commit ae8d6a5

Please sign in to comment.