aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 12 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index a3696ec9..d659d908 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,6 @@
1# The personal, minimalist, super-fast, database free, bookmarking service. 1# The personal, minimalist, super-fast, database free, bookmarking service.
2# Makefile for PHP code analysis & testing, documentation and release generation 2# Makefile for PHP code analysis & testing, documentation and release generation
3 3
4# Prerequisites:
5# - install Composer, either:
6# - from your distro's package manager;
7# - from the official website (https://getcomposer.org/download/);
8# - install/update test dependencies:
9# $ composer install # 1st setup
10# $ composer update
11# - install Xdebug for PHPUnit code coverage reports:
12# - see http://xdebug.org/docs/install
13# - enable in php.ini
14
15BIN = vendor/bin 4BIN = vendor/bin
16PHP_SOURCE = index.php application tests plugins 5PHP_SOURCE = index.php application tests plugins
17PHP_COMMA_SOURCE = index.php,application,tests,plugins 6PHP_COMMA_SOURCE = index.php,application,tests,plugins
@@ -115,7 +104,7 @@ check_permissions:
115 @echo "----------------------" 104 @echo "----------------------"
116 @echo "Check file permissions" 105 @echo "Check file permissions"
117 @echo "----------------------" 106 @echo "----------------------"
118 @for file in `git ls-files`; do \ 107 @for file in `git ls-files | grep -v docker`; do \
119 if [ -x $$file ]; then \ 108 if [ -x $$file ]; then \
120 errors=true; \ 109 errors=true; \
121 echo "$${file} is executable"; \ 110 echo "$${file} is executable"; \
@@ -130,12 +119,12 @@ check_permissions:
130# See phpunit.xml for configuration 119# See phpunit.xml for configuration
131# https://phpunit.de/manual/current/en/appendixes.configuration.html 120# https://phpunit.de/manual/current/en/appendixes.configuration.html
132## 121##
133test: 122test: translate
134 @echo "-------" 123 @echo "-------"
135 @echo "PHPUNIT" 124 @echo "PHPUNIT"
136 @echo "-------" 125 @echo "-------"
137 @mkdir -p sandbox coverage 126 @mkdir -p sandbox coverage
138 @$(BIN)/phpunit --coverage-php coverage/main.cov --testsuite unit-tests 127 @$(BIN)/phpunit --coverage-php coverage/main.cov --bootstrap tests/bootstrap.php --testsuite unit-tests
139 128
140locale_test_%: 129locale_test_%:
141 @UT_LOCALE=$*.utf8 \ 130 @UT_LOCALE=$*.utf8 \
@@ -168,15 +157,15 @@ composer_dependencies: clean
168 composer install --no-dev --prefer-dist 157 composer install --no-dev --prefer-dist
169 find vendor/ -name ".git" -type d -exec rm -rf {} + 158 find vendor/ -name ".git" -type d -exec rm -rf {} +
170 159
171### generate a release tarball and include 3rd-party dependencies 160### generate a release tarball and include 3rd-party dependencies and translations
172release_tar: composer_dependencies htmldoc 161release_tar: composer_dependencies htmldoc translate
173 git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD 162 git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD
174 tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ 163 tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/
175 tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/ 164 tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/
176 gzip $(ARCHIVE_VERSION).tar 165 gzip $(ARCHIVE_VERSION).tar
177 166
178### generate a release zip and include 3rd-party dependencies 167### generate a release zip and include 3rd-party dependencies and translations
179release_zip: composer_dependencies htmldoc 168release_zip: composer_dependencies htmldoc translate
180 git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD 169 git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD
181 mkdir -p $(ARCHIVE_PREFIX)/{doc,vendor} 170 mkdir -p $(ARCHIVE_PREFIX)/{doc,vendor}
182 rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/ 171 rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/
@@ -213,3 +202,8 @@ htmldoc:
213 mkdocs build' 202 mkdocs build'
214 find doc/html/ -type f -exec chmod a-x '{}' \; 203 find doc/html/ -type f -exec chmod a-x '{}' \;
215 rm -r venv 204 rm -r venv
205
206
207### Generate Shaarli's translation compiled file (.mo)
208translate:
209 @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; \ No newline at end of file