Commit 75064b26 authored by Adrien Dorsaz's avatar Adrien Dorsaz

cleaning build tools: use simpler Makefile instead of home made build.sh script

parent 695b06ec
version = $(shell cat VERSION)
excludefromxpi = \*.git \*.xpi \*.sh update\*.txt Makefile VERSION
# 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
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) -- .
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 \
{} \;
4.0.0-beta5
#!/bin/sh
usage() {
printf "Usage: %s [ -u | -d ]\n" "$0" 1>&2
printf " -u enable update\n" 1>&2
printf " -d disable update\n" 1>&2
exit 1
}
if [ $# = 0 ];then
usage
fi
version=$(sed -n -e "s/.*<em:version>\(.*\)<\/em:version>/\1/p" install.rdf)
while getopts ":ud" OPTION
do
case ${OPTION} in
u) echo "update"
cat defaults/preferences/update_enable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v"$version".xpi ./* -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
d) echo "no update"
cat defaults/preferences/update_disable.txt > defaults/preferences/update.js
zip -r exchangecalendar-v"$version".xpi ./* -x \*.git \*.xpi \*.sh update\*.txt
exit
;;
*) usage ;;
esac
done
usage
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment