diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 22 insertions, 7 deletions
@@ -19,6 +19,16 @@ PHP_COMMA_SOURCE = index.php,application,tests,plugins | |||
19 | all: static_analysis_summary check_permissions test | 19 | all: static_analysis_summary check_permissions test |
20 | 20 | ||
21 | ## | 21 | ## |
22 | # Docker test adapter | ||
23 | # | ||
24 | # Shaarli sources and vendored libraries are copied from a shared volume | ||
25 | # to a user-owned directory to enable running tests as a non-root user. | ||
26 | ## | ||
27 | docker_%: | ||
28 | rsync -az /shaarli/ ~/shaarli/ | ||
29 | cd ~/shaarli && make $* | ||
30 | |||
31 | ## | ||
22 | # Concise status of the project | 32 | # Concise status of the project |
23 | # These targets are non-blocking: || exit 0 | 33 | # These targets are non-blocking: || exit 0 |
24 | ## | 34 | ## |
@@ -105,7 +115,7 @@ check_permissions: | |||
105 | @echo "----------------------" | 115 | @echo "----------------------" |
106 | @echo "Check file permissions" | 116 | @echo "Check file permissions" |
107 | @echo "----------------------" | 117 | @echo "----------------------" |
108 | @for file in `git ls-files`; do \ | 118 | @for file in `git ls-files | grep -v docker`; do \ |
109 | if [ -x $$file ]; then \ | 119 | if [ -x $$file ]; then \ |
110 | errors=true; \ | 120 | errors=true; \ |
111 | echo "$${file} is executable"; \ | 121 | echo "$${file} is executable"; \ |
@@ -120,12 +130,12 @@ check_permissions: | |||
120 | # See phpunit.xml for configuration | 130 | # See phpunit.xml for configuration |
121 | # https://phpunit.de/manual/current/en/appendixes.configuration.html | 131 | # https://phpunit.de/manual/current/en/appendixes.configuration.html |
122 | ## | 132 | ## |
123 | test: | 133 | test: translate |
124 | @echo "-------" | 134 | @echo "-------" |
125 | @echo "PHPUNIT" | 135 | @echo "PHPUNIT" |
126 | @echo "-------" | 136 | @echo "-------" |
127 | @mkdir -p sandbox coverage | 137 | @mkdir -p sandbox coverage |
128 | @$(BIN)/phpunit --coverage-php coverage/main.cov --testsuite unit-tests | 138 | @$(BIN)/phpunit --coverage-php coverage/main.cov --bootstrap tests/bootstrap.php --testsuite unit-tests |
129 | 139 | ||
130 | locale_test_%: | 140 | locale_test_%: |
131 | @UT_LOCALE=$*.utf8 \ | 141 | @UT_LOCALE=$*.utf8 \ |
@@ -158,15 +168,15 @@ composer_dependencies: clean | |||
158 | composer install --no-dev --prefer-dist | 168 | composer install --no-dev --prefer-dist |
159 | find vendor/ -name ".git" -type d -exec rm -rf {} + | 169 | find vendor/ -name ".git" -type d -exec rm -rf {} + |
160 | 170 | ||
161 | ### generate a release tarball and include 3rd-party dependencies | 171 | ### generate a release tarball and include 3rd-party dependencies and translations |
162 | release_tar: composer_dependencies htmldoc | 172 | release_tar: composer_dependencies htmldoc translate |
163 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD | 173 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD |
164 | tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ | 174 | tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ |
165 | tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/ | 175 | tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/ |
166 | gzip $(ARCHIVE_VERSION).tar | 176 | gzip $(ARCHIVE_VERSION).tar |
167 | 177 | ||
168 | ### generate a release zip and include 3rd-party dependencies | 178 | ### generate a release zip and include 3rd-party dependencies and translations |
169 | release_zip: composer_dependencies htmldoc | 179 | release_zip: composer_dependencies htmldoc translate |
170 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD | 180 | git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD |
171 | mkdir -p $(ARCHIVE_PREFIX)/{doc,vendor} | 181 | mkdir -p $(ARCHIVE_PREFIX)/{doc,vendor} |
172 | rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/ | 182 | rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/ |
@@ -203,3 +213,8 @@ htmldoc: | |||
203 | mkdocs build' | 213 | mkdocs build' |
204 | find doc/html/ -type f -exec chmod a-x '{}' \; | 214 | find doc/html/ -type f -exec chmod a-x '{}' \; |
205 | rm -r venv | 215 | rm -r venv |
216 | |||
217 | |||
218 | ### Generate Shaarli's translation compiled file (.mo) | ||
219 | translate: | ||
220 | @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; \ No newline at end of file | ||