-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
92 lines (74 loc) · 2.34 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
SHELL := /bin/bash
#
# Define NPM and check if it is available on the system.
#
NPM := $(shell command -v npm 2> /dev/null)
ifndef NPM
$(error npm is not available on your system, please install npm)
endif
app_name=$(notdir $(CURDIR))
project_directory=$(CURDIR)/../$(app_name)
build_tools_directory=$(CURDIR)/build/tools
appstore_package_name=$(CURDIR)/build/dist/$(app_name)
occ=$(CURDIR)/../../occ
private_key=$(HOME)/.owncloud/certificates/$(app_name).key
certificate=$(HOME)/.owncloud/certificates/$(app_name).crt
sign=php -f $(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)"
sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)"
ifneq (,$(wildcard $(private_key)))
ifneq (,$(wildcard $(certificate)))
ifneq (,$(wildcard $(occ)))
CAN_SIGN=true
endif
endif
endif
PHPUNIT="$(PWD)/lib/composer/phpunit/phpunit/phpunit"
drawio_doc_files=COPYING.txt screenshot.png
drawio_src_dirs=appinfo img css js l10n lib templates
drawio_all_src=$(drawio_src_dirs) $(drawio_doc_files)
build_dir=build
dist_dir=$(build_dir)/dist
.PHONY: clean
clean: clean-dist clean-build
#
# dist
#
$(dist_dir)/drawio:
rm -Rf $@; mkdir -p $@
cp -R $(drawio_all_src) $@
.PHONY: dist
dist: clean $(dist_dir)/drawio
ifdef CAN_SIGN
$(sign) --path="$(appstore_package_name)"
else
@echo $(sign_skip_msg)
endif
COPYFILE_DISABLE=1 tar --exclude='._*' -czf $(appstore_package_name).tar.gz -C $(appstore_package_name)/../ $(app_name)
.PHONY: clean-dist
clean-dist:
rm -Rf $(dist_dir)
.PHONY: clean-build
clean-build:
rm -Rf $(build_dir)
#
# Translation
#--------------------------------------
.PHONY: l10n-push
l10n-push:
cd l10n && tx push -s --skip
.PHONY: l10n-pull
l10n-pull:
cd l10n && tx pull -a --skip --minimum-perc=75
.PHONY: l10n-clean
l10n-clean:
rm -rf l10n/l10n.pl
find l10n -type f -name \*.po -or -name \*.pot | xargs rm -f
find l10n -type f -name uz.\* -or -name yo.\* -or -name ne.\* -or -name or_IN.\* | xargs git rm -f || true
.PHONY: l10n-read
l10n-read: l10n/l10n.pl
cd l10n && perl l10n.pl $(app_name) read
.PHONY: l10n-write
l10n-write: l10n/l10n.pl
cd l10n && perl l10n.pl $(app_name) write
l10n/l10n.pl:
wget -qO l10n/l10n.pl https://raw.githubusercontent.com/owncloud-ci/transifex/d1c63674d791fe8812216b29da9d8f2f26e7e138/rootfs/usr/bin/l10n