Permalink
Browse files

apply patch for GRAILS-6830 "_GrailsCreateArtifacts script should loo…

…k for artifact templates also in plugin directories configured using grails.plugin.location entries in build config"
  • Loading branch information...
1 parent 51c4921 commit e5d0ca1b2da700af824030a24160021bca0cae1c @graemerocher graemerocher committed Nov 19, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 scripts/_GrailsCreateArtifacts.groovy
@@ -80,11 +80,11 @@ createArtifact = { Map args = [:] ->
templateFile = new FileSystemResource("${basedir}/src/${templatePath}/${type ?: lastType}.groovy")
if (!templateFile.exists()) {
// now check for template provided by plugins
- def pluginTemplateFiles = resolveResources("file:${pluginsHome}/*/src/${templatePath}/${type ?: lastType}.groovy")
- if (pluginTemplateFiles) {
- templateFile = pluginTemplateFiles[0]
- }
- else {
+ def possibleResources = pluginSettings.pluginDirectories.collect { dir ->
+ new FileSystemResource("${dir.path}/src/templates/artifacts/${type ?: lastType}.groovy")
+ }
+ templateFile = possibleResources.find { it.exists() }
+ if (!templateFile) {
// template not found in application, use default template
templateFile = grailsResource("src/grails/${templatePath}/${type ?: lastType}.groovy")
}

2 comments on commit e5d0ca1

Looks like this change brakes spock test generation ( spock:0.7, grails:2.2.0). The plugin code in _Events.groovy use template directory path set by 'templatePath' as "templates/testing" while this change expect all plugins templates use hardcoded "templates/artifacts".

Please let me know if you need more information

Owner

graemerocher replied Jan 13, 2013

Please raise a JIRA to track the issue

Please sign in to comment.