jasny/robo-extensions

此包已被废弃,不再维护。未建议替代包。

RoboTask的自定义任务

v0.2.0 2015-08-24 00:25 UTC

This package is auto-updated.

Last update: 2022-03-22 22:46:55 UTC


README

安装

composer require jasny\robo-extensions

用法

class RoboFile extends Robo\Tasks
{
    use Jasny\Robo\loadTasks;
    
    ...
}

LessTask

Robo\Task\Assets\Less 的一个版本,支持传递选项和使用 uri_root 选项给 less.php。

  $this->taskLess(['www/less/main.less' => 'www/css/style.css'])
    ->compiler('less', [
       'base' => 'www',
       'strictMath' => true
    ])
    ->run();

BumpVersionTask

在json文件中提升版本。

可选地,git标签被引用以确定新版本。

  $this->taskBumpVersion('composer.json')
    ->inc('minor')
    ->run();

  $this->taskBumpVersion('composer.json')
    ->to('1.2.6')
    ->run();

  // `to` also works for 'major', 'minor' and 'patch'
  $this->taskBumpVersion('composer.json')
    ->to('minor')
    ->run();

  // Check the git tags
  $this->taskBumpVersion('composer.json')
    ->inc('patch')
    ->useGit()
    ->run();