Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mms] Composer file is now generated/updated before releasing.
- Loading branch information
Showing
9 changed files
with
164 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
/** | ||
* Copyright 2013 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (LGPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/lgpl21. | ||
* | ||
* @category Horde | ||
* @copyright 2013 Horde LLC | ||
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 | ||
* @link http://pear.horde.org/index.php?package=Components | ||
* @package Components | ||
*/ | ||
|
||
/** | ||
* This task updates the composer.json file right before the release. | ||
* | ||
* @author Michael Slusarz <slusarz@horde.org> | ||
* @category Horde | ||
* @copyright 2013 Horde LLC | ||
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 | ||
* @link http://pear.horde.org/index.php?package=Components | ||
* @package Components | ||
*/ | ||
class Components_Release_Task_Composer | ||
extends Components_Release_Task_Base | ||
{ | ||
/** | ||
* Can the task be skipped? | ||
* | ||
* @param array $options Additional options. | ||
* | ||
* @return boolean True if it can be skipped. | ||
*/ | ||
public function skip($options) | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Validate the preconditions required for this release task. | ||
* | ||
* @param array $options Additional options. | ||
* | ||
* @return array An empty array if all preconditions are met and a list of | ||
* error messages otherwise. | ||
*/ | ||
public function validate($options) | ||
{ | ||
if (!$this->getComponent()->hasLocalPackageXml()) { | ||
return array( | ||
'The component lacks a local package.xml!', | ||
); | ||
} | ||
$diff_options = $options; | ||
$diff_options['no_timestamp'] = true; | ||
$diff = $this->getComponent()->updatePackageXml('diff', $diff_options); | ||
if (!empty($diff)) { | ||
return array( | ||
"The package.xml file is not up-to-date:\n$diff" | ||
); | ||
} | ||
return array(); | ||
} | ||
|
||
/** | ||
* Run the task. | ||
* | ||
* @param array &$options Additional options. | ||
* | ||
* @return NULL | ||
*/ | ||
public function run(&$options) | ||
{ | ||
$result = $this->getComponent()->updateComposer($options); | ||
if (!$this->getTasks()->pretend()) { | ||
$this->getOutput()->ok($result); | ||
} else { | ||
$this->getOutput()->info($result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters