Skip to content

Commit

Permalink
?? resolve workers too
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Sep 18, 2024
1 parent b5e04d6 commit 0c7792e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions main/resolve/src/mill/resolve/Resolve.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ object Resolve {
items.distinctBy(_.ctx.segments)
}

private def instantiateTarget(r: Resolved.Target, p: Module): Either[String, Target[_]] = {
private def instantiateTarget(r: Resolved.Target, p: Module): Either[String, NamedTask[_]] = {
val definition = Reflect
.reflect(p.getClass, classOf[Target[_]], _ == r.segments.parts.last, true)
.reflect(p.getClass, classOf[NamedTask[_]], _ == r.segments.parts.last, true)
.head

ResolveCore.catchWrapException(
definition.invoke(p).asInstanceOf[Target[_]]
definition.invoke(p).asInstanceOf[NamedTask[_]]
)
}

Expand Down
6 changes: 3 additions & 3 deletions main/resolve/src/mill/resolve/ResolveCore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ private object ResolveCore {
}
}

val targets = Reflect
.reflect(cls, classOf[Target[_]], namePred, noParams = true)
val namedTasks = Reflect
.reflect(cls, classOf[NamedTask[_]], namePred, noParams = true)
.map { m =>
Resolved.Target(Segments.labels(decode(m.getName))) ->
None
Expand All @@ -388,7 +388,7 @@ private object ResolveCore {
.map(m => decode(m.getName))
.map { name => Resolved.Command(Segments.labels(name)) -> None }

modulesOrErr.map(_ ++ targets ++ commands)
modulesOrErr.map(_ ++ namedTasks ++ commands)
}

def notFoundResult(
Expand Down

0 comments on commit 0c7792e

Please sign in to comment.