Permalink
Browse files

Implemented the 'model' task.

  • Loading branch information...
1 parent 8e0eff5 commit 209b86e2bd3d8854a5f5c6c9815f2859be66c517 @mr-rock mr-rock committed Mar 11, 2012
Showing with 36 additions and 0 deletions.
  1. +36 −0 Makefile
View
36 Makefile
@@ -95,6 +95,42 @@ 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)

0 comments on commit 209b86e

Please sign in to comment.