-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
110 lines (98 loc) · 3.83 KB
/
Makefile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
default:
@echo "Respect Foundation"
@echo 'Please see "make help" for instructions'
help:
@echo "Respect Foundation\n"
@echo "Available targets:"
@echo "help\t\t This message"
@echo "test\t\t Run all tests"
@echo "coverage\t Run all tests and write HTML coverage reports"
@echo "dev\t\t Install the necessary packages to develop this project"
@echo "patch\t\t Updates the package.xml and composer.json increasing the patch revision number (1.1.x)"
@echo "minor\t\t Updates the package.xml and composer.json increasing the minor revision number (1.x.0)"
@echo "major\t\t Updates the package.xml and composer.json increasing the major revision number (x.0.0)"
@echo "pear\t\t Creates a PEAR package from the current package.xml"
@echo "phar\t\t Creates a Phar package from the current package.xml"
@echo "pirum-push\t PKG=FooPackage.tgz REPO=GitHubFooUser/GitHubFooRepo Send a tgz pear package to Pirum repository (requires git write access)"
@echo "phar-push\t PKG=FooPackage.phar REPO=GitHubFooUser/GitHubFooRepo Send a phar packages to phar repository (requires git write access)"
test:
@cd tests;phpunit .
coverage:
@cd tests;phpunit --coverage-html=reports/coverage .
@echo "Done. Reports available on tests/reports/coverage/index.html"
dev:
@echo "Installing PEAR packages... (please run as root if needed)"
pear upgrade
pear config-set auto_discover 1
-pear channel-discover respect.li/pear
pear install --soft --force pear.phpunit.de/PHPUnit
pear install --soft --force pear.pirum-project.org/Pirum
pear install --soft --force --alldeps -o package.xml
patch:
@echo "Generating package.xml and composer.json patch version"
@echo
php bin/pear-package.php patch ${STABILITY}
@echo
php bin/composer-package.php patch ${STABILITY}
minor:
@echo "Generating package.xml and composer.json minor version"
@echo
php bin/pear-package.php minor ${STABILITY}
@echo
php bin/composer-package.php minor ${STABILITY}
major:
@echo "Generating package.xml and composer.json major version"
@echo
php bin/pear-package.php major ${STABILITY}
@echo
php bin/composer-package.php major ${STABILITY}
pear:
@echo "Generating package tgz"
pear package package.xml
phar:
@echo "Generating package phar"
php -dphar.readonly=0 bin/phar-package.php
pirum-push:
@echo "Cloning channel from git ${REPO}"
-rm -Rf pirum
git clone git@github.com:${REPO}.git pirum
pirum add pirum ${PKG};pirum build pirum;
cd pirum;git add .;git commit -m "Added ${PKG}";git push
@echo "Success! Pushed ${PKG}"
phar-push:
@echo "Cloning channel from git ${REPO}"
-rm -Rf phar
git clone git@github.com:${REPO}.git phar
cp ${PKG} phar
cd phar;git add .;git commit -m "Added ${PKG}";git push
@echo "Success! Pushed ${PKG}"
foundation:
@echo "Cloning Foundation from GitHub"
-rm -Rf .foundation-tmp
git clone git://github.com/Respect/Foundation.git .foundation-tmp
@echo "Renaming .dist files and removing repo metadata"
rm .foundation-tmp/README.md
rm .foundation-tmp/LICENSE
mv .foundation-tmp/README.md.dist .foundation-tmp/README.md
mv .foundation-tmp/LICENSE.dist .foundation-tmp/LICENSE
mv .foundation-tmp/package.xml.dist .foundation-tmp/package.xml
mv .foundation-tmp/composer.json.dist .foundation-tmp/composer.json
-mkdir bin
-mkdir tests
-mkdir library
-cp -f .foundation-tmp/bin/common-inc.php bin
-cp -f .foundation-tmp/bin/composer-package.php bin
-cp -f .foundation-tmp/bin/pear-package.php bin
-cp -f .foundation-tmp/bin/phar-package.php bin
-cp -f .foundation-tmp/bin/replace-vars.php bin
-cp -f .foundation-tmp/tests/bootstrap.php tests
-cp -f .foundation-tmp/tests/phpunit.xml tests
-cp -f .foundation-tmp/.travis.yml .
-cp -n .foundation-tmp/LICENSE .
-cp -n .foundation-tmp/README.md .
-cp -n .foundation-tmp/package.xml .
-cp -n .foundation-tmp/composer.json .
echo "Removing temp files"
rm -Rf .foundation-tmp
@php bin/replace-vars.php
@echo "Done!"