This repository has been archived by the owner on Sep 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
67 lines (59 loc) · 2.33 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
SHELL=/bin/bash
export LC_COLLATE=C
export PYTHONPATH=$(CURDIR)
all: send_later.xpi
send_later.xpi: utils/check-locales.pl utils/propagate_strings.py \
utils/check-accesskeys.py utils/check-locale-integration.py \
utils/check-manifests.sh Makefile include-manifest exclude-manifest2 \
$(shell ls $(shell cat include-manifest) 2>/dev/null)
-rm -rf build
./utils/check-manifests.sh --excludes exclude-manifest2 --overlap \
--extra
./utils/fix-addon-ids.pl --check
./utils/make-manifest-locales.pl
./utils/check-locale-integration.py
mkdir build
# Some locale files are generated dynamically below, and therefore
# tar won't be able to find them here.
tar c --files-from include-manifest \
2> >(egrep -v '^tar: chrome/.*: No such file or directory|due to previous errors' \
>/tmp/[email protected]) | tar -C build -x
@if [ -s /tmp/[email protected] ]; then \
cat /tmp/[email protected]; \
exit 1; \
fi
@rm -f /tmp/[email protected]
cd build; ../utils/check-locales.pl --replace
cd build; ../utils/propagate_strings.py
cd build; ../utils/check-accesskeys.py
cd build; ../utils/check-manifests.sh --includes ../include-manifest \
--excludes ../exclude-manifest2 --missing --extra
cd build; zip -q -r [email protected] -@ < ../include-manifest
mv build/[email protected] $@
clean:: ; -rm -rf *.xpi *.tmp */*.pyc _locales build
clean:: ; -rm -f exclude-manifest2
exclude-manifest2: exclude-manifest
cat $< > [email protected]
echo $@ >> [email protected]
find contrib -type f >> [email protected]
mv -f [email protected] $@
locale_import: crowdin.yaml
crowdin-cli download translations
sed -i -e '/^$$/d' $$(ls chrome/locale/*/* | grep -v /en-US/)
sed -i -e 's/\(<!ENTITY [^ ]* \) */\1/' \
$$(ls chrome/locale/*/*.dtd | grep -v /en-US/)
sed -i -e '/^#X-Generator: crowdin.com/d' -e 's/\\\([#:!=]\)/\1/g' \
$$(ls chrome/locale/*/*.properties | grep -v /en-US/)
wc -l chrome/locale/*/* | awk '$$1 == 1 {print $$2}' | \
xargs grep -l utf-8 | xargs --no-run-if-empty rm
-rmdir -p chrome/locale/* 2>/dev/null
locale_export: crowdin.yaml
crowdin-cli upload sources
# Be very careful about this because it could mess with translation
# work in progress.
upload_translations:
crowdin-cli upload translations --import-eq-suggestions
crowdin.yaml: crowdin.yaml.template
set -e; echo -n "Enter Crowdin API key: "; read api_key; \
sed -e "s/{{api_key}}/$$api_key/" $< > [email protected]
mv -f [email protected] $@