|
| 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 | + {} \; |
0 commit comments