jdaugherty commented on code in PR #15269:
URL: https://github.com/apache/grails-core/pull/15269#discussion_r2581938010
##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy:
##########
@@ -27,18 +27,48 @@ import org.gradle.api.file.Directory
class GradleUtils {
static Directory findRootGrailsCoreDir(Project project) {
- def rootLayout = project.rootProject.layout
+ def rootLayout = project.layout
+
// .github / .git related directories are purged from source releases,
so use the .asf.yaml as an indicator of
// the parent directory
- if (rootLayout.projectDirectory.file('.asf.yaml').asFile.exists()) {
- return rootLayout.projectDirectory
+ findAsfRoot(rootLayout.projectDirectory)
+ }
+
+ static Directory findAsfRoot(Directory currentDirectory) {
+ def asfFile = currentDirectory.file('.asf.yaml').asFile
+ if (asfFile.exists()) {
+ return currentDirectory
}
- // we currently only nest 1 project level deep
- rootLayout.projectDirectory.dir('../')
+ findAsfRoot(currentDirectory.dir('../'))
}
Review Comment:
@matrei take a look at the modified version i pushed. I did most of your
changes, but I think it's still more clear to indicate the file name given that
the method is called findAsfRoot
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]