2012-07-14 20:36:17 +00:00
|
|
|
NAME=method-draw
|
2012-05-17 22:50:00 +00:00
|
|
|
VERSION=2.6
|
2012-07-14 20:36:17 +00:00
|
|
|
PACKAGE=$(NAME)
|
2012-05-17 22:50:00 +00:00
|
|
|
MAKEDOCS=naturaldocs/NaturalDocs
|
|
|
|
CLOSURE=build/tools/closure-compiler.jar
|
2012-07-18 02:02:44 +00:00
|
|
|
YUICOMPRESSOR=build/tools/yuicompressor-2.4.7.jar
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
# All files that will be compiled by the Closure compiler.
|
|
|
|
|
|
|
|
JS_FILES=\
|
2012-06-23 19:40:40 +00:00
|
|
|
js-hotkeys/jquery.hotkeys.min.js \
|
|
|
|
jquerybbq/jquery.bbq.min.js \
|
|
|
|
svgicons/jquery.svgicons.js \
|
|
|
|
jgraduate/jquery.jgraduate.min.js \
|
|
|
|
spinbtn/JQuerySpinBtn.min.js \
|
|
|
|
touch.js \
|
|
|
|
contextmenu/jquery.contextmenu.js \
|
|
|
|
browser.js \
|
|
|
|
svgtransformlist.js \
|
|
|
|
math.js \
|
|
|
|
units.js \
|
|
|
|
svgutils.js \
|
|
|
|
sanitize.js \
|
|
|
|
history.js \
|
|
|
|
select.js \
|
|
|
|
draw.js \
|
|
|
|
path.js \
|
|
|
|
svgcanvas.js \
|
|
|
|
svg-editor.js \
|
|
|
|
contextmenu.js \
|
|
|
|
locale/locale.js \
|
|
|
|
jquery-ui/jquery-ui-1.8.17.custom.min.js \
|
|
|
|
jgraduate/jpicker.min.js \
|
2012-07-04 14:42:50 +00:00
|
|
|
mousewheel.js \
|
2012-07-19 15:22:42 +00:00
|
|
|
extensions/ext-eyedropper.js \
|
|
|
|
extensions/ext-markers.js \
|
|
|
|
extensions/ext-grid.js \
|
|
|
|
extensions/ext-imagelib.js \
|
2012-06-23 19:40:40 +00:00
|
|
|
|
|
|
|
CSS_FILES=\
|
2012-07-14 20:36:17 +00:00
|
|
|
fonts.css \
|
|
|
|
jgraduate/css/jPicker.css \
|
2012-06-23 19:40:40 +00:00
|
|
|
jgraduate/css/jgraduate.css \
|
|
|
|
svg-editor.css \
|
|
|
|
spinbtn/JQuerySpinBtn.css \
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
JS_INPUT_FILES=$(addprefix editor/, $(JS_FILES))
|
2012-06-23 19:40:40 +00:00
|
|
|
CSS_INPUT_FILES=$(addprefix editor/, $(CSS_FILES))
|
2012-07-14 20:36:17 +00:00
|
|
|
JS_BUILD_FILES=$(addprefix $(PACKAGE)/, $(JS_FILES))
|
|
|
|
CSS_BUILD_FILES=$(addprefix $(PACKAGE)/, $(CSS_FILES))
|
2012-05-17 22:50:00 +00:00
|
|
|
CLOSURE_JS_ARGS=$(addprefix --js , $(JS_INPUT_FILES))
|
|
|
|
COMPILED_JS=editor/svgedit.compiled.js
|
2012-06-23 19:40:40 +00:00
|
|
|
COMPILED_CSS=editor/svgedit.compiled.css
|
2012-05-17 22:50:00 +00:00
|
|
|
|
2012-06-23 19:40:40 +00:00
|
|
|
all: release
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
# The build directory relies on the JS being compiled.
|
2012-07-14 20:36:17 +00:00
|
|
|
$(PACKAGE): $(COMPILED_JS) $(COMPILED_CSS)
|
2012-05-17 22:50:00 +00:00
|
|
|
rm -rf config
|
|
|
|
mkdir config
|
|
|
|
if [ -x $(MAKEDOCS) ] ; then $(MAKEDOCS) -i editor/ -o html docs/ -p config/ -oft -r ; fi
|
|
|
|
|
|
|
|
# Make build directory and copy all editor contents into it
|
2012-07-14 20:36:17 +00:00
|
|
|
mkdir -p $(PACKAGE)
|
|
|
|
cp -r editor/* $(PACKAGE)
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
# Remove all hidden .svn directories
|
2012-07-14 20:36:17 +00:00
|
|
|
-find $(PACKAGE) -name .svn -type d | xargs rm -rf {} \;
|
|
|
|
-find $(PACKAGE) -name .git -type d | xargs rm -rf {} \;
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
# Create the release version of the main HTML file.
|
2012-07-14 20:36:17 +00:00
|
|
|
build/tools/ship.py --i=editor/svg-editor.html --on=svg_edit_release > $(PACKAGE)/svg-editor.html
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
# NOTE: Some files are not ready for the Closure compiler: (jquery)
|
|
|
|
# NOTE: Our code safely compiles under SIMPLE_OPTIMIZATIONS
|
|
|
|
# NOTE: Our code is *not* ready for ADVANCED_OPTIMIZATIONS
|
|
|
|
# NOTE: WHITESPACE_ONLY and --formatting PRETTY_PRINT is helpful for debugging.
|
2012-06-23 19:40:40 +00:00
|
|
|
|
|
|
|
$(COMPILED_CSS):
|
2012-07-18 01:03:31 +00:00
|
|
|
cat $(CSS_INPUT_FILES) > editor/temp.css;
|
2012-07-18 02:02:44 +00:00
|
|
|
java -jar $(YUICOMPRESSOR) editor/temp.css -o $(COMPILED_CSS) --line-break 0;
|
2012-06-23 19:40:40 +00:00
|
|
|
|
2012-05-17 22:50:00 +00:00
|
|
|
$(COMPILED_JS):
|
|
|
|
java -jar $(CLOSURE) \
|
|
|
|
--compilation_level SIMPLE_OPTIMIZATIONS \
|
|
|
|
$(CLOSURE_JS_ARGS) \
|
|
|
|
--js_output_file $(COMPILED_JS)
|
|
|
|
|
2012-06-23 19:40:40 +00:00
|
|
|
compile: $(COMPILED_JS) $(COMPILED_CSS)
|
2012-05-17 22:50:00 +00:00
|
|
|
|
2012-07-14 20:36:17 +00:00
|
|
|
release: $(PACKAGE)
|
2012-05-17 22:50:00 +00:00
|
|
|
|
2012-06-23 19:40:40 +00:00
|
|
|
deploy:
|
2012-07-14 20:36:17 +00:00
|
|
|
cp -R method-draw ../Method.ac/public
|
2012-05-17 22:50:00 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf config
|
2012-07-14 20:36:17 +00:00
|
|
|
rm -rf $(PACKAGE)
|
2012-05-17 22:50:00 +00:00
|
|
|
rm -rf $(COMPILED_JS)
|
2012-06-23 19:40:40 +00:00
|
|
|
rm -rf $(COMPILED_CSS)
|