Skip to content

How to run __.<task> from build.mill #5360

Answered by lefou
eikek asked this question in Q&A
Discussion options

You must be logged in to vote

If you already have a handle to all modules, using Task.traverse should be enough to get these tasks handled as prerequisites, and executed if not up-to-date.

def myTestModules: Seq[TestModule]

def ci() = Task.Command {
  // run __.test
  Task.traverse(myTestModules)(_.testForked())()
}

If you don't have the modules, you can use an evaluator command to find these modules. (Please note, that this API will slightly change in Mill 1.0.)

import mill.eval.{Evaluator, Terminal}
import mill.resolve.{Resolve, SelectMode}

def ci(evaluator: Evaluator) = Task.Command {
  Resolve.Tasks.resolve(
    evaluator.rootModule,
    Seq("__.testForked"),
    SelectMode.Separated
  ) match {
    case Left(err) 

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by eikek
Comment options

You must be logged in to vote
8 replies
@lefou
Comment options

@eikek
Comment options

@eikek
Comment options

@lefou
Comment options

@eikek
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants