-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
69 lines (55 loc) · 1.65 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
VERSION := 1.3.7
PLUGINSLUG := spiderblocker
SRCPATH := $(shell pwd)/src
bin/linux/amd64/github-release:
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
tar -xvf linux-amd64-github-release.tar.bz2
chmod +x bin/linux/amd64/github-release
rm linux-amd64-github-release.tar.bz2
ensure: vendor
vendor:
composer install --dev
composer dump-autoload -a
clover.xml: vendor test
unit: test
test: vendor
bin/phpunit --coverage-html=./reports
dist: ensure
sed -i "s/@##VERSION##@/${VERSION}/" src/index.php
sed -i "s/@##VERSION##@/${VERSION}/" src/i18n/$(PLUGINSLUG).pot
mkdir -p dist
cp -r $(SRCPATH)/. dist/
sed -i "s/${VERSION}/@##VERSION##@/" src/index.php
sed -i "s/${VERSION}/@##VERSION##@/" src/i18n/$(PLUGINSLUG).pot
build: ensure
sed -i "s/@##VERSION##@/${VERSION}/" src/index.php
sed -i "s/@##VERSION##@/${VERSION}/" src/i18n/$(PLUGINSLUG).pot
mkdir -p build
cp -ar $(SRCPATH) $(PLUGINSLUG)
zip -r $(PLUGINSLUG).zip $(PLUGINSLUG)
rm -rf $(PLUGINSLUG)
mv $(PLUGINSLUG).zip build/
sed -i "s/${VERSION}/@##VERSION##@/" src/index.php
sed -i "s/${VERSION}/@##VERSION##@/" src/i18n/$(PLUGINSLUG).pot
release:
git stash
git fetch -p
git checkout master
git pull -r
git tag v$(VERSION)
git push origin v$(VERSION)
git pull -r
fmt: ensure
bin/phpcbf --standard=WordPress src
bin/phpcbf --standard=WordPress tests --ignore=vendor
lint: ensure
bin/phpcs --standard=WordPress src
bin/phpcs --standard=WordPress tests --ignore=vendor
psr:
composer dump-autoload -o
i18n:
wp i18n make-pot src src/i18n/$(PLUGINSLUG).pot
cover: vendor
bin/coverage-check clover.xml 90
clean:
rm -rf vendor/ bin