summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorNikolay Tatarinov <5min4eq.unity@gmail.com>2017-12-25 05:31:40 +0300
committerLi Haoyi <haoyi.sg@gmail.com>2017-12-24 18:31:40 -0800
commit048fe23d116793039e7d245edd4afdcc3bdd3cc2 (patch)
treec688d23775e3828e1645e1fc42df5b701070a832 /build.sc
parenta0d16d40156f639090235f67117fe11ce0dbb5e9 (diff)
downloadmill-048fe23d116793039e7d245edd4afdcc3bdd3cc2.tar.gz
mill-048fe23d116793039e7d245edd4afdcc3bdd3cc2.tar.bz2
mill-048fe23d116793039e7d245edd4afdcc3bdd3cc2.zip
prepare mill-bridges to be published to maven central (#78)
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc26
1 files changed, 16 insertions, 10 deletions
diff --git a/build.sc b/build.sc
index 9ed794ac..cf792507 100755
--- a/build.sc
+++ b/build.sc
@@ -5,8 +5,6 @@ import mill.scalaplugin._, publish._
import mill.modules.Jvm.createAssembly
trait MillPublishModule extends PublishModule {
- def publishVersion = "0.0.1"
-
def publishWithFullScalaVersion = true
def pomSettings = PomSettings(
@@ -54,11 +52,9 @@ trait MillModule extends SbtScalaModule{ outer =>
}
}
-object Core extends MillModule with MillPublishModule {
+object Core extends MillModule {
def projectDeps = Seq(CompilerPlugin)
- def publishName = "mill-core"
-
def compileIvyDeps = Seq(
Dep.Java("org.scala-lang", "scala-reflect", scalaVersion())
)
@@ -92,9 +88,17 @@ object Core extends MillModule with MillPublishModule {
val bridgeVersions = Seq("2.10.6", "2.11.8", "2.11.11", "2.12.3", "2.12.4")
-val bridges = for(crossVersion <- mill.define.Cross(bridgeVersions:_*)) yield new ScalaModule{
+val bridges = for(crossVersion <- mill.define.Cross(bridgeVersions:_*)) yield new MillPublishModule {
+ def publishName = "mill-bridge"
+ def publishVersion = "0.1"
+
def basePath = pwd / 'bridge
def scalaVersion = crossVersion
+ def sources = T.source {
+ val path = basePath / 'src
+ mkdir(path)
+ path
+ }
def allSources = T{
val v = crossVersion.split('.').dropRight(1).mkString(".")
@@ -117,9 +121,7 @@ val bridges = for(crossVersion <- mill.define.Cross(bridgeVersions:_*)) yield ne
)
}
-object ScalaPlugin extends MillModule with MillPublishModule {
- def publishName = "mill-scala"
-
+object ScalaPlugin extends MillModule {
def projectDeps = Seq(Core)
def basePath = pwd / 'scalaplugin
@@ -141,6 +143,10 @@ val assemblyProjects = Seq(ScalaPlugin)
def assemblyClasspath = mill.define.Task.traverse(assemblyProjects)(_.assemblyClasspath)
+def publishBridges(credentials: String, gpgPassphrase: String) = T.command {
+ mill.define.Task.traverse(bridges.items)(_._2.publish(credentials, gpgPassphrase))
+}
+
def assemblyBase(classpath: Seq[Path], extraArgs: String)
(implicit ctx: mill.util.Ctx.DestCtx) = {
createAssembly(
@@ -151,7 +157,7 @@ def assemblyBase(classpath: Seq[Path], extraArgs: String)
)
}
-def assembly = T{
+def devAssembly = T{
assemblyBase(assemblyClasspath().flatten, ScalaPlugin.testArgs().mkString(" "))
}