-
Notifications
You must be signed in to change notification settings - Fork 1
/
pakefile
55 lines (42 loc) · 1.23 KB
/
pakefile
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
pake_desc('Run the unit tests');
pake_task('test');
pake_desc('Build phar file');
pake_task('phar');
pake_desc('PHP Lint the src folder');
pake_task('lint');
pake_desc('Copy to ~/bin');
pake_task('mv');
pake_desc('Display the version');
pake_task('version');
pake_desc('Build the app for deployment');
pake_task('build', 'lint', 'phar');
function run_build() {}
function run_version() {
$composer = json_decode(file_get_contents('composer.json'));
echo $composer->version . "\n";
}
function run_test() {
passthru("phpunit");
}
function run_phar()
{
echo " * Construction phar and moving to pake\n";
$command =
'rm -f pake && rm -f pake.phar &&'
. 'php -dphar.readonly=0 build/empir make bin/pake.phar dev.php . --exclude="'
. '*.git/*|*.gitignore|*test*|*Tests*|*.md|*/doc/*|*.lock|*token.txt|pakefile'
. '|bin/pake'
. '|.*|build/*|*.markdown|*.phar|*LICENSE|*AUTHORS|*CHANGELOG|*.dist|*.tpl'
. '" && chmod a+x bin/pake.phar'
. ' && mv bin/pake.phar bin/pake';
passthru($command);
}
function run_lint() {
echo "\n * Linting files\n";
passthru("./build/lint -R ./src");
}
function run_mv() {
exec('cp ./bin/pake ~/bin/pake');
}
/* End of pakefile */