From fe8667d58aef03e8b97c1361495ab5d851deee60 Mon Sep 17 00:00:00 2001 From: Olivier Mélois Date: Mon, 8 Jul 2019 10:33:31 +0200 Subject: Interpolates $MILL_VERSION in ivy imports (#649) * Interpolates $MILL_VERSION in ivy imports This overrides the default $ivy magic import by replacing the `$MILL_VERSION` string with mill's version, in order to facilitate the loading/update of contrib modules. Ammonite had to be bumped to 1.6.9 * Removed bloop import * AmmoniteExit import fix * Removed repl dep check * Removed problematic check * Made ammonite version override-able --- build.sc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'build.sc') diff --git a/build.sc b/build.sc index b95d46ac..ed5415f8 100755 --- a/build.sc +++ b/build.sc @@ -92,14 +92,30 @@ object main extends MillModule { def ivyDeps = Agg( // Keep synchronized with ammonite in Versions.scala - ivy"com.lihaoyi:::ammonite:1.6.7", + ivy"com.lihaoyi:::ammonite:1.6.9", // Necessary so we can share the JNA classes throughout the build process ivy"net.java.dev.jna:jna:4.5.0", ivy"net.java.dev.jna:jna-platform:4.5.0" ) def generatedSources = T { - Seq(PathRef(shared.generateCoreSources(T.ctx().dest))) + val dest = T.ctx().dest + val version = publishVersion() + writeBuildInfo(dest, version) + shared.generateCoreSources(dest) + Seq(PathRef(dest)) + } + + def writeBuildInfo(dir : os.Path, version : String) = { + val code = s""" + |package mill + | + |object BuildInfo { + | val millVersion = "$version" + |} + """.stripMargin.trim + + os.write(dir / "BuildInfo.scala", code) } } -- cgit v1.2.3