diff options
author | Olivier Mélois <baccata64@gmail.com> | 2019-07-08 10:33:31 +0200 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-07-08 10:33:31 +0200 |
commit | fe8667d58aef03e8b97c1361495ab5d851deee60 (patch) | |
tree | a652df66b0d873f0635b2f6a55122195e9412a3a /build.sc | |
parent | 83aa7de17bf175ce64869f70c54de3882e047a1f (diff) | |
download | mill-fe8667d58aef03e8b97c1361495ab5d851deee60.tar.gz mill-fe8667d58aef03e8b97c1361495ab5d851deee60.tar.bz2 mill-fe8667d58aef03e8b97c1361495ab5d851deee60.zip |
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
Diffstat (limited to 'build.sc')
-rwxr-xr-x | build.sc | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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) } } |