Created
August 20, 2022 04:44
-
-
Save vic/4efb12250d79c3545112cf7a330018cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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