Created
September 12, 2012 14:55
-
-
Save hugosenari/3707182 to your computer and use it in GitHub Desktop.
make
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSS = Content/css/style.css | |
CSS_MIN = Content/css/style.min.css | |
CSS_META = Content/css/meta-css/style.less | |
LESS = 'Content/css/meta-css/.*\.less' | |
JSS = $(wildcard Scripts/*.js) | |
JSS_NAMES = $(basename ${JSS}) | |
DATE=$(shell date +%I:%M%p) | |
CHECK=\033[32m✔\033[39m | |
HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# | |
# | |
# BUILD | |
# recess & uglifyjs are required | |
# | |
main: build test | |
build: clean | |
@echo "\n${HR}" | |
@echo "Building dos arquivos..." | |
@echo "${HR}\n" | |
@echo "Running JSHint on javascript..." | |
@echo "Running JSHint on javascript... ${CHECK} Done" | |
@echo "Compiling LESS with Recess..." | |
@recess --compile $(CSS_META) > $(CSS) | |
@echo "Compiling LESS with Recess... ${CHECK} Done" | |
@echo "${HR}\n" | |
@echo "Comprimindo os arquivos..." | |
@echo "${HR}\n" | |
@recess --compress $(CSS) > $(CSS_MIN) | |
$(foreach FILE, $(JSS_NAMES), $(shell uglifyjs -nc "$(FILE).js" > "$(FILE).min.js")) | |
@echo "Comprimindo os arquivos... ${CHECK} Done" | |
# | |
# RUN JSHINT & QUNIT TESTS IN PHANTOMJS | |
# | |
test: | |
@echo "\n${HR}" | |
@echo "Testando..." | |
@echo "Nenhum teste encontrado..." | |
# | |
# CLEANS THE ROOT DIRECTORY OF PRIOR BUILDS | |
# | |
clean: | |
@echo "\n${HR}" | |
@echo "Removendo arquivos .min ..." | |
-rm -r $(wildcard Scripts/*.min.js) | |
# | |
# Compress Files | |
# recess & uglifyjs are required | |
# | |
# | |
# WATCH LESS FILES | |
# | |
watch: | |
echo "Watching less files..."; \ | |
watchr -e "watch($(LESS)) { system 'make' }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment