3

How do I access all the packages and classes under a given package using scala runtime reflection.

Lets say:

src
 - main
   - scala
    - com.my.package
     - packageone
        - packagetwo
           - First.scala
           - Second.scala

I have access to the package "com.my.package",

val p: universe.ModuleSymbol = scala.reflect.runtime.currentMirror.staticPackage("com.my.package")

Can I use this ModuleSymbol to iterate through the underlying packages and objects? Or is this even the correct starting point?

Appreciate any/all your inputs.

irrelevantUser
  • 1,172
  • 18
  • 35

0 Answers0