Compare commits
No commits in common. "master" and "v2.13.1" have entirely different histories.
|
@ -89,19 +89,11 @@ class TaskmanArtefact
|
||||||
{
|
{
|
||||||
if(!isset($this->sources_affected[$idx]))
|
if(!isset($this->sources_affected[$idx]))
|
||||||
{
|
{
|
||||||
//NOTE: more conservative implementation which always checks for staleness
|
$sources = $this->task->getFileChanges() != null ?
|
||||||
//$sources = $this->task->getFileChanges() != null ?
|
//tries to match changed files with sources spec
|
||||||
// //tries to match changed files with sources spec
|
$this->getChangedSources($idx) :
|
||||||
// $this->getChangedSources($idx) :
|
$this->getSources($idx);
|
||||||
// $this->getSources($idx);
|
$this->sources_affected[$idx] = is_stale($this->getPath(), $sources);
|
||||||
//$this->sources_affected[$idx] = is_stale($this->getPath(), $sources);
|
|
||||||
|
|
||||||
//NOTE: if there any file changes we simply check if there are any changed sources,
|
|
||||||
// and if yes then we mark the artefact as affected
|
|
||||||
if($this->task->getFileChanges() != null)
|
|
||||||
$this->sources_affected[$idx] = count($this->getChangedSources($idx)) > 0;
|
|
||||||
else
|
|
||||||
$this->sources_affected[$idx] = is_stale($this->getPath(), $this->getSources($idx));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->sources_affected[$idx];
|
return $this->sources_affected[$idx];
|
||||||
|
|
|
@ -171,7 +171,6 @@ function _process_argv(array &$argv)
|
||||||
global $TASKMAN_BATCH;
|
global $TASKMAN_BATCH;
|
||||||
global $TASKMAN_NO_DEPS;
|
global $TASKMAN_NO_DEPS;
|
||||||
global $TASKMAN_FILE_CHANGES;
|
global $TASKMAN_FILE_CHANGES;
|
||||||
global $TASKMAN_SHOW_BENCH;
|
|
||||||
|
|
||||||
$filtered = array();
|
$filtered = array();
|
||||||
$process_defs = false;
|
$process_defs = false;
|
||||||
|
@ -186,6 +185,10 @@ function _process_argv(array &$argv)
|
||||||
$filtered[] = $argv[$j];
|
$filtered[] = $argv[$j];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if($v == '-D')
|
||||||
|
{
|
||||||
|
$process_defs = true;
|
||||||
|
}
|
||||||
else if($v == '-V')
|
else if($v == '-V')
|
||||||
{
|
{
|
||||||
$TASKMAN_LOG_LEVEL = 2;
|
$TASKMAN_LOG_LEVEL = 2;
|
||||||
|
@ -210,10 +213,6 @@ function _process_argv(array &$argv)
|
||||||
{
|
{
|
||||||
$TASKMAN_NO_DEPS = true;
|
$TASKMAN_NO_DEPS = true;
|
||||||
}
|
}
|
||||||
else if($v == '--bench')
|
|
||||||
{
|
|
||||||
$TASKMAN_SHOW_BENCH = true;
|
|
||||||
}
|
|
||||||
else if($v == '-c')
|
else if($v == '-c')
|
||||||
{
|
{
|
||||||
if(!isset($argv[$i+1]))
|
if(!isset($argv[$i+1]))
|
||||||
|
@ -230,10 +229,6 @@ function _process_argv(array &$argv)
|
||||||
|
|
||||||
++$i;
|
++$i;
|
||||||
}
|
}
|
||||||
else if($v == '-D')
|
|
||||||
{
|
|
||||||
$process_defs = true;
|
|
||||||
}
|
|
||||||
else if($process_defs)
|
else if($process_defs)
|
||||||
{
|
{
|
||||||
$eq_pos = strpos($v, '=');
|
$eq_pos = strpos($v, '=');
|
||||||
|
@ -313,12 +308,12 @@ function _show_bench(array $tasks, int $limit = 5)
|
||||||
if(!$times)
|
if(!$times)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
\taskman\log(1, "Top ".count($times)." time consuming tasks:\n");
|
\taskman\log(2, "Top ".count($times)." time consuming tasks:\n");
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach($times as $name => $time)
|
foreach($times as $name => $time)
|
||||||
{
|
{
|
||||||
++$n;
|
++$n;
|
||||||
\taskman\log(1, "$n) Task '$name': $time sec\n");
|
\taskman\log(2, "$n) Task '$name': $time sec\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ $GLOBALS['TASKMAN_LOGGER'] = '\taskman\internal\_default_logger';
|
||||||
$GLOBALS['TASKMAN_ERROR_HANDLER'] = null;
|
$GLOBALS['TASKMAN_ERROR_HANDLER'] = null;
|
||||||
$GLOBALS['TASKMAN_START_TIME'] = 0;
|
$GLOBALS['TASKMAN_START_TIME'] = 0;
|
||||||
$GLOBALS['TASKMAN_FILES_CHANGES'] = null;
|
$GLOBALS['TASKMAN_FILES_CHANGES'] = null;
|
||||||
$GLOBALS['TASKMAN_SHOW_BENCH'] = false;
|
|
||||||
|
|
||||||
include_once(__DIR__ . '/internal.inc.php');
|
include_once(__DIR__ . '/internal.inc.php');
|
||||||
include_once(__DIR__ . '/util.inc.php');
|
include_once(__DIR__ . '/util.inc.php');
|
||||||
|
@ -526,8 +525,7 @@ function main(
|
||||||
else if($default_task)
|
else if($default_task)
|
||||||
run($default_task, $argv);
|
run($default_task, $argv);
|
||||||
|
|
||||||
if($GLOBALS['TASKMAN_SHOW_BENCH'])
|
internal\_show_bench($task_objs);
|
||||||
internal\_show_bench($task_objs);
|
|
||||||
|
|
||||||
log(0, "***** All done (".round(microtime(true)-$GLOBALS['TASKMAN_START_TIME'],2)." sec.) *****\n");
|
log(0, "***** All done (".round(microtime(true)-$GLOBALS['TASKMAN_START_TIME'],2)." sec.) *****\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue