How can I get a list of all classes in a given package?
I tried this:
import scala.reflect.runtime.{currentMirror => cm}
val classes = cm.staticPackage("scala.collection.mutable").typeSignature.declarations
But it seems to give me an empty list.
At the moment, this is not possible, because the runtime reflection part of the Scala reflection API is based on classloaders, and they don't provide the functionality of enumerating contents of packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With