forked from onOffice-Web-Org/oo-wp-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 1.51 KB
/
Makefile
File metadata and controls
41 lines (29 loc) · 1.51 KB
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
ifeq ($(PREFIX),)
PREFIX := /tmp
endif
ifeq ($(OO_PLUGIN_VERSION),)
OO_PLUGIN_VERSION := $(shell git describe --tags --always)
endif
.PHONY: clean-zip clean-target clean release
copy-files-release:
install -d $(PREFIX)/onoffice
find * -type f \( ! -path "bin/*" ! -path "build/*" ! -path "./.*" ! -path "nbproject/*" ! -path "tests/*" ! -iname ".*" ! -iname "Readme.md" ! -iname "phpstan.neon" ! -iname "phpunit.xml*" ! -iname "Makefile" ! -iname "phpcs.xml*" \) -exec install -v -D -T ./{} $(PREFIX)/onoffice/{} \;
change-title: copy-files-release
sed -i -r "s/(Plugin Name: .+) \(dev\)$$/\1/" $(PREFIX)/onoffice/plugin.php
add-version: copy-files-release
sed -i -r "s/Version:\ [^$$]+/Version:\ $(patsubst v%,%,$(OO_PLUGIN_VERSION))/" $(PREFIX)/onoffice/plugin.php
composer-install-nodev:
cd $(PREFIX)/onoffice; composer install --no-dev -a
pot:
vendor/bin/wp i18n make-pot . languages/onoffice-for-wp-websites.pot --skip-js
vendor/bin/wp i18n make-pot . languages/onoffice.pot --domain=onoffice --skip-js
sed -i -r "s/onOffice for WP-Websites \(dev\)/onOffice for WP-Websites/" languages/onoffice-for-wp-websites.pot
sed -i -r "s/onOffice for WP-Websites \(dev\)/onOffice for WP-Websites/" languages/onoffice.pot
release: pot copy-files-release change-title add-version composer-install-nodev
test-zip: pot copy-files-release add-version composer-install-nodev
cd $(PREFIX); zip -r onoffice.zip onoffice/
clean-zip:
rm -f $(PREFIX)/onoffice.zip
clean-target:
rm -rf $(PREFIX)/onoffice/
clean: clean-zip clean-target