-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRoboFile.php
55 lines (45 loc) · 1.14 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* PHP Version 5.6
* @category Library
* @package ChangeLog
* @author Emlyn West <[email protected]>
* @license MIT http://opensource.org/licenses/MIT
* @link https://github.com/emlynwest/changelog
*/
use Robo\Tasks;
use Symfony\Component\Finder\Finder;
class RoboFile extends Tasks
{
public function createPhar()
{
$collection = $this->collection();
$this->taskComposerInstall()
->noDev()
->optimizeAutoloader()
->printed(false)
->addToCollection($collection);
$packer = $this->taskPackPhar('package/changelog.phar')
->compress(true)
->stub('package/stub.php');
$files = Finder::create()
->ignoreVCS(true)
->files()
->name('*.php')
->path('src')
->path('vendor')
->in(__DIR__);
foreach ($files as $file) {
$packer->addFile($file->getRelativePathname(), $file->getRealPath());
}
@unlink('package/bin');
@unlink('package/changelog.phar');
copy('changelog', 'package/bin');
$packer->addFile('changelog', 'package/bin')
->addToCollection($collection);
$this->taskComposerInstall()
->printed(false)
->addToCollection($collection);
$collection->run();
}
}