All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.mill-aliases_mill0.12.0-RC1_2.13.0.5.0.source-code.Utils.scala Maven / Gradle / Ivy

package com.carlosedp.aliases

import mill._
import mill.api.Result
import mill.resolve.{Resolve, SelectMode}

private object Utils {
    def taskResolver(ev: eval.Evaluator, tasks: Seq[String]): Result[List[String]] = {
        val resolved = Resolve.Segments.resolve(
            ev.rootModule,
            tasks,
            SelectMode.Multi,
        )

        resolved match {
            case Left(err) => Result.Failure(err)
            case Right(resolvedSegmentsList) =>
                val resolvedStrings = resolvedSegmentsList.map(_.render)
                // resolvedStrings.sorted.foreach(Console.out.println) // Print all resolved tasks
                Result.Success(resolvedStrings)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy