Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit ebe7126

Browse files
authored
Merge pull request #98 from Trim/clean-build-translation-tools
Clean build and translation tools
2 parents dbd5288 + 47640df commit ebe7126

File tree

4 files changed

+57
-242
lines changed

4 files changed

+57
-242
lines changed

Makefile

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version = $(shell cat VERSION)
2+
excludefromxpi = .git/\* .tx/\* \*.xpi \*.sh update\*.txt Makefile VERSION
3+
releasebranch = ec-4.0
4+
5+
# Default target is build package
6+
build:
7+
# Update version number inside install.rdf file from VERSION file
8+
sed -i 's/\(\s*\)<em:version>[^<]*\?<\/em:version>/\1<em:version>$(version)<\/em:version>/' install.rdf
9+
# Disable automatic updates of the extension
10+
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js
11+
# Finally, create the xpi file
12+
zip -r exchangecalendar-v"$(version)".xpi -x $(excludefromxpi) -- .
13+
14+
# Target to publish a new release:
15+
release: l10n-auto-commit build
16+
git add -- install.rdf
17+
git commit -m "releases v$(version)"
18+
git tag "v$(version)"
19+
@echo 'Translations updated, build done, tag added.'
20+
@echo 'Now, if the release is well done, please run one "git push" to publish code and one "git push v$(version)" to publish the new tag.'
21+
22+
# Targets to update translations
23+
# Requires an already configured Transifex client: https://docs.transifex.com/client/introduction
24+
# This project has a .tx/ directory which references currently known localisation files
25+
26+
# Get translations updates from Transifex
27+
l10n-get:
28+
git checkout $(releasebranch)
29+
tx pull -a
30+
31+
l10n-auto-commit: l10n-get
32+
git add -- locale interfaces/exchangeAddressBook/locale/
33+
-git commit -m 'l10n: automatic translations updates'
34+
35+
# Send new texts to translate to Transifex
36+
l10n-push:
37+
git checkout $(releasebranch)
38+
tx push
39+
40+
# Target to beautify and build your code while developing it
41+
dev: beautify build
42+
43+
# Beautifier are configured to use indentation with 4 spaces
44+
beautify: beautify-xml beautify-js
45+
46+
beautify-xml:
47+
find \( -name "*.xml" -o -name "*.rdf" -o -name "*.xul" \) -exec \
48+
tidy --input-xml yes --indent auto --indent-spaces 4 --indent-attributes yes \
49+
--preserve-entities yes --quote-ampersand no --quote-nbsp no --output-xml yes \
50+
--strict-tags-attributes no --write-back yes \
51+
{} \;
52+
beautify-js:
53+
find -name "*.js" -exec \
54+
js-beautify --indent-size=4 --indent-char=' ' --jslint-happy \
55+
--operator-position after-newline --brace-style end-expand --replace \
56+
{} \;

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.0-beta5

build.sh

-32
This file was deleted.

translationupdater.sh

-210
This file was deleted.

0 commit comments

Comments
 (0)