Skip to content

Instantly share code, notes, and snippets.

@vic
Created August 20, 2022 04:44
Show Gist options
  • Save vic/4efb12250d79c3545112cf7a330018cc to your computer and use it in GitHub Desktop.
Save vic/4efb12250d79c3545112cf7a330018cc to your computer and use it in GitHub Desktop.
import mill._
trait BuildrModule extends Module {
def logger = {
val colors = interp.colors()
new mill.util.PrintLogger(
colors != ammonite.util.Colors.BlackWhite,
false,
colors.info(),
colors.error(),
System.out,
System.err,
System.err,
System.in,
debugEnabled = true,
context = ""
)
}
def evaluator = {
mill.eval.Evaluator(
home,
pwd / "out",
pwd / "out",
rootModule = Buildr.millSelf.get,
baseLogger = logger
)
}
def loadBuildrRuntime: Unit = {
val eval = mill.eval.Evaluator.evalOrThrow(evaluator)
val paths = eval[Seq[PathRef]](buildr.runClasspath)
interp.load.cp(paths.map(_.path))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment