.mill-aliases_mill0.10_2.13.0.5.0.source-code.AliasRunner.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mill-aliases_mill0.10_2.13 Show documentation
Show all versions of mill-aliases_mill0.10_2.13 Show documentation
A Mill plugin to allow the creation of aliases to common-use tasks.
The newest version!
package com.carlosedp.aliases
import com.carlosedp.aliases.Discover._
import mill._
import mill.api.Result
import mill.api.Result.{Aborted, Failure, Skipped, Success}
import mill.define.ExternalModule
import mill.util.Watched
private[aliases] object AliasRunner extends ExternalModule {
lazy val millDiscover: mill.define.Discover[this.type] =
mill.define.Discover[this.type]
def aliasRunner(ev: eval.Evaluator, aliases: Seq[String]): Result[Watched[Unit]] =
mill.main.MainModule.evaluateTasks(
ev,
aliases,
mill.define.SelectMode.Separated,
)(identity) match {
case Aborted => Result.Failure("Aborted")
case Result.Exception(throwable, outerStack) => Result.Exception(throwable, outerStack)
case Failure(msg, value) => Result.Failure(msg, value)
case Skipped => Result.Skipped
case Success(value) => Result.Success(value)
}
}