Skip to content

Commit

Permalink
* determining done: + is/markDone
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jul 19, 2015
1 parent f4a8f5b commit f7dc1ee
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/goals/DefaultGoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefaultGoal extends BaseGoal
{
public $goalName;

public $done = false;
public $done = [];

protected $_fileType = null;

Expand Down Expand Up @@ -67,17 +67,29 @@ public function actionDeps()
}
}

public function actionPerform()
public function isDone($action, $timestamp = null)
{
if ($this->done[$action]) {
Yii::trace("Already done: $this->goalName/$action");
return true;
}
return false;
}

public function markDone($action)
{
if ($this->done) {
Yii::trace("Already done: $this->goalName");
$this->done[$action] = microtime(1);
}

public function actionPerform()
{
if ($this->isDone('perform')) {
return;
}
Yii::trace("Started: $this->goalName");
$this->actionDeps();
$this->actionMake();
$this->done = true;
$this->markDone('perform');
}

public function actionLoad()
Expand Down Expand Up @@ -118,6 +130,7 @@ public function getVendor()

public function getVcs()
{
/// TODO determine VCS
return $this->getConfig()->getItem('git');
}
}

0 comments on commit f7dc1ee

Please sign in to comment.