Skip to content
Browse files

fix for GRAILS-6740 "Create mutiple domain classes from CreateDomainC…

…lass.groovy"
  • Loading branch information...
1 parent 00c012b commit 159463933bd04dd4997d486abf10a85fb8f0353d @graemerocher graemerocher committed
View
16 scripts/CreateController.groovy
@@ -31,13 +31,15 @@ target ('default': "Creates a new controller") {
def type = "Controller"
promptForName(type: type)
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, type)
- createArtifact(name: name, suffix: type, type: type, path: "grails-app/controllers")
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, type)
+ createArtifact(name: name, suffix: type, type: type, path: "grails-app/controllers")
- def viewsDir = "${basedir}/grails-app/views/${propertyName}"
- ant.mkdir(dir:viewsDir)
- event("CreatedFile", [viewsDir])
+ def viewsDir = "${basedir}/grails-app/views/${propertyName}"
+ ant.mkdir(dir:viewsDir)
+ event("CreatedFile", [viewsDir])
+
+ createUnitTest(name: name, suffix: type, superClass: "ControllerUnitTestCase")
+ }
- createUnitTest(name: name, suffix: type, superClass: "ControllerUnitTestCase")
}
View
7 scripts/CreateDomainClass.groovy
@@ -30,7 +30,8 @@ target ('default': "Creates a new domain class") {
promptForName(type: "Domain class")
- def name = argsMap["params"][0]
- createArtifact(name: name, suffix: "", type: "DomainClass", path: "grails-app/domain")
- createUnitTest(name: name, suffix: "")
+ for ( name in argsMap["params"] ) {
+ createArtifact(name: name, suffix: "", type: "DomainClass", path: "grails-app/domain")
+ createUnitTest(name: name, suffix: "")
+ }
}
View
9 scripts/CreateFilters.groovy
@@ -33,8 +33,9 @@ target ('default': "Creates a new filters class") {
def type = "Filters"
promptForName(type: type)
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, type)
- createArtifact(name: name, suffix: type, type: type, path: "grails-app/conf")
- createUnitTest(name: name, suffix: type)
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, type)
+ createArtifact(name: name, suffix: type, type: type, path: "grails-app/conf")
+ createUnitTest(name: name, suffix: type)
+ }
}
View
7 scripts/CreateIntegrationTest.groovy
@@ -30,7 +30,8 @@ target ('default': "Creates a new Grails integration test which loads the whole
promptForName(type: "Integration test")
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, 'Tests')
- createIntegrationTest(name: name, suffix: "")
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, 'Tests')
+ createIntegrationTest(name: name, suffix: "")
+ }
}
View
8 scripts/CreateScript.groovy
@@ -30,6 +30,10 @@ target ('default': "Creates a Grails Gant Script") {
def type = "Script"
promptForName(type: type)
- createArtifact(name: argsMap["params"][0], suffix: "", type: type,
- path: "scripts", skipPackagePrompt: true)
+
+ for ( name in argsMap["params"] ) {
+ createArtifact(name: name, suffix: "", type: type,
+ path: "scripts", skipPackagePrompt: true)
+
+ }
}
View
9 scripts/CreateService.groovy
@@ -33,8 +33,9 @@ target ('default': "Creates a new service class") {
def type = "Service"
promptForName(type: type)
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, type)
- createArtifact(name: name, suffix: type, type: type, path: "grails-app/services")
- createUnitTest(name: name, suffix: type)
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, type)
+ createArtifact(name: name, suffix: type, type: type, path: "grails-app/services")
+ createUnitTest(name: name, suffix: type)
+ }
}
View
11 scripts/CreateTagLib.groovy
@@ -31,8 +31,11 @@ target ('default': "Creates a new tag library") {
def type = "TagLib"
promptForName(type: type)
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, type)
- createArtifact(name: name, suffix: type, type: type, path: "grails-app/taglib")
- createUnitTest(name: name, suffix: type, superClass: "TagLibUnitTestCase")
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, type)
+ createArtifact(name: name, suffix: type, type: type, path: "grails-app/taglib")
+ createUnitTest(name: name, suffix: type, superClass: "TagLibUnitTestCase")
+ }
+
+
}
View
7 scripts/CreateUnitTest.groovy
@@ -30,7 +30,8 @@ target ('default': "Creates a new Grails unit test. A unit test requires that yo
promptForName(type: "Unit test")
- def name = argsMap["params"][0]
- name = purgeRedundantArtifactSuffix(name, 'Tests')
- createUnitTest(name: name, suffix: "")
+ for ( name in argsMap["params"] ) {
+ name = purgeRedundantArtifactSuffix(name, 'Tests')
+ createUnitTest(name: name, suffix: "")
+ }
}

0 comments on commit 1594639

Please sign in to comment.
Something went wrong with that request. Please try again.