From 62ef3946cee084f6fbf4778b1fdbd0270cee6411 Mon Sep 17 00:00:00 2001 From: Scott Murphy Date: Sun, 1 Oct 2023 22:37:02 -0500 Subject: [PATCH] Don't throw exception if grails-app folder does not exist. Fixes #226 --- .../grails/gradle/plugin/core/GrailsGradlePlugin.groovy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index 4738aed4..dcc609fa 100644 --- a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -354,9 +354,12 @@ class GrailsGradlePlugin extends GroovyPlugin { @CompileStatic protected List resolveGrailsSourceDirs(Project project) { List grailsSourceDirs = [] - project.file("grails-app").eachDir { File subdir -> - if (isGrailsSourceDirectory(subdir)) { - grailsSourceDirs.add(subdir) + File grailsApp = project.file("grails-app") + if (grailsApp.exists()) { + grailsApp.eachDir { File subdir -> + if (isGrailsSourceDirectory(subdir)) { + grailsSourceDirs.add(subdir) + } } } grailsSourceDirs.add(project.file("src/main/groovy"))