2013-04-26 21:01:39 +02:00
|
|
|
# You can set these variables from the command line.
|
2017-06-21 22:26:00 +02:00
|
|
|
BABEL ?= node_modules/.bin/babel
|
2018-10-07 16:44:43 +02:00
|
|
|
BOOTSTRAP = ./node_modules/
|
|
|
|
BOURBON = ./node_modules/bourbon/app/assets/stylesheets/
|
2017-06-13 12:22:02 +02:00
|
|
|
BUILDDIR = ./docs
|
2017-06-21 22:26:00 +02:00
|
|
|
CHROMIUM ?= ./node_modules/.bin/run-headless-chromium
|
|
|
|
CLEANCSS ?= ./node_modules/clean-css-cli/bin/cleancss --skip-rebase
|
|
|
|
ESLINT ?= ./node_modules/.bin/eslint
|
2017-06-13 12:22:02 +02:00
|
|
|
HTTPSERVE ?= ./node_modules/.bin/http-server
|
2018-09-04 11:39:27 +02:00
|
|
|
HTTPSERVE_PORT ?= 8000
|
2018-06-14 10:22:16 +02:00
|
|
|
INKSCAPE ?= inkscape
|
2018-05-11 13:31:48 +02:00
|
|
|
JSDOC ?= ./node_modules/.bin/jsdoc
|
2018-10-07 16:44:43 +02:00
|
|
|
LERNA ?= ./node_modules/.bin/lerna
|
2018-06-14 10:22:16 +02:00
|
|
|
OXIPNG ?= oxipng
|
2017-06-13 12:22:02 +02:00
|
|
|
PAPER =
|
|
|
|
PO2JSON ?= ./node_modules/.bin/po2json
|
2018-09-04 11:39:27 +02:00
|
|
|
RJS ?= ./node_modules/.bin/r.js
|
2018-10-29 21:42:26 +01:00
|
|
|
NPX ?= ./node_modules/.bin/npx
|
2018-10-28 17:23:10 +01:00
|
|
|
SASS ?= ./node_modules/.bin/node-sass
|
2018-09-04 11:39:27 +02:00
|
|
|
SED ?= sed
|
2018-05-11 13:31:48 +02:00
|
|
|
SPHINXBUILD ?= ./bin/sphinx-build
|
2017-06-13 12:22:02 +02:00
|
|
|
SPHINXOPTS =
|
2018-05-11 13:31:48 +02:00
|
|
|
UGLIFYJS ?= node_modules/.bin/uglifyjs
|
2014-03-17 21:37:40 +01:00
|
|
|
|
2017-12-05 18:35:01 +01:00
|
|
|
|
2013-04-26 21:01:39 +02:00
|
|
|
# Internal variables.
|
|
|
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source
|
|
|
|
|
2016-03-29 08:56:13 +02:00
|
|
|
.PHONY: all
|
2016-09-23 15:41:12 +02:00
|
|
|
all: dev dist
|
2016-03-29 08:56:13 +02:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: help
|
2013-04-26 21:01:39 +02:00
|
|
|
help:
|
2015-04-26 09:38:23 +02:00
|
|
|
@echo "Please use \`make <target>' where <target> is one of the following:"
|
|
|
|
@echo ""
|
2018-10-25 22:14:07 +02:00
|
|
|
@echo " all A synonym for 'make dev'."
|
|
|
|
@echo " build Create minified builds of converse.js and all its dependencies."
|
2018-10-28 17:23:10 +01:00
|
|
|
@echo " clean Remove all NPM packages."
|
2018-10-25 22:14:07 +02:00
|
|
|
@echo " check Run all tests."
|
|
|
|
@echo " css Generate CSS from the Sass files."
|
|
|
|
@echo " dev Set up the development environment. To force a fresh start, run 'make clean' first."
|
|
|
|
@echo " html Make standalone HTML files of the documentation."
|
|
|
|
@echo " po Generate gettext PO files for each i18n language."
|
|
|
|
@echo " po2json Generate JSON files from the language PO files."
|
|
|
|
@echo " pot Generate a gettext POT file to be used for translations."
|
|
|
|
@echo " release Prepare a new release of converse.js. E.g. make release VERSION=0.9.5"
|
|
|
|
@echo " serve Serve this directory via a webserver on port 8000."
|
|
|
|
@echo " serve_bg Same as \"serve\", but do it in the background"
|
|
|
|
@echo " stamp-npm Install NPM dependencies"
|
2018-10-25 22:53:47 +02:00
|
|
|
@echo " watch Watch for changes on JS and scss files and automatically update the generated files."
|
2018-10-25 22:14:07 +02:00
|
|
|
@echo " logo Generate PNG logos of multiple sizes."
|
2015-09-25 21:39:47 +02:00
|
|
|
|
2015-02-05 15:57:39 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Miscellaneous
|
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: serve
|
2018-10-07 16:44:43 +02:00
|
|
|
serve: dev
|
2017-12-05 18:46:22 +01:00
|
|
|
$(HTTPSERVE) -p $(HTTPSERVE_PORT) -c-1
|
2017-06-13 12:22:02 +02:00
|
|
|
|
|
|
|
.PHONY: serve_bg
|
|
|
|
serve_bg: dev
|
2017-12-05 18:46:22 +01:00
|
|
|
$(HTTPSERVE) -p $(HTTPSERVE_PORT) -c-1 -s &
|
2013-06-01 13:17:52 +02:00
|
|
|
|
2014-04-18 17:47:47 +02:00
|
|
|
########################################################################
|
|
|
|
## Translation machinery
|
|
|
|
|
2018-11-15 13:23:54 +01:00
|
|
|
GETTEXT = xgettext --language="JavaScript" --keyword=__ --keyword=___ --from-code=UTF-8 --output=locale/converse.pot dist/converse-no-dependencies.js --package-name=Converse.js --copyright-holder="Jan-Carel Brand" --package-version=4.0.5 -c
|
2016-02-08 09:58:57 +01:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: pot
|
2018-06-04 12:07:49 +02:00
|
|
|
pot: dist/converse-no-dependencies-es2015.js
|
2017-08-23 11:56:40 +02:00
|
|
|
$(GETTEXT) 2>&1 > /dev/null; exit $$?;
|
2013-04-26 21:01:39 +02:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: po
|
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 \;
|
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: po2json
|
2013-09-15 22:16:16 +02:00
|
|
|
po2json:
|
2018-01-05 12:47:50 +01:00
|
|
|
find ./locale -maxdepth 1 -mindepth 1 -type d -exec $(PO2JSON) -f jed1.x -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
|
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: release
|
2013-10-08 09:11:04 +02:00
|
|
|
release:
|
2018-11-15 13:23:54 +01:00
|
|
|
|
|
|
|
$(SED) -ri s/_converse.VERSION_NAME = "v[0-9]\+\.[0-9]\+\.[0-9]\+";/ _converse.VERSION_NAME = "$(VERSION)";/ src/headless/converse-core.js
|
2017-07-22 22:18:55 +02:00
|
|
|
$(SED) -ri s/Version:\ [0-9]\+\.[0-9]\+\.[0-9]\+/Version:\ $(VERSION)/ COPYRIGHT
|
2017-07-12 22:51:56 +02:00
|
|
|
$(SED) -ri s/Project-Id-Version:\ Converse\.js\ [0-9]\+\.[0-9]\+\.[0-9]\+/Project-Id-Version:\ Converse.js\ $(VERSION)/ locale/converse.pot
|
|
|
|
$(SED) -ri s/\"version\":\ \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\":\ \"$(VERSION)\"/ package.json
|
2018-10-28 17:30:33 +01:00
|
|
|
$(SED) -ri s/\"version\":\ \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/\"version\":\ \"$(VERSION)\"/ src/headless/package.json
|
2017-07-12 22:51:56 +02:00
|
|
|
$(SED) -ri s/--package-version=[0-9]\+\.[0-9]\+\.[0-9]\+/--package-version=$(VERSION)/ Makefile
|
|
|
|
$(SED) -ri s/v[0-9]\+\.[0-9]\+\.[0-9]\+\.zip/v$(VERSION)\.zip/ index.html
|
|
|
|
$(SED) -ri s/v[0-9]\+\.[0-9]\+\.[0-9]\+\.tar\.gz/v$(VERSION)\.tar\.gz/ index.html
|
|
|
|
$(SED) -ri s/version\ =\ \'[0-9]\+\.[0-9]\+\.[0-9]\+\'/version\ =\ \'$(VERSION)\'/ docs/source/conf.py
|
|
|
|
$(SED) -ri s/release\ =\ \'[0-9]\+\.[0-9]\+\.[0-9]\+\'/release\ =\ \'$(VERSION)\'/ docs/source/conf.py
|
|
|
|
$(SED) -ri "s/(Unreleased)/`date +%Y-%m-%d`/" CHANGES.md
|
2018-02-14 02:05:47 +01:00
|
|
|
$(SED) -ri "s/cdn.conversejs.org\/[0-9]+\.[0-9]+\.[0-9]+/cdn.conversejs.org\/$(VERSION)/" docs/source/quickstart.rst
|
2014-08-25 14:39:32 +02:00
|
|
|
make pot
|
|
|
|
make po
|
2014-12-20 11:19:03 +01:00
|
|
|
make po2json
|
2014-08-04 23:09:14 +02:00
|
|
|
make build
|
2013-05-09 23:16:23 +02:00
|
|
|
|
2018-10-29 22:28:28 +01:00
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Install dependencies
|
|
|
|
|
2018-10-07 16:44:43 +02:00
|
|
|
$(LERNA):
|
|
|
|
npm install lerna
|
|
|
|
|
2018-10-22 13:10:55 +02:00
|
|
|
stamp-npm: $(LERNA) package.json package-lock.json src/headless/package.json
|
2018-10-07 16:44:43 +02:00
|
|
|
$(LERNA) bootstrap --hoist
|
2018-03-17 19:54:01 +01:00
|
|
|
touch stamp-npm
|
2014-03-14 19:27:44 +01:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: clean
|
2016-02-27 16:57:30 +01:00
|
|
|
clean:
|
2018-10-28 17:23:10 +01:00
|
|
|
rm -rf node_modules stamp-npm
|
2018-03-06 11:26:47 +01:00
|
|
|
rm dist/*.min.js
|
2018-05-15 09:38:20 +02:00
|
|
|
rm css/website.min.css
|
2018-03-06 11:26:47 +01:00
|
|
|
rm css/converse.min.css
|
|
|
|
rm css/*.map
|
2013-04-26 21:01:39 +02:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: dev
|
2018-10-28 17:23:10 +01:00
|
|
|
dev: stamp-npm
|
2014-04-18 17:39:45 +02:00
|
|
|
|
2014-05-07 22:36:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Builds
|
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: css
|
2018-11-08 12:46:10 +01:00
|
|
|
css: dev sass/*.scss css/converse.css css/converse.min.css css/website.css css/website.min.css css/font-awesome.css
|
2017-06-13 21:07:42 +02:00
|
|
|
|
2018-03-28 13:45:21 +02:00
|
|
|
css/converse.css:: dev sass
|
2018-12-04 13:15:30 +01:00
|
|
|
$(SASS) --source-map true --include-path $(BOURBON) --include-path $(BOOTSTRAP) sass/converse.scss css/converse.css
|
2015-10-16 16:12:10 +02:00
|
|
|
|
2018-05-15 09:38:20 +02:00
|
|
|
css/website.css:: dev sass
|
2018-12-04 13:15:30 +01:00
|
|
|
$(SASS) --source-map true --include-path $(BOURBON) --include-path $(BOOTSTRAP) sass/website.scss $@
|
2018-05-15 09:38:20 +02:00
|
|
|
|
2018-11-08 12:46:10 +01:00
|
|
|
css/font-awesome.css:: dev sass
|
2018-12-04 13:15:30 +01:00
|
|
|
$(SASS) --source-map true --include-path $(BOURBON) --include-path $(BOOTSTRAP) sass/font-awesome.scss $@
|
2018-11-08 12:46:10 +01:00
|
|
|
|
2018-03-06 11:26:47 +01:00
|
|
|
css/%.min.css:: css/%.css
|
|
|
|
make dev
|
|
|
|
$(CLEANCSS) $< > $@
|
2018-02-09 16:09:34 +01:00
|
|
|
|
2018-10-06 06:59:04 +02:00
|
|
|
.PHONY: watchcss
|
|
|
|
watchcss: dev
|
2018-12-04 13:15:30 +01:00
|
|
|
$(SASS) --watch --source-map true --include-path $(BOURBON) --include-path $(BOOTSTRAP) -o ./css/ ./sass/
|
2014-04-18 17:39:45 +02:00
|
|
|
|
2017-06-21 22:26:00 +02:00
|
|
|
.PHONY: watchjs
|
2018-10-23 03:41:38 +02:00
|
|
|
watchjs: dev dist/converse-headless.js
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development --watch
|
2017-07-10 14:07:46 +02:00
|
|
|
|
2018-10-23 03:41:38 +02:00
|
|
|
.PHONY: watchjsheadless
|
|
|
|
watchjsheadless: dev
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development --watch --type=headless
|
2018-10-23 03:41:38 +02:00
|
|
|
|
2018-10-06 06:59:04 +02:00
|
|
|
.PHONY: watch
|
|
|
|
watch: dev
|
2018-10-28 22:58:08 +01:00
|
|
|
make -j 3 watchcss watchjsheadless watchjs
|
2018-10-06 06:59:04 +02:00
|
|
|
|
2018-03-30 13:30:50 +02:00
|
|
|
.PHONY: logo
|
|
|
|
logo: logo/conversejs-transparent16.png \
|
2018-10-22 13:10:55 +02:00
|
|
|
logo/conversejs-transparent19.png \
|
|
|
|
logo/conversejs-transparent48.png \
|
|
|
|
logo/conversejs-transparent128.png \
|
|
|
|
logo/conversejs-transparent512.png \
|
|
|
|
logo/conversejs-filled16.png \
|
|
|
|
logo/conversejs-filled19.png \
|
|
|
|
logo/conversejs-filled48.png \
|
|
|
|
logo/conversejs-filled128.png \
|
|
|
|
logo/conversejs-filled512.png \
|
2018-03-30 13:30:50 +02:00
|
|
|
|
|
|
|
logo/conversejs-transparent%.png:: logo/conversejs-transparent.svg
|
|
|
|
$(INKSCAPE) -e $@ -w $* $<
|
|
|
|
$(OXIPNG) $@
|
|
|
|
|
|
|
|
logo/conversejs-filled%.png:: logo/conversejs-filled.svg
|
|
|
|
$(INKSCAPE) -e $@ -w $* $<
|
|
|
|
$(OXIPNG) $@
|
|
|
|
|
2016-02-28 10:00:22 +01:00
|
|
|
BUILDS = dist/converse.js \
|
2018-06-14 10:22:16 +02:00
|
|
|
dist/converse.min.js \
|
|
|
|
dist/converse-headless.js \
|
|
|
|
dist/converse-headless.min.js \
|
|
|
|
dist/converse-no-dependencies.min.js \
|
|
|
|
dist/converse-no-dependencies.js \
|
|
|
|
dist/converse-no-dependencies-es2015.js
|
2018-06-04 12:07:49 +02:00
|
|
|
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse.min.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=production
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse-headless.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development --type=headless
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse-headless.min.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=production --type=headless
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse-no-dependencies.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development --type=nodeps
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse-no-dependencies.min.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=production --type=nodeps
|
2018-10-07 16:44:43 +02:00
|
|
|
dist/converse-no-dependencies-es2015.js: src webpack.config.js stamp-npm @converse/headless
|
2018-10-29 21:42:26 +01:00
|
|
|
$(NPX) webpack --mode=development --type=nodeps --lang=es2015
|
2018-06-04 12:07:49 +02:00
|
|
|
|
2018-10-22 13:10:55 +02:00
|
|
|
@converse/headless: src/headless
|
2016-02-27 16:57:30 +01:00
|
|
|
|
2016-02-28 10:00:22 +01:00
|
|
|
.PHONY: dist
|
|
|
|
dist:: build
|
2016-02-26 18:28:18 +01:00
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: build
|
2018-11-13 16:06:11 +01:00
|
|
|
build:: dev css $(BUILDS) locale.zip css/webfonts.zip sounds.zip
|
2018-10-29 21:42:26 +01:00
|
|
|
|
|
|
|
css/webfonts.zip: css/webfonts/*
|
|
|
|
zip -r css/webfonts.zip css/webfonts
|
|
|
|
|
2018-10-29 22:28:28 +01:00
|
|
|
locale.zip:
|
2018-10-29 21:42:26 +01:00
|
|
|
zip -r locale.zip locale --exclude *.pot --exclude *.po
|
2014-08-04 22:37:35 +02:00
|
|
|
|
2018-11-13 16:06:11 +01:00
|
|
|
sounds.zip:
|
|
|
|
zip -r sounds.zip sounds
|
|
|
|
|
2014-04-18 17:39:45 +02:00
|
|
|
########################################################################
|
|
|
|
## Tests
|
|
|
|
|
2017-01-26 15:49:02 +01:00
|
|
|
.PHONY: eslint
|
2018-03-17 19:54:01 +01:00
|
|
|
eslint: stamp-npm
|
2017-06-21 22:26:00 +02:00
|
|
|
$(ESLINT) src/
|
|
|
|
$(ESLINT) spec/
|
2017-01-26 15:49:02 +01:00
|
|
|
|
2016-05-23 21:21:42 +02:00
|
|
|
.PHONY: check
|
2017-04-05 11:01:31 +02:00
|
|
|
check: eslint
|
2018-02-07 13:26:39 +01:00
|
|
|
LOG_CR_VERBOSITY=INFO $(CHROMIUM) --no-sandbox http://localhost:$(HTTPSERVE_PORT)/tests/index.html
|
2014-04-18 17:39:45 +02:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
## Documentation
|
|
|
|
|
2015-09-25 21:39:47 +02:00
|
|
|
.PHONY: html
|
2018-11-13 12:59:35 +01:00
|
|
|
html: apidoc
|
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
|
2018-08-01 12:08:18 +02:00
|
|
|
make apidoc
|
2013-04-26 21:01:39 +02:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
2018-05-11 13:31:48 +02:00
|
|
|
|
2018-11-13 12:59:35 +01:00
|
|
|
PHONY: apidoc
|
2018-05-11 13:31:48 +02:00
|
|
|
apidoc:
|
2018-09-02 10:11:37 +02:00
|
|
|
$(JSDOC) --readme docs/source/jsdoc_intro.md -c docs/source/conf.json -d docs/html/api src/*.js
|