2013-04-26 21:01:39 +02:00
|
|
|
# You can set these variables from the command line.
|
2014-03-17 21:37:40 +01:00
|
|
|
BOWER ?= node_modules/.bin/bower
|
2014-04-18 17:47:47 +02:00
|
|
|
BUILDDIR = ./docs
|
|
|
|
PAPER =
|
2014-08-20 21:03:05 +02:00
|
|
|
PHANTOMJS ?= node_modules/.bin/phantomjs
|
2014-12-06 18:57:15 +01:00
|
|
|
SPHINXBUILD = ./bin/sphinx-build
|
2014-04-18 17:47:47 +02:00
|
|
|
SPHINXOPTS =
|
2014-12-02 19:32:14 +01:00
|
|
|
POTOJSON ?= node_modules/.bin/po2json
|
2014-03-17 21:37:40 +01:00
|
|
|
|
2013-04-26 21:01:39 +02:00
|
|
|
# Internal variables.
|
|
|
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source
|
|
|
|
# the i18n builder cannot share the environment and doctrees with the others
|
|
|
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source
|
|
|
|
|
2014-08-04 22:37:35 +02:00
|
|
|
.PHONY: all help clean html epub changes linkcheck gettext po pot po2json merge release css minjs build
|
2014-03-14 19:27:44 +01:00
|
|
|
|
|
|
|
all: dev
|
2013-04-26 21:01:39 +02:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
2014-03-14 19:27:44 +01:00
|
|
|
@echo " dev to set up the development environment"
|
2014-09-22 16:05:40 +02:00
|
|
|
@echo " build create minified builds containing converse.js and all its dependencies"
|
2013-06-01 13:17:52 +02:00
|
|
|
@echo " gettext to make PO message catalogs of the documentation"
|
|
|
|
@echo " html to make standalone HTML files of the documentation"
|
2014-03-14 19:27:44 +01:00
|
|
|
@echo " pot to generate a gettext POT file to be used for translations"
|
|
|
|
@echo " po to generate gettext PO files for each i18n language"
|
|
|
|
@echo " po2json to generate JSON files from the language PO files"
|
2013-06-01 13:17:52 +02:00
|
|
|
@echo " release to make a new minified release"
|
2014-03-17 21:37:40 +01:00
|
|
|
@echo " linkcheck to check all documentation external links for integrity"
|
|
|
|
@echo " epub to export the documentation to epub"
|
|
|
|
@echo " changes to make an overview of all changed/added/deprecated items added to the documentation"
|
2013-06-01 13:17:52 +02:00
|
|
|
|
2014-04-18 17:47:47 +02:00
|
|
|
########################################################################
|
|
|
|
## Translation machinery
|
|
|
|
|
|
|
|
pot:
|
2013-11-17 15:55:38 +01:00
|
|
|
xgettext --keyword=__ --keyword=___ --from-code=UTF-8 --output=locale/converse.pot converse.js --package-name=Converse.js --copyright-holder="Jan-Carel Brand" --package-version=0.7.0 -c --language="python";
|
2013-04-26 21:01:39 +02:00
|
|
|
|
2014-03-14 19:27:44 +01:00
|
|
|
po:
|
2013-09-12 11:14:45 +02:00
|
|
|
find ./locale -maxdepth 1 -mindepth 1 -type d -exec msgmerge {}/LC_MESSAGES/converse.po ./locale/converse.pot -U \;
|
|
|
|
|
2014-03-14 19:27:44 +01:00
|
|
|
merge: po
|
|
|
|
|
2013-09-15 22:16:16 +02:00
|
|
|
po2json:
|
2014-12-02 19:32:14 +01:00
|
|
|
find ./locale -maxdepth 1 -mindepth 1 -type d -exec $(POTOJSON) -p -f jed -d converse {}/LC_MESSAGES/converse.po {}/LC_MESSAGES/converse.json \;
|
2013-09-15 22:16:16 +02:00
|
|
|
|
2014-04-18 17:47:47 +02:00
|
|
|
########################################################################
|
|
|
|
## Release management
|
|
|
|
|
2014-08-04 23:09:14 +02:00
|
|
|
jsmin:
|
2014-07-06 16:10:27 +02:00
|
|
|
./node_modules/requirejs/bin/r.js -o src/build.js && ./node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js && ./node_modules/requirejs/bin/r.js -o src/build-no-otr.js && ./node_modules/requirejs/bin/r.js -o src/build-website.js
|
2014-06-29 20:49:22 +02:00
|
|
|
|
2014-07-06 17:32:06 +02:00
|
|
|
cssmin:
|
2014-06-29 20:49:22 +02:00
|
|
|
grunt cssmin
|
|
|
|
|
2013-10-08 09:11:04 +02:00
|
|
|
release:
|
2013-09-15 17:03:52 +02:00
|
|
|
sed -i s/\"version\":\ \"[0-9]\.[0-9]\.[0-9]\"/\"version\":\ \"$(VERSION)\"/ bower.json
|
|
|
|
sed -i s/\"version\":\ \"[0-9]\.[0-9]\.[0-9]\"/\"version\":\ \"$(VERSION)\"/ package.json
|
|
|
|
sed -i s/v[0-9]\.[0-9]\.[0-9]\.zip/v$(VERSION)\.zip/ index.html
|
|
|
|
sed -i s/v[0-9]\.[0-9]\.[0-9]\.tar\.gz/v$(VERSION)\.tar\.gz/ index.html
|
|
|
|
sed -i s/version\ =\ \'[0-9]\.[0-9]\.[0-9]\'/version\ =\ \'$(VERSION)\'/ docs/source/conf.py
|
|
|
|
sed -i s/release\ =\ \'[0-9]\.[0-9]\.[0-9]\'/release\ =\ \'$(VERSION)\'/ docs/source/conf.py
|
2013-11-17 16:15:07 +01:00
|
|
|
sed -i "s/(Unreleased)/(`date +%Y-%m-%d`)/" docs/CHANGES.rst
|
2014-08-25 14:39:32 +02:00
|
|
|
make pot
|
|
|
|
make po
|
2014-08-04 23:09:14 +02:00
|
|
|
make build
|
2013-05-09 23:16:23 +02:00
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Install dependencies
|
|
|
|
|
|
|
|
stamp-npm: package.json
|
2014-03-14 19:27:44 +01:00
|
|
|
npm install
|
2014-04-18 17:39:45 +02:00
|
|
|
touch stamp-npm
|
2014-03-14 19:27:44 +01:00
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
stamp-bower: stamp-npm bower.json
|
|
|
|
$(BOWER) install
|
|
|
|
touch stamp-bower
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f stamp-npm stamp-bower
|
|
|
|
rm -rf node_modules components
|
2013-04-26 21:01:39 +02:00
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
dev: clean
|
|
|
|
npm install
|
|
|
|
${BOWER} update;
|
|
|
|
|
2014-05-07 22:36:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Builds
|
|
|
|
|
|
|
|
css::
|
|
|
|
./node_modules/.bin/lessc less/styles.less > css/theme.css
|
|
|
|
./node_modules/.bin/lessc less/converse.less > css/converse.css
|
2014-04-18 17:39:45 +02:00
|
|
|
|
2014-08-04 22:37:35 +02:00
|
|
|
build::
|
2014-09-22 16:05:40 +02:00
|
|
|
./node_modules/.bin/grunt jst
|
2014-08-04 22:37:35 +02:00
|
|
|
./node_modules/.bin/grunt minify
|
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
check:: stamp-npm
|
|
|
|
$(PHANTOMJS) node_modules/phantom-jasmine/lib/run_jasmine_test.coffee tests.html
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Documentation
|
|
|
|
|
2013-04-26 21:01:39 +02:00
|
|
|
html:
|
2014-12-07 10:48:32 +01:00
|
|
|
rm -rf $(BUILDDIR)/html
|
2013-04-26 21:01:39 +02:00
|
|
|
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
|
|
|
|
|
|
epub:
|
|
|
|
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
|
|
|
@echo
|
|
|
|
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
|
|
|
|
|
|
gettext:
|
|
|
|
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
|
|
|
@echo
|
|
|
|
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
|
|
|
|
|
|
|
changes:
|
|
|
|
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
|
|
|
@echo
|
|
|
|
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
|
|
|
|
|
|
linkcheck:
|
|
|
|
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
|
|
|
@echo
|
|
|
|
@echo "Link check complete; look for any errors in the above output " \
|
|
|
|
"or in $(BUILDDIR)/linkcheck/output.txt."
|