Search code examples
gradlegroovy

Is it possible to import Groovy into settings.gradle without having Groovy locally installed?


I have a settings.gradle in my project root as:

rootProject.name = 'root'                                                       
                                                                                
new File('.').eachFileRecurse FileType.FILES,  { file ->                        
                                                                                                        
    if (file.name.matches("build.gradle")) {                                    
        println "Dir name ${file.getParentFile().getName()}"             
    }                                                                           
}

Script is used to list all directory names (last child) where build.gradle is found. However this script doesn't work without an import groovy.io.FileType.

Any ideas to have that Groovy import included, without having it locally installed, into settings.gradle ?


Solution

  • Bro, Groovy is a part of Gradle by default, put that import statement back where it should be and everything is good, no worries.

    If you don't trust me, delete your locally installed Groovy and check it out :)