Is there a way to parse all classes in a groovy script? In Parse ONE class right now:
java.lang.Class clazz = groovyClassLoader.parseClass(new File("MainApp.groovy"))
MainApp.groovy:
class MainApp {
def doIt() {}
}
class OtherMainApp {
def doTheRest() {}
}
This will return only MainApp.
I would like something like this:
java.lang.Class[] clazz = groovyClassLoader.parseClass(new File("MainApp.groovy"))
where clazz contains will contain both the MainApp class and the OtherMainApp class
Basically, I want to be able to retrieve all declared classes in a script.
Due to the nature of the application that I am creating the groovyc team will not help
Thank,
Federico
source
share