2015-08-04 12:57:38 -05:00
# Version number of loleaflet, no need to be in sync with the loolwsd
# one, but do please follow the same even/odd convention for the third
# ("micro") part: Between releases odd, even for releases (no other
# changes inbetween).
2015-05-19 06:29:55 -05:00
# Version number of the bundled 'draw' thing
DRAW_VERSION=0.2.4
2016-08-16 00:37:55 -05:00
MINIFY=false
2016-08-07 11:27:29 -05:00
2017-01-03 22:24:55 -06:00
EXTRA_DIST = $(shell git ls-files)
2017-04-27 02:58:18 -05:00
all-local: node_modules build-l10n
2016-04-14 04:36:32 -05:00
rm -rf dist/plugins/draw-$(DRAW_VERSION) && mkdir -p dist/plugins/draw-$(DRAW_VERSION)
cd plugins/draw-$(DRAW_VERSION) && jake build && cp -ar dist ../../dist/plugins/draw-$(DRAW_VERSION)
2016-12-12 06:23:32 -06:00
jake build debug=$(ENABLE_DEBUG) minify=$(MINIFY)
2016-08-07 11:27:29 -05:00
2017-04-27 02:58:18 -05:00
mkdir -p dist/l10n/styles
mv po/*.json dist/l10n/
mv po/styles/*.json dist/l10n/styles/
2016-12-12 04:24:43 -06:00
node_modules: npm-shrinkwrap.json
npm install
touch node_modules
2016-09-21 03:09:00 -05:00
.PHONY: build-l10n
build-l10n:
util/po2json.py --quiet po/*.po
util/po2json.py --quiet po/styles/*.po
2017-01-04 08:08:33 -06:00
.PHONY: move-l10n-to-dist
move-l10n-to-dist:
mv po/*.json dist/l10n/
2016-09-21 03:09:00 -05:00
mv po/styles/*.json dist/l10n/styles/
2017-01-04 08:08:33 -06:00
install-data-hook:
mkdir -p $(DESTDIR)$(pkgdatadir)/loleaflet; \
cp -ar dist/ $(DESTDIR)$(pkgdatadir)/loleaflet/;
dist-hook: build-l10n
chmod u+w $(distdir)/dist
mkdir -p $(distdir)/dist/l10n/styles
mv po/*.json $(distdir)/dist/l10n/
mv po/styles/*.json $(distdir)/dist/l10n/styles/
2016-08-07 11:27:29 -05:00
2017-01-04 08:08:33 -06:00
mkdir -p $(distdir)/dist/node_modules/jquery-ui/themes/ui-lightness/images/
2017-04-20 03:58:25 -05:00
cp -a "node_modules/jquery-ui/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png" $(distdir)/dist/node_modules/jquery-ui/themes/ui-lightness/images/
2015-05-20 12:46:12 -05:00
2016-02-08 10:20:05 -06:00
pot:
2016-08-10 05:36:57 -05:00
xgettext --from-code=UTF-8 --keyword=_ --output=po/templates/loleaflet-ui.pot \
2016-09-21 02:35:52 -05:00
admin.strings.js \
2016-06-03 05:25:54 -05:00
evol.colorpicker.strings.js \
2016-05-24 01:53:07 -05:00
unocommands.js \
2016-05-23 15:32:56 -05:00
dist/errormessages.js \
2016-05-23 06:29:16 -05:00
dist/toolbar/toolbar.js \
2016-05-31 16:26:02 -05:00
src/admin/AdminSocketBase.js \
src/admin/AdminSocketOverview.js \
2017-04-17 13:36:04 -05:00
src/admin/AdminSocketHistory.js \
2017-03-13 07:03:00 -05:00
src/admin/AdminSocketSettings.js \
2016-05-31 16:26:02 -05:00
src/admin/Util.js \
2016-11-22 16:12:14 -06:00
src/control/Control.CharacterMap.js \
2016-06-21 09:44:20 -05:00
src/control/Control.ColumnHeader.js \
2017-04-12 15:22:49 -05:00
src/control/Control.ContextMenu.js \
2016-09-20 02:52:24 -05:00
src/control/Control.DocumentRepair.js \
2016-05-23 15:49:11 -05:00
src/control/Control.Menubar.js \
2017-03-13 07:03:00 -05:00
src/control/Control.MetricInput.js \
2016-06-21 09:44:20 -05:00
src/control/Control.RowHeader.js \
2017-03-13 07:03:00 -05:00
src/control/Control.Scroll.Annotation.js \
2016-05-31 16:26:02 -05:00
src/control/Control.Tabs.js \
2016-06-09 08:26:08 -05:00
src/control/Toolbar.js \
2016-05-31 09:36:21 -05:00
src/core/Socket.js \
2017-03-13 07:03:00 -05:00
src/layer/marker/Annotation.js \
src/layer/tile/TileLayer.js \
2016-08-19 07:34:21 -05:00
src/map/Map.js \
src/map/handler/Map.FileInserter.js
2016-05-31 16:26:02 -05:00
2017-01-09 08:48:16 -06:00
html2po --pot --input=dist/loleaflet-help.html --output=po/templates/loleaflet-help.pot --duplicates=merge
2016-02-08 10:20:05 -06:00
l10n: pot
2016-08-10 05:36:57 -05:00
for i in po/ui-*.po; do pot2po --input=po/templates/loleaflet-ui.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
for i in po/help-*.po; do pot2po --input=po/templates/loleaflet-help.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
2016-02-08 10:20:05 -06:00
2016-12-12 06:23:32 -06:00
clean-local:
rm -rf node_modules
cd dist && rm -f bundle.js bundle.js.map admin-bundle.js admin-bundle.js.map
cd plugins/draw-$(DRAW_VERSION) && rm -f dist/*.js
2015-09-11 02:41:23 -05:00
spec/data/load-test:
if [ ! -d spec/data/load_test ]; then \
mkdir -p spec/data/load_test; \
for i in $$(seq 1 125); \
do \
cp spec/data/eval.odt spec/data/load_test/eval$$i.odt; \
cp spec/data/eval.odp spec/data/load_test/eval$$i.odp; \
cp spec/data/eval.ods spec/data/load_test/eval$$i.ods; \
cp spec/data/eval.odg spec/data/load_test/eval$$i.odg; \
done; \
fi
load-test: spec/data/load-test
rm -rf load_test_out; \
mkdir load_test_out; \
for i in $$(seq 1 20); \
do \
2016-03-07 04:59:14 -06:00
node_modules/.bin/mocha spec/headlessLoadTest.js > load_test_out/$$i.out 2>&1 & \
2015-09-11 02:41:23 -05:00
done;