<commit_before>
CWD=$(shell pwd)

SRC="./client/js/"
BUILD="./fine-uploader/"
TESTS="./test/"
DOCS="./docs/"
LIBS="./libs/"

NODE_MODULES="./node_modules/"

SELENIUM="${TESTS}vendor/selenium-server-standalone-2.33.0.jar"

JS_SRC_CORE=${SRC}header.js \
	 ${SRC}util.js \
	 ${SRC}version.js \
	 ${SRC}features.js \
	 ${SRC}promise.js \
	 ${SRC}button.js \
	 ${SRC}paste.js \
	 ${SRC}upload-data.js \
	 ${SRC}uploader.basic.js \
	 ${SRC}dnd.js \
	 ${SRC}uploader.js \
	 ${SRC}ajax.requester.js \
	 ${SRC}deletefile.ajax.requester.js \
	 ${SRC}window.receive.message.js \
	 ${SRC}handler.base.js \
	 ${SRC}handler.form.js \
	 ${SRC}handler.xhr.js 
JS_SRC_JQUERY+=${JS_SRC_CORE}
JS_SRC_JQUERY+=${SRC}jquery-plugin.js \
			   ${SRC}jquery-dnd.js

all: fine-uploader

fine-uploader: clean build test docs
	@echo "${HR}"
	@echo "${DATE}\n"

#
# Node Modules
#
node_modules: package.json
	npm update

VERSION=$(shell cat ./client/js/version.js | sed 's/[^\"]*\"\([^\"]*\)\"[^\"]*/\1/g')

#
# Clean
#
clean: clean-node clean-build clean-docs

clean-build:
	rm -rf ${BUILD}*
	mkdir -p ${BUILD}{js,css,img}

clean-node:
	rm -rf ${NODE_MODULES}

clean-docs:
	rm -rf ${DOCS}docco.css
	rm -rf ${DOCS}fine-uploader.html
	rm -rf ${DOCS}public

#
# Build
#
build: node_modules build-js build-css build-img

build-js: concat-js minify-js 
#build-js: lint concat-js minify-js 

build-css: minify-css

build-img:
	cp ${SRC}../{loading.gif,processing.gif} ${BUILD}img 

build-docs: docs

concat-js:
	@echo "Combining js ..."
	cat ${JS_SRC_CORE} | tee ${BUILD}js/fine-uploader-${VERSION}.js
	cat ${JS_SRC_JQUERY} | tee ${BUILD}js/jquery-fine-uploader-${VERSION}.js
	cat ${SRC}iframe.xss.response.js | tee ${BUILD}js/iframe.xss.response.js
	cp README ${BUILD}README
	cp LICENSE ${BUILD}LICENSE
	@echo "Js combined."

#
# Minify
#
minify: minify-js minify-css

minify-js:
	@echo "Minifying js ..."
	${NODE_MODULES}uglify-js/bin/uglifyjs ./fine-uploader/js/fine-uploader-${VERSION}.js -o ./fine-uploader/js/fine-uploader-${VERSION}.min.js
	${NODE_MODULES}uglify-js/bin/uglifyjs ./fine-uploader/js/jquery-fine-uploader-${VERSION}.js -o ./fine-uploader/js/jquery-fine-uploader-${VERSION}.min.js
	@echo "Js minified."

minify-css:
	@echo "Minifying css ..."
	cp ./client/fineuploader.css ${BUILD}css/fine-uploader-${VERSION}.css
	${NODE_MODULES}clean-css/bin/cleancss -o ${BUILD}css/fine-uploader-${VERSION}.min.css \
		${BUILD}css/fine-uploader-${VERSION}.css
	@echo "Css minified."

#
# Lint
#
lint:
	@echo "\n${HR}"
	@echo "Linting ..."
	${NODE_MODULES}jshint/bin/jshint ${SRC}
	@echo "Linted."

#
# Docs
#
docs:
	@echo "\n${HR}"
	@echo "Building docs ..."
	${NODE_MODULES}docco/bin/docco -o ${DOCS} ${BUILD}js/fine-uploader.js
	@echo "Docs built."

#
# Tests
#
test-all: clean build test

test:
	@echo "\n${HR}"
	@echo "Running tests ..."
	PHANTOMJS_BIN=${NODE_MODULES}phantomjs/bin/phantomjs ${NODE_MODULES}karma/bin/karma start --single-run
	@echo "Tests run."

test-watch:
	@echo "\n${HR}"
	@echo "Watching tests ..."
	PHANTOMJS_BIN=${NODE_MODULES}phantomjs/bin/phantomjs ${NODE_MODULES}karma/bin/karma start
	@echo "Tests run."

#
# Utils
#
start-selenium:
	@echo "Starting Selenium ..."
	export PATH=./node_modules/phantomjs/bin:$$PATH
	PATH=./node_modules/phantomjs/bin:$$PATH java -jar ${SELENIUM} -log selenium.log -browserSideLog > /dev/null 2>&1 &<commit_msg>Fixed quoting to be more consistent. Removed docco<commit_after>
CWD=$(shell pwd)

SRC=./client/js/
BUILD=./fine-uploader/
TESTS=./test/
DOCS=./docs/
LIBS=./libs/

NODE_MODULES=./node_modules/

SELENIUM=${TESTS}vendor/selenium-server-standalone-2.33.0.jar

JS_SRC_CORE=${SRC}header.js \
	 ${SRC}util.js \
	 ${SRC}version.js \
	 ${SRC}features.js \
	 ${SRC}promise.js \
	 ${SRC}button.js \
	 ${SRC}paste.js \
	 ${SRC}upload-data.js \
	 ${SRC}uploader.basic.js \
	 ${SRC}dnd.js \
	 ${SRC}uploader.js \
	 ${SRC}ajax.requester.js \
	 ${SRC}deletefile.ajax.requester.js \
	 ${SRC}window.receive.message.js \
	 ${SRC}handler.base.js \
	 ${SRC}handler.form.js \
	 ${SRC}handler.xhr.js 
JS_SRC_JQUERY+=${JS_SRC_CORE}
JS_SRC_JQUERY+=${SRC}jquery-plugin.js \
			   ${SRC}jquery-dnd.js

all: fine-uploader

fine-uploader: clean build test docs
	@echo "${HR}"
	@echo "${DATE}\n"

#
# Node Modules
#
node_modules: package.json
	npm update

VERSION=$(shell cat ./client/js/version.js | sed 's/[^\"]*\"\([^\"]*\)\"[^\"]*/\1/g')

#
# Clean
#
clean: clean-node clean-build clean-docs

clean-build:
	rm -rf ${BUILD}*
	mkdir -p ${BUILD}{js,css,img}

clean-node:
	rm -rf ${NODE_MODULES}

clean-docs:
	rm -rf ${DOCS}docco.css
	rm -rf ${DOCS}fine-uploader.html
	rm -rf ${DOCS}public

#
# Build
#
build: node_modules build-js build-css build-img

build-js: concat-js minify-js 
#build-js: lint concat-js minify-js 

build-css: minify-css

build-img:
	cp ${SRC}../{loading.gif,processing.gif} ${BUILD}img 

build-docs: docs

concat-js:
	@echo "Combining js ..."
	cat ${JS_SRC_CORE} | tee ${BUILD}js/fine-uploader-${VERSION}.js
	cat ${JS_SRC_JQUERY} | tee ${BUILD}js/jquery-fine-uploader-${VERSION}.js
	cat ${SRC}iframe.xss.response.js | tee ${BUILD}js/iframe.xss.response.js
	cp README ${BUILD}README
	cp LICENSE ${BUILD}LICENSE
	@echo "Js combined."

#
# Minify
#
minify: minify-js minify-css

minify-js:
	@echo "Minifying js ..."
	${NODE_MODULES}uglify-js/bin/uglifyjs ./fine-uploader/js/fine-uploader-${VERSION}.js -o ./fine-uploader/js/fine-uploader-${VERSION}.min.js
	${NODE_MODULES}uglify-js/bin/uglifyjs ./fine-uploader/js/jquery-fine-uploader-${VERSION}.js -o ./fine-uploader/js/jquery-fine-uploader-${VERSION}.min.js
	@echo "Js minified."

minify-css:
	@echo "Minifying css ..."
	cp ./client/fineuploader.css ${BUILD}css/fine-uploader-${VERSION}.css
	${NODE_MODULES}clean-css/bin/cleancss -o ${BUILD}css/fine-uploader-${VERSION}.min.css \
		${BUILD}css/fine-uploader-${VERSION}.css
	@echo "Css minified."

#
# Lint
#
lint:
	@echo "\n${HR}"
	@echo "Linting ..."
	${NODE_MODULES}jshint/bin/jshint ${SRC}
	@echo "Linted."

#
# Docs
#
docs:
	@echo "\n${HR}"
	@echo "Building docs ..."
	#${NODE_MODULES}docco/bin/docco -o ${DOCS} ${BUILD}js/fine-uploader.js
	@echo "Docs built."

#
# Tests
#
test-all: clean build test

test:
	@echo "\n${HR}"
	@echo "Running tests ..."
	PHANTOMJS_BIN=${NODE_MODULES}phantomjs/bin/phantomjs ${NODE_MODULES}karma/bin/karma start --single-run
	@echo "Tests run."

test-watch:
	@echo "\n${HR}"
	@echo "Watching tests ..."
	PHANTOMJS_BIN=${NODE_MODULES}phantomjs/bin/phantomjs ${NODE_MODULES}karma/bin/karma start
	@echo "Tests run."

#
# Utils
#
start-selenium:
	@echo "Starting Selenium ..."
	export PATH=./node_modules/phantomjs/bin:$$PATH
	PATH=./node_modules/phantomjs/bin:$$PATH java -jar ${SELENIUM} -log selenium.log -browserSideLog > /dev/null 2>&1 &
{'fraction_non_alphanumeric': 0.20232419547079858, 'fraction_numerical': 0.0020858164481525627, 'mean_word_length': 3.8821818181818184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '428484', 'n_tokens_mistral': 2910, 'n_tokens_neox': 2772, 'n_words': 461}