From f7dc1ee7c24399075c937921d4e0752e26b9a237 Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Sun, 19 Jul 2015 07:59:04 +0000 Subject: [PATCH] * determining done: + is/markDone --- src/goals/DefaultGoal.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/goals/DefaultGoal.php b/src/goals/DefaultGoal.php index 8b44038..f178790 100644 --- a/src/goals/DefaultGoal.php +++ b/src/goals/DefaultGoal.php @@ -21,7 +21,7 @@ class DefaultGoal extends BaseGoal { public $goalName; - public $done = false; + public $done = []; protected $_fileType = null; @@ -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() @@ -118,6 +130,7 @@ public function getVendor() public function getVcs() { + /// TODO determine VCS return $this->getConfig()->getItem('git'); } }