Don't exclude RoboFile.php from grumphp scans (closes #294)
This commit is contained in:
parent
7ecfe8cb87
commit
281acf3068
3 changed files with 59 additions and 50 deletions
46
RoboFile.php
46
RoboFile.php
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Robo\Tasks;
|
||||
|
||||
/**
|
||||
* Manage robo tasks.
|
||||
*/
|
||||
class RoboFile extends Tasks
|
||||
{
|
||||
|
||||
/**
|
||||
* Create release archive
|
||||
* @return void
|
||||
*/
|
||||
public function release()
|
||||
{
|
||||
$this->stopOnFail();
|
||||
|
||||
$result = $this->taskExec('git')
|
||||
->arg('describe')
|
||||
->run();
|
||||
$result->provideOutputdata();
|
||||
|
||||
$tmpDir = $this->_tmpDir();
|
||||
|
||||
$filename = 'alltube-' . trim($result->getOutputData()) . '.zip';
|
||||
|
||||
$this->taskFilesystemStack()
|
||||
->remove($filename)
|
||||
->run();
|
||||
|
||||
$this->taskGitStack()
|
||||
->cloneRepo(__DIR__, $tmpDir)
|
||||
->run();
|
||||
|
||||
$this->taskComposerInstall()
|
||||
->dir($tmpDir)
|
||||
->optimizeAutoloader()
|
||||
->noDev()
|
||||
->run();
|
||||
|
||||
$this->taskPack($filename)
|
||||
->addDir('alltube', $tmpDir)
|
||||
->run();
|
||||
}
|
||||
}
|
59
classes/Robo/Plugin/Commands/ReleaseCommand.php
Normal file
59
classes/Robo/Plugin/Commands/ReleaseCommand.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace Alltube\Robo\Plugin\Commands;
|
||||
|
||||
use Robo\Task\Archive\Pack;
|
||||
use Robo\Task\Base\Exec;
|
||||
use Robo\Task\Composer\Install;
|
||||
use Robo\Task\Filesystem\FilesystemStack;
|
||||
use Robo\Task\Vcs\GitStack;
|
||||
use Robo\Tasks;
|
||||
|
||||
/**
|
||||
* Manage robo tasks.
|
||||
*/
|
||||
class ReleaseCommand extends Tasks
|
||||
{
|
||||
|
||||
/**
|
||||
* Create release archive
|
||||
* @return void
|
||||
*/
|
||||
public function release()
|
||||
{
|
||||
$this->stopOnFail();
|
||||
|
||||
/** @var Exec $gitTask */
|
||||
$gitTask = $this->taskExec('git');
|
||||
$result = $gitTask
|
||||
->arg('describe')
|
||||
->run();
|
||||
$result->provideOutputdata();
|
||||
|
||||
$tmpDir = $this->_tmpDir();
|
||||
|
||||
$filename = 'alltube-' . trim((string)$result->getOutputData()) . '.zip';
|
||||
|
||||
/** @var FilesystemStack $rmTask */
|
||||
$rmTask = $this->taskFilesystemStack();
|
||||
$rmTask->remove($filename)
|
||||
->run();
|
||||
|
||||
/** @var GitStack $gitTask */
|
||||
$gitTask = $this->taskGitStack();
|
||||
$gitTask->cloneRepo(__DIR__ . '/../../../../', $tmpDir)
|
||||
->run();
|
||||
|
||||
/** @var Install $composerTask */
|
||||
$composerTask = $this->taskComposerInstall();
|
||||
$composerTask->dir($tmpDir)
|
||||
->optimizeAutoloader()
|
||||
->noDev()
|
||||
->run();
|
||||
|
||||
/** @var Pack $packTask */
|
||||
$packTask = $this->taskPack($filename);
|
||||
$packTask->addDir('alltube', $tmpDir)
|
||||
->run();
|
||||
}
|
||||
}
|
|
@ -8,9 +8,5 @@ parameters:
|
|||
composer: ~
|
||||
phpcs:
|
||||
standard: PSR12
|
||||
ignore_patterns:
|
||||
- RoboFile.php
|
||||
phpstan:
|
||||
level: max
|
||||
ignore_patterns:
|
||||
- RoboFile.php
|
||||
|
|
Loading…
Reference in a new issue