summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Roeser <le.petit.fou@web.de>2019-09-06 14:57:01 +0200
committerGitHub <noreply@github.com>2019-09-06 14:57:01 +0200
commit99ec26d34c2efa4f1199e0d2a15be05ea537bb89 (patch)
tree4ee47f4b79b3bcd5a117f3e3167e8412da673337
parent6f1cdf1ca41984b3af7ab96a673830c236f35c44 (diff)
downloadmill-99ec26d34c2efa4f1199e0d2a15be05ea537bb89.tar.gz
mill-99ec26d34c2efa4f1199e0d2a15be05ea537bb89.tar.bz2
mill-99ec26d34c2efa4f1199e0d2a15be05ea537bb89.zip
Generate Versions file (#688)
-rwxr-xr-xbuild.sc28
-rw-r--r--scalalib/src/Versions.scala8
2 files changed, 23 insertions, 13 deletions
diff --git a/build.sc b/build.sc
index 02f06b07..abf9b9b7 100755
--- a/build.sc
+++ b/build.sc
@@ -82,7 +82,7 @@ trait MillApiModule extends MillPublishModule with ScalaModule{
MavenRepository("https://oss.sonatype.org/content/repositories/releases")
)
}
-trait MillModule extends MillApiModule{ outer =>
+trait MillModule extends MillApiModule { outer =>
def scalacPluginClasspath =
super.scalacPluginClasspath() ++ Seq(main.moduledefs.jar())
@@ -138,7 +138,6 @@ object main extends MillModule {
)
def ivyDeps = Agg(
- // Keep synchronized with ammonite in Versions.scala
Deps.ammonite,
// Necessary so we can share the JNA classes throughout the build process
Deps.jna,
@@ -211,6 +210,26 @@ object scalalib extends MillModule {
m.runClasspath()
}
+ override def generatedSources = T{
+ val dest = T.ctx().dest
+ os.write(dest / "Versions.scala",
+ s"""package mill.scalalib
+ |
+ |/**
+ | * Dependency versions.
+ | * Generated from mill in build.sc.
+ | */
+ |object Versions {
+ | /** Version of Ammonite. */
+ | val ammonite = "${Deps.ammonite.dep.version}"
+ | /** Version of Zinc. */
+ | val zinc = "${Deps.zinc.dep.version}"
+ |}
+ |
+ |""".stripMargin)
+ super.generatedSources() ++ Seq(PathRef(dest))
+ }
+
def testArgs = T{
val genIdeaArgs =
genTask(main.moduledefs)() ++
@@ -238,7 +257,7 @@ object scalalib extends MillModule {
)
}
}
- object api extends MillApiModule{
+ object api extends MillApiModule {
def moduleDeps = Seq(main.api)
}
object worker extends MillApiModule{
@@ -246,7 +265,6 @@ object scalalib extends MillModule {
def moduleDeps = Seq(scalalib.api)
def ivyDeps = Agg(
- // Keep synchronized with zinc in Versions.scala
Deps.zinc
)
def testArgs = T{Seq(
@@ -481,7 +499,7 @@ def testRepos = T{
)
}
-object integration extends MillModule{
+object integration extends MillModule {
def moduleDeps = Seq(main.moduledefs, scalalib, scalajslib, scalanativelib)
def testArgs = T{
scalajslib.testArgs() ++
diff --git a/scalalib/src/Versions.scala b/scalalib/src/Versions.scala
deleted file mode 100644
index 3fddd545..00000000
--- a/scalalib/src/Versions.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-package mill.scalalib
-
-object Versions {
- // Keep synchronized with ammonite dependency in core in build.sc
- val ammonite = "1.6.9"
- // Keep synchronized with zinc dependency in scalalib.worker in build.sc
- val zinc = "1.2.5"
-}