This repository was archived by the owner on Jul 2, 2024. It is now read-only.
forked from Ericsson/exchangecalendar
-
Notifications
You must be signed in to change notification settings - Fork 57
Clean build and translation tools #98
Merged
advancingu
merged 5 commits into
ExchangeCalendar:ec-4.0
from
Trim:clean-build-translation-tools
Oct 22, 2017
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
695b06e
remove home made translation updater
Trim 75064b2
cleaning build tools: use simpler Makefile instead of home made build…
Trim 06243bd
Makefile: correctly exclude .git and .tx directories in the build.
Trim fb5dba7
Makefile: reorganize to set the build target as the default one
Trim 47640df
Makefile: add localisation and release targets
Trim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version = $(shell cat VERSION) | ||
excludefromxpi = .git/\* .tx/\* \*.xpi \*.sh update\*.txt Makefile VERSION | ||
releasebranch = ec-4.0 | ||
|
||
# Default target is build package | ||
build: | ||
# Update version number inside install.rdf file from VERSION file | ||
sed -i 's/\(\s*\)<em:version>[^<]*\?<\/em:version>/\1<em:version>$(version)<\/em:version>/' install.rdf | ||
# Disable automatic updates of the extension | ||
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js | ||
# Finally, create the xpi file | ||
zip -r exchangecalendar-v"$(version)".xpi -x $(excludefromxpi) -- . | ||
|
||
# Target to publish a new release: | ||
release: l10n-auto-commit build | ||
git add -- install.rdf | ||
git commit -m "releases v$(version)" | ||
git tag "v$(version)" | ||
@echo 'Translations updated, build done, tag added.' | ||
@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.' | ||
|
||
# Targets to update translations | ||
# Requires an already configured Transifex client: https://docs.transifex.com/client/introduction | ||
# This project has a .tx/ directory which references currently known localisation files | ||
|
||
# Get translations updates from Transifex | ||
l10n-get: | ||
git checkout $(releasebranch) | ||
tx pull -a | ||
|
||
l10n-auto-commit: l10n-get | ||
git add -- locale interfaces/exchangeAddressBook/locale/ | ||
-git commit -m 'l10n: automatic translations updates' | ||
|
||
# Send new texts to translate to Transifex | ||
l10n-push: | ||
git checkout $(releasebranch) | ||
tx push | ||
|
||
# Target to beautify and build your code while developing it | ||
dev: beautify build | ||
|
||
# Beautifier are configured to use indentation with 4 spaces | ||
beautify: beautify-xml beautify-js | ||
|
||
beautify-xml: | ||
find \( -name "*.xml" -o -name "*.rdf" -o -name "*.xul" \) -exec \ | ||
tidy --input-xml yes --indent auto --indent-spaces 4 --indent-attributes yes \ | ||
--preserve-entities yes --quote-ampersand no --quote-nbsp no --output-xml yes \ | ||
--strict-tags-attributes no --write-back yes \ | ||
{} \; | ||
beautify-js: | ||
find -name "*.js" -exec \ | ||
js-beautify --indent-size=4 --indent-char=' ' --jslint-happy \ | ||
--operator-position after-newline --brace-style end-expand --replace \ | ||
{} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.0.0-beta5 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dash prefix is the way for Makefiles to say "execute this line and if you get an error, continue anyway the rest of the script".
Here, it allows us to continue the script even if nothing needs to be committed (the return value of the git command is non-zero if there was nothing to commit).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got to love Makefile syntax :D