-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task.php
83 lines (77 loc) · 2.57 KB
/
Task.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Xinc - Continuous Integration.
*
* PHP version 5
*
* @category Development
* @package Xinc.Plugin.Repos.Builder
* @author Arno Schneider <username@example.org>
* @copyright 2007 Arno Schneider, Barcelona
* @license http://www.gnu.org/copyleft/lgpl.html GNU/LGPL, see license.php
* This file is part of Xinc.
* Xinc is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* Xinc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Xinc, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @link http://code.google.com/p/xinc/
*/
require_once 'Xinc/Plugin/Task/Abstract.php';
class Xinc_Plugin_Repos_Builder_Task extends Xinc_Plugin_Task_Abstract
{
/**
* Validates if a task can run by checking configs, directries and so on.
*
* @return boolean Is true if task can run.
*/
public function validate()
{
foreach ($this->arSubtasks as $task) {
if (!$task instanceof Xinc_Plugin_Repos_Builder_AbstractTask) {
return false;
}
}
return true;
}
/**
* Returns name of task.
*
* @return string Name of task.
*/
public function getName()
{
return 'builders';
}
/**
* Returns the slot of this task inside a build.
*
* @return integer The slot number.
* @see Xinc/Plugin/Slot.php for available slots
*/
public function getPluginSlot()
{
return Xinc_Plugin_Slot::PROCESS;
}
public function process(Xinc_Build_Interface $build)
{
$build->info('Processing builders');
foreach ( $this->arSubtasks as $task ) {
$task->process($build);
if ($build->getStatus() != Xinc_Build_Interface::PASSED) {
$build->error('Build FAILED ');
return;
}
}
$build->info('Processing builders done');
//$project->setStatus(Xinc_Build_Interface::STOPPED);
}
}