diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 03:00:04 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 21:14:58 +0800 |
commit | bc9dc386625021fec517f2dbf0644ccafe1e32c2 (patch) | |
tree | 12db6817470708c7aa274aa231ef35eb79f2123a /scalalib/src/mill/scalalib/publish/SonatypePublisher.scala | |
parent | 8afe79afe33be68f59f89b8410984e508c3e8d08 (diff) | |
download | mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.gz mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.bz2 mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.zip |
WIP migrating over from `ammonite.ops` to `os` module.
__.compile works, haven't run tests yet
Diffstat (limited to 'scalalib/src/mill/scalalib/publish/SonatypePublisher.scala')
-rw-r--r-- | scalalib/src/mill/scalalib/publish/SonatypePublisher.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala index 47ec8dbf..5e596618 100644 --- a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala +++ b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala @@ -3,7 +3,6 @@ package mill.scalalib.publish import java.math.BigInteger import java.security.MessageDigest -import ammonite.ops._ import mill.util.Logger import scalaj.http.HttpResponse @@ -17,10 +16,10 @@ class SonatypePublisher(uri: String, private val api = new SonatypeHttpApi(uri, credentials) - def publish(fileMapping: Seq[(Path, String)], artifact: Artifact, release: Boolean): Unit = { + def publish(fileMapping: Seq[(os.Path, String)], artifact: Artifact, release: Boolean): Unit = { publishAll(release, fileMapping -> artifact) } - def publishAll(release: Boolean, artifacts: (Seq[(Path, String)], Artifact)*): Unit = { + def publishAll(release: Boolean, artifacts: (Seq[(os.Path, String)], Artifact)*): Unit = { val mappings = for ((fileMapping0, artifact) <- artifacts) yield { val publishPath = Seq( @@ -36,7 +35,7 @@ class SonatypePublisher(uri: String, artifact -> (fileMapping ++ signedArtifacts).flatMap { case (file, name) => - val content = read.bytes(file) + val content = os.read.bytes(file) Seq( name -> content, @@ -136,16 +135,17 @@ class SonatypePublisher(uri: String, } // http://central.sonatype.org/pages/working-with-pgp-signatures.html#signing-a-file - private def poorMansSign(file: Path, maybePassphrase: Option[String]): Path = { + private def poorMansSign(file: os.Path, maybePassphrase: Option[String]): os.Path = { val fileName = file.toString - import ammonite.ops.ImplicitWd._ maybePassphrase match { case Some(passphrase) => - %("gpg", "--passphrase", passphrase, "--batch", "--yes", "-a", "-b", fileName) + os.proc("gpg", "--passphrase", passphrase, "--batch", "--yes", "-a", "-b", fileName) + .call(stdin = os.Inherit, stdout = os.Inherit, stderr = os.Inherit) case None => - %("gpg", "--batch", "--yes", "-a", "-b", fileName) + os.proc("gpg", "--batch", "--yes", "-a", "-b", fileName) + .call(stdin = os.Inherit, stdout = os.Inherit, stderr = os.Inherit) } - Path(fileName + ".asc") + os.Path(fileName + ".asc") } private def md5hex(bytes: Array[Byte]): Array[Byte] = |