Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: bca1fd7169
Fetching contributors…

Cannot retrieve contributors at this time

263 lines (242 sloc) 9.329 kb
include .alice/setup
include .alice/directories
include .alice/executables
include .alice/templates
include .alice/javascript
include .alice/coffeescript
include .alice/test
include .alice/licenses
help:
@echo $(HELPMENU)
version:
@echo "0.4.0"
ifeq "$(LIB_LANGUAGE)" "CS"
clean:
@rm -f *.log
@rm -f $(LIB_INDEX)
@rm -drf $(EXECUTABLES_DIRECTORY)
@rm -drf $(LIBRARIES_DIRECTORY)
@rm -drf $(DEPLOYMENT_DIRECTORY)
else
clean:
@rm -f *.log
@rm -drf $(DEPLOYMENT_DIRECTORY)
endif
ifeq "$(LANGUAGE)" "cs"
setup:
@echo "LIB_LANGUAGE = CS" >> .alice/setup
@make setup-lib
else
setup:
@make setup-lib
endif
update:
@git clone https://github.com/rock-n-code/alice $(TEMPORARY_DIRECTORY)
@mv .alice/setup $(TEMPORARY_DIRECTORY)
@rm -drf .alice
@rm Makefile
@mv $(TEMPORARY_DIRECTORY)/.alice .
@rm .alice/setup
@mv $(TEMPORARY_DIRECTORY)/setup .alice
@mv $(TEMPORARY_DIRECTORY)/Makefile .
@rm -drf $(TEMPORARY_DIRECTORY)
mit-license:
@echo $(MIT_LICENSE) > LICENSE
ifeq "$(LIB_ENVIRONMENT)" "production"
dependencies:
@if [ -d "$(DEPENDENCIES_DIRECTORY)" ]; then rm -drf $(DEPENDENCIES_DIRECTORY); fi
@npm install --production
else
dependencies:
@if [ -d "$(DEPENDENCIES_DIRECTORY)" ]; then rm -drf $(DEPENDENCIES_DIRECTORY); fi
@npm install
endif
ifeq "$(NAME)" ""
executable:
@echo "ERROR: You're required to give the NAME argument to the 'executable' task to create a new executable file in your project."
@echo "SYNTAX: make executable NAME=ExecutableName"
else
ifeq "$(LIB_LANGUAGE)" "CS"
executable:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(EXECUTABLES_DIRECTORY)
@echo $(EXECUTABLE_CS) > ./$(SOURCES_DIRECTORY)/$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)
@chmod 0755 ./$(SOURCES_DIRECTORY)/$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)
@mkdir -p ./$(TESTS_DIRECTORY)/$(EXECUTABLES_DIRECTORY)
@echo $(TESTEXECUTABLE_CS) > ./$(TESTS_DIRECTORY)/$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)-test.coffee
else
executable:
@mkdir -p ./$(EXECUTABLES_DIRECTORY)
@echo $(EXECUTABLE_JS) > ./$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)
@chmod 0755 ./$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)
@mkdir -p ./$(TESTS_DIRECTORY)/$(EXECUTABLES_DIRECTORY)
@echo $(TESTEXECUTABLE_JS) > ./$(TESTS_DIRECTORY)/$(EXECUTABLES_DIRECTORY)/$(NAME_CAMELIZED)-test.js
endif
endif
ifeq "$(NAME)" ""
module:
@echo "ERROR: You're required to give the NAME argument to the 'module' task to create a new module in your project."
@echo "SYNTAX: make module NAME=ModuleName [GROUP=GroupName]"
else
ifeq "$(GROUP)" ""
ifeq "$(LIB_LANGUAGE)" "CS"
module:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(MODULE_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).coffee
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTMODULE_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.coffee
else
module:
@mkdir -p ./$(LIBRARIES_DIRECTORY)
@echo $(MODULE_JS) > ./$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).js
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTMODULE_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.js
endif
else
ifeq "$(LIB_LANGUAGE)" "CS"
module:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(MODULE_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).coffee;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTMODULE_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.coffee;
else
module:
@mkdir -p ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(MODULE_JS) > ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).js;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTMODULE_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.js;
endif
endif
endif
ifeq "$(NAME)" ""
controller:
@echo "ERROR: You're required to give the NAME argument to the 'controller' task to create a new controller in your project."
@echo "SYNTAX: make controller NAME=ControllerName [GROUP=GroupName]"
else
ifeq "$(GROUP)" ""
ifeq "$(LIB_LANGUAGE)" "CS"
controller:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(CONTROLLER_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).coffee
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTCONTROLLER_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.coffee
else
controller:
@mkdir -p ./$(LIBRARIES_DIRECTORY)
@echo $(CONTROLLER_JS) > ./$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).js
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTCONTROLLER_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.js
endif
else
ifeq "$(LIB_LANGUAGE)" "CS"
controller:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(CONTROLLER_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).coffee;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTCONTROLLER_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.coffee;
else
controller:
@mkdir -p ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(CONTROLLER_JS) > ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).js;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTCONTROLLER_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.js;
endif
endif
endif
ifeq "$(NAME)" ""
model:
@echo "ERROR: You're required to give the NAME argument to the 'model' task to create a new model in your project."
@echo "SYNTAX: make model NAME=ModelName [GROUP=GroupName]"
else
ifeq "$(GROUP)" ""
ifeq "$(LIB_LANGUAGE)" "CS"
model:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(MODEL_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).coffee
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTMODEL_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.coffee
else
model:
@mkdir -p ./$(LIBRARIES_DIRECTORY)
@echo $(MODEL_JS) > ./$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED).js
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)
@echo $(TESTMODEL_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(NAME_CAMELIZED)-test.js
endif
else
ifeq "$(LIB_LANGUAGE)" "CS"
model:
@mkdir -p ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(MODEL_CS) > ./$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).coffee;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTMODEL_CS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.coffee;
else
model:
@mkdir -p ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(MODEL_JS) > ./$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED).js;
@mkdir -p ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED);
@echo $(TESTMODEL_JS) > ./$(TESTS_DIRECTORY)/$(LIBRARIES_DIRECTORY)/$(GROUP_CAMELIZED)/$(NAME_CAMELIZED)-test.js;
endif
endif
endif
ifeq "$(LIB_LANGUAGE)" "CS"
build:
@$(COFFEE) --compile --output . $(SOURCE_DIRECTORY)
@if [ -d "$(SOURCES_DIRECTORY)/$(EXECUTABLES_DIRECTORY)" ]; then $(COFFEE) --compile --output $(EXECUTABLES_DIRECTORY) $(SOURCES_DIRECTORY)/$(EXECUTABLES_DIRECTORY); fi
@if [ -d "$(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY)" ]; then $(COFFEE) --compile --output $(LIBRARIES_DIRECTORY) $(SOURCES_DIRECTORY)/$(LIBRARIES_DIRECTORY); fi
endif
ifeq "$(LIB_LANGUAGE)" "CS"
watch:
$(JITTER) $(SOURCES_DIRECTORY) . $(TEST_DIRECTORY)
endif
ifeq "$(LIB_LANGUAGE)" "CS"
test:
@NODE_ENV=test $(MOCHA) \
--require $(TEST_DEPENDENCY) \
--reporter $(TEST_REPORTER) \
--ui $(TEST_INTERFACE) \
--slow $(TEST_THRESHOLD) \
--compilers coffee:coffee-script \
--colors \
$(TEST_FILES_CS)
else
test:
@NODE_ENV=test $(MOCHA) \
--require $(TEST_DEPENDENCY) \
--reporter $(TEST_REPORTER) \
--ui $(TEST_INTERFACE) \
--slow $(TEST_THRESHOLD) \
--colors \
--watch \
$(TEST_FILES_JS)
endif
ifeq "$(LIB_LANGUAGE)" "CS"
prepare:
@make build
@make dependencies LIB_ENVIRONMENT=production
@make move_files-to-deployment
else
prepare:
@make clean
@make dependencies LIB_ENVIRONMENT=production
@make move-files-to-deployment
endif
.PHONY: help version clean create update mit-license dependencies executable module build watch run test prepare
# Helpers
git-init:
@git init
@git add .
@git commit -m "Initial commit."
@git checkout -b development
setup-lib:
@rm -drf .git
@rm README.md LICENSE .gitignore
@echo $(INDEX_JS) > index.js
@echo $(PACKAGE) > package.json
@echo $(GITIGNORE) | sed 's/ //g' > .gitignore
@make module NAME=$(LIB_NAME)
@make git-init
move-files-to-deployment:
@mkdir $(DEPLOYMENT_DIRECTORY)
@cp $(LIB_INDEX) $(DEPLOYMENT_DIRECTORY)
@if [ -d "$(EXECUTABLES_DIRECTORY)" ]; then cp -r $(EXECUTABLES_DIRECTORY) $(DEPLOYMENT_DIRECTORY); fi
@if [ -d "$(LIBRARIES_DIRECTORY)" ]; then cp -r $(LIBRARIES_DIRECTORY) $(DEPLOYMENT_DIRECTORY); fi
@if [ -d "$(DEPENDENCIES_DIRECTORY)" ]; then cp -r $(DEPENDENCIES_DIRECTORY) $(DEPLOYMENT_DIRECTORY); fi
Jump to Line
Something went wrong with that request. Please try again.