Commit 0e131159 authored by Marco Mariani's avatar Marco Mariani

"make zip" target for all storages, dependencies and minimized version

parent d5fb474f
......@@ -8,6 +8,9 @@ COMPLEX = complex_queries.js
COMPLEX_MIN = complex_queries.min.js
PARSER_PAR = $(QUERIES_DIR)/core/parser.par
PARSER_OUT = $(QUERIES_DIR)/build/parser.js
UGLIFY = ./node_modules/grunt-contrib-uglify/node_modules/uglify-js/bin/uglifyjs
ZIP_FULL = jio.zip
ZIP_MINI = jio-min.zip
# npm install jscc-node
JSCC_CMD = node ./node_modules/jscc-node/jscc.js -t ./node_modules/jscc-node/driver_node.js_
......@@ -18,6 +21,97 @@ compile:
mkdir -p $(dir $(PARSER_OUT))
$(JSCC_CMD) -o $(PARSER_OUT) $(PARSER_PAR)
TMPDIR := $(shell mktemp -d)
zip:
@echo "Preparing $(ZIP_FULL)"
@mkdir $(TMPDIR)/jio
@mkdir $(TMPDIR)/jio/storage
@cp jio.js $(TMPDIR)/jio/
@cp complex_queries.js $(TMPDIR)/jio/
@cp src/sha1.amd.js $(TMPDIR)/jio/
@cp src/sha2.amd.js $(TMPDIR)/jio/
@cp src/sha256.amd.js $(TMPDIR)/jio/
@cp lib/rsvp/rsvp-custom.js $(TMPDIR)/jio/
@cp lib/rsvp/rsvp-custom.amd.js $(TMPDIR)/jio/
@cp lib/jquery/jquery.js $(TMPDIR)/jio/
@cp lib/require/require.js $(TMPDIR)/jio/
@cp src/jio.storage/localstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/davstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/erp5storage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/indexstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/gidstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/replicatestorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/splitstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/cryptstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/revisionstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/replicaterevisionstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/s3storage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/splitstorage.js $(TMPDIR)/jio/storage/
@cp src/jio.storage/xwikistorage.js $(TMPDIR)/jio/storage/
@cd $(TMPDIR) && zip -q $(ZIP_FULL) -r jio
@mv $(TMPDIR)/$(ZIP_FULL) ./
@rm -rf $(TMPDIR)/jio
@echo "Preparing $(ZIP_MINI)"
@mkdir $(TMPDIR)/jio
@mkdir $(TMPDIR)/jio/storage
@echo "Minimizing JS..."
@cp jio.min.js $(TMPDIR)/jio/
@cp complex_queries.min.js $(TMPDIR)/jio/
@$(UGLIFY) src/sha1.amd.js >$(TMPDIR)/jio/sha1.amd.min.js 2>/dev/null
@$(UGLIFY) src/sha2.amd.js >$(TMPDIR)/jio/sha2.amd.min.js 2>/dev/null
@$(UGLIFY) src/sha256.amd.js >$(TMPDIR)/jio/sha256.amd.min.js 2>/dev/null
@$(UGLIFY) lib/rsvp/rsvp-custom.js >$(TMPDIR)/jio/rsvp-custom.min.js 2>/dev/null
@$(UGLIFY) lib/rsvp/rsvp-custom.amd.js >$(TMPDIR)/jio/rsvp-custom.amd.min.js 2>/dev/null
@cp lib/jquery/jquery.min.js $(TMPDIR)/jio/
@$(UGLIFY) lib/require/require.js >$(TMPDIR)/jio/require.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/localstorage.js >$(TMPDIR)/jio/storage/localstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/davstorage.js >$(TMPDIR)/jio/storage/davstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/erp5storage.js >$(TMPDIR)/jio/storage/erp5storage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/indexstorage.js >$(TMPDIR)/jio/storage/indexstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/gidstorage.js >$(TMPDIR)/jio/storage/gidstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/replicatestorage.js >$(TMPDIR)/jio/storage/replicatestorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/splitstorage.js >$(TMPDIR)/jio/storage/splitstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/cryptstorage.js >$(TMPDIR)/jio/storage/cryptstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/revisionstorage.js >$(TMPDIR)/jio/storage/revisionstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/replicaterevisionstorage.js >$(TMPDIR)/jio/storage/replicaterevisionstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/s3storage.js >$(TMPDIR)/jio/storage/s3storage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/splitstorage.js >$(TMPDIR)/jio/storage/splitstorage.min.js 2>/dev/null
@$(UGLIFY) src/jio.storage/xwikistorage.js >$(TMPDIR)/jio/storage/xwikistorage.min.js 2>/dev/null
@cd $(TMPDIR) && zip -q $(ZIP_MINI) -r jio
@mv $(TMPDIR)/$(ZIP_MINI) ./
@rm -rf $(TMPDIR)
# mkdir "$tmpdir"/storage && \
#
# cp -r jio.storage/localstorage.js "$tmpdir"/storage && \
# cp -r jio.storage/davstorage.js "$tmpdir"/storage && \
# cp -r jio.storage/erp5storage.js "$tmpdir"/storage && \
# cp -r jio.storage/indexstorage.js "$tmpdir"/storage && \
# cp -r jio.storage/gidstorage.js "$tmpdir"/storage && \
# cp -r jio.storage/replicatestorage.js "$tmpdir"/storage && \
# cp -r jio.storage/splitstorage.js "$tmpdir"/storage && \
#
# ##############################
#
# cd "$tmpdir" && \
# res=$?
#
# #cd - >/dev/null && \
# rm -rf "$tmpdir"
# exit $res
#
.phony: clean
clean:
find -name '*~' -delete
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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