Browse files

Implemented the 'controller' task.

  • Loading branch information...
1 parent f4fad0d commit 1e56b05bd598534e91dfdcc1a3144a26a89fe3b5 @mr-rock mr-rock committed Mar 11, 2012
Showing with 36 additions and 0 deletions.
  1. +36 −0 Makefile
View
36 Makefile
@@ -96,6 +96,42 @@ 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]"

0 comments on commit 1e56b05

Please sign in to comment.