Skip to content

Commit

Permalink
apply patch for GRAILS-6830 "_GrailsCreateArtifacts script should loo…
Browse files Browse the repository at this point in the history
…k for artifact templates also in plugin directories configured using grails.plugin.location entries in build config"
  • Loading branch information
graemerocher committed Nov 19, 2012
1 parent 51c4921 commit e5d0ca1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/_GrailsCreateArtifacts.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ createArtifact = { Map args = [:] ->
templateFile = new FileSystemResource("${basedir}/src/${templatePath}/${type ?: lastType}.groovy") templateFile = new FileSystemResource("${basedir}/src/${templatePath}/${type ?: lastType}.groovy")
if (!templateFile.exists()) { if (!templateFile.exists()) {
// now check for template provided by plugins // now check for template provided by plugins
def pluginTemplateFiles = resolveResources("file:${pluginsHome}/*/src/${templatePath}/${type ?: lastType}.groovy") def possibleResources = pluginSettings.pluginDirectories.collect { dir ->
if (pluginTemplateFiles) { new FileSystemResource("${dir.path}/src/templates/artifacts/${type ?: lastType}.groovy")
templateFile = pluginTemplateFiles[0] }
} templateFile = possibleResources.find { it.exists() }
else { if (!templateFile) {
// template not found in application, use default template // template not found in application, use default template
templateFile = grailsResource("src/grails/${templatePath}/${type ?: lastType}.groovy") templateFile = grailsResource("src/grails/${templatePath}/${type ?: lastType}.groovy")
} }
Expand Down

2 comments on commit e5d0ca1

@Yuri-Loop
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@graemerocher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please raise a JIRA to track the issue

Please sign in to comment.