Discover

mill.define.Discover
See theDiscover companion object
@Scaladoc(value = "/**\n * Macro to walk the module tree and generate `mainargs` entrypoints for any\n * `Task.Command` methods that it finds.\n *\n * Note that unlike the rest of Mill\'s module-handling logic which uses Java\n * reflection, generation of entrypoints requires typeclass resolution, and so\n * needs to be done at compile time. Thus, we walk the entire module tree,\n * collecting all the module `Class[_]`s we can find, and for each one generate\n * the `mainargs.MainData` containing metadata and resolved typeclasses for all\n * the `Task.Command` methods we find. This mapping from `Class[_]` to `MainData`\n * can then be used later to look up the `MainData` for any module.\n */")
class Discover(val classInfo: Map[Class[_], ClassInfo])

Macro to walk the module tree and generate mainargs entrypoints for any Task.Command methods that it finds.

Note that unlike the rest of Mill's module-handling logic which uses Java reflection, generation of entrypoints requires typeclass resolution, and so needs to be done at compile time. Thus, we walk the entire module tree, collecting all the module Class[_]s we can find, and for each one generate the mainargs.MainData containing metadata and resolved typeclasses for all the Task.Command methods we find. This mapping from Class[_] to MainData can then be used later to look up the MainData for any module.

Attributes

Companion
object
Source
Discover.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def resolveEntrypoint(cls: Class[_], name: String): Option[MainData[_, _]]

Attributes

Source
Discover.scala

Concrete fields

val classInfo: Map[Class[_], ClassInfo]

Attributes

Source
Discover.scala