summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-06 22:15:37 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-06 22:42:21 -0800
commitbb4f2691f26f20dd8e6bdc1108eef9a83af0944e (patch)
treee81661dcfe7a9792fadca2269ec22f61bd1fbf2b
parentb97acb6f671502f57134932d0e7908e333b7cbbe (diff)
parent3eaa2a12bbe6ee4ecf6d8f839b60f2e000c4d1a1 (diff)
downloadmill-bb4f2691f26f20dd8e6bdc1108eef9a83af0944e.tar.gz
mill-bb4f2691f26f20dd8e6bdc1108eef9a83af0944e.tar.bz2
mill-bb4f2691f26f20dd8e6bdc1108eef9a83af0944e.zip
Merge branch 'master' of github.com:lihaoyi/mill
-rwxr-xr-xci/release.py11
-rw-r--r--core/src/mill/define/BaseModule.scala1
-rw-r--r--core/src/mill/main/MainRunner.scala1
-rw-r--r--core/src/mill/main/ReplApplyHandler.scala4
-rw-r--r--project/build.sbt4
-rw-r--r--scalalib/src/mill/scalalib/PublishModule.scala6
6 files changed, 15 insertions, 12 deletions
diff --git a/ci/release.py b/ci/release.py
index c59c6811..a385ba40 100755
--- a/ci/release.py
+++ b/ci/release.py
@@ -1,17 +1,20 @@
#!/usr/bin/env python
from subprocess import check_call
+import tempfile
import os, base64
check_call(["sbt", "bin/test:assembly"])
is_master_commit = (
- os.environ["TRAVIS_PULL_REQUEST"] == "false" &&
- (os.environ["TRAVIS_BRANCH"] == "master" || os.environ["TRAVIS_TAG"] != "")
+ os.environ["TRAVIS_PULL_REQUEST"] == "false" and
+ (os.environ["TRAVIS_BRANCH"] == "master" or os.environ["TRAVIS_TAG"] != "")
)
-with open("~/gpg.key", "w") as f:
+_, tmp = tempfile.mkstemp()
+
+with open(tmp, "w") as f:
f.write(base64.b64decode(os.environ["GPG_PRIVATE_KEY_B64"]))
-check_call(["gpg", "--import", "~/gpg.key"])
+check_call(["gpg", "--import", tmp])
check_call([
"target/bin/mill",
diff --git a/core/src/mill/define/BaseModule.scala b/core/src/mill/define/BaseModule.scala
index a449a6a0..ad138a0b 100644
--- a/core/src/mill/define/BaseModule.scala
+++ b/core/src/mill/define/BaseModule.scala
@@ -70,7 +70,6 @@ class TargetScopt[T, M <: BaseModule](rootModule: M, d: => Discover[M])
}
mill.main.Resolve.resolve(segments.value.toList, externalRootModule, d, Nil, crossSelectors.toList, Nil)
case (None, segments) =>
- rootModule.millInternal.segmentsToModules(segments).asInstanceOf[T]
val crossSelectors = segments.value.map {
case mill.define.Segment.Cross(x) => x.toList.map(_.toString)
case _ => Nil
diff --git a/core/src/mill/main/MainRunner.scala b/core/src/mill/main/MainRunner.scala
index e312aa7a..e3820e3d 100644
--- a/core/src/mill/main/MainRunner.scala
+++ b/core/src/mill/main/MainRunner.scala
@@ -99,7 +99,6 @@ class MainRunner(config: ammonite.main.Cli.Config,
| // even if it does nothing...
| def $$main() = Iterator[String]()
|
- | implicit def millScoptReads = new mill.main.ModuleScopt(this, millDiscover)
| implicit def millDiscover: mill.define.Discover[this.type] = mill.define.Discover[this.type]
| // Need to wrap the returned Module in Some(...) to make sure it
| // doesn't get picked up during reflective child-module discovery
diff --git a/core/src/mill/main/ReplApplyHandler.scala b/core/src/mill/main/ReplApplyHandler.scala
index 33013e2d..5a84c344 100644
--- a/core/src/mill/main/ReplApplyHandler.scala
+++ b/core/src/mill/main/ReplApplyHandler.scala
@@ -82,8 +82,8 @@ class ReplApplyHandler(pprinter0: pprint.PPrinter,
(if (m.millInternal.reflect[mill.Module].isEmpty) Nil
else
ctx.applyPrefixColor("\nChildren:").toString +:
- m.millInternal.reflect[mill.Module].map("\n ." + _.millOuterCtx.segments.render)) ++
- (evaluator.discover.value.get(m.getClass) match{
+ m.millInternal.reflect[mill.Module].map("\n ." + _.millOuterCtx.segment.pathSegments.mkString("."))) ++
+ (evaluator.discover.value.get(m.getClass) match{
case None => Nil
case Some(commands) =>
ctx.applyPrefixColor("\nCommands:").toString +: commands.map{c =>
diff --git a/project/build.sbt b/project/build.sbt
index 1741de9d..e97333bf 100644
--- a/project/build.sbt
+++ b/project/build.sbt
@@ -1 +1,3 @@
-addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3") \ No newline at end of file
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
+
+addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.1") \ No newline at end of file
diff --git a/scalalib/src/mill/scalalib/PublishModule.scala b/scalalib/src/mill/scalalib/PublishModule.scala
index aef8b456..30fbb4c5 100644
--- a/scalalib/src/mill/scalalib/PublishModule.scala
+++ b/scalalib/src/mill/scalalib/PublishModule.scala
@@ -88,10 +88,10 @@ trait PublishModule extends ScalaModule { outer =>
object PublishModule extends ExternalModule{
def publishAll(sonatypeCreds: String,
gpgPassphrase: String,
+ publishArtifacts: Seq[mill.T[(mill.scalalib.publish.Artifact, Seq[(PathRef, String)])]],
sonatypeUri: String = "https://oss.sonatype.org/service/local",
- sonatypeSnapshotUri: String = "https://oss.sonatype.org/content/repositories/snapshots",
- publishInfo: Seq[mill.T[(mill.scalalib.publish.Artifact, Seq[(PathRef, String)])]] = Nil) = T.command{
- val x: Seq[(Seq[(Path, String)], Artifact)] = Task.sequence(publishInfo)().map{
+ sonatypeSnapshotUri: String = "https://oss.sonatype.org/content/repositories/snapshots") = T.command{
+ val x: Seq[(Seq[(Path, String)], Artifact)] = Task.sequence(publishArtifacts)().map{
case (a, s) => (s.map{case (p, f) => (p.path, f)}, a)
}
new SonatypePublisher(