diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 23:09:41 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 23:48:13 -0800 |
commit | de7a273987a0ef2d6722e2a6cb61abac9d6713c3 (patch) | |
tree | 33b26c1580a6b4854cfeb504248cae4e7a038c32 /scalalib/src | |
parent | 94f1ecf85b792e789c65ed88fcca5360f5fce0fb (diff) | |
download | mill-de7a273987a0ef2d6722e2a6cb61abac9d6713c3.tar.gz mill-de7a273987a0ef2d6722e2a6cb61abac9d6713c3.tar.bz2 mill-de7a273987a0ef2d6722e2a6cb61abac9d6713c3.zip |
Properly include the base path of the publish-destination URLs0.0.7
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/mill/scalalib/publish/SonatypePublisher.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala index 1f00074c..1977d8aa 100644 --- a/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala +++ b/scalalib/src/mill/scalalib/publish/SonatypePublisher.scala @@ -21,12 +21,13 @@ class SonatypePublisher(uri: String, } def publishAll(artifacts: (Seq[(Path, String)], Artifact)*): Unit = { - val mappings = for ((fileMapping, artifact) <- artifacts) yield { + val mappings = for ((fileMapping0, artifact) <- artifacts) yield { val publishPath = Seq( artifact.group.replace(".", "/"), artifact.id, artifact.version ).mkString("/") + val fileMapping = fileMapping0.map{ case (file, name) => (file, publishPath+"/"+name) } val signedArtifacts = fileMapping ++ fileMapping.map { case (file, name) => poorMansSign(file, gpgPassphrase) -> s"$name.asc" @@ -44,12 +45,13 @@ class SonatypePublisher(uri: String, } } - val (snapshots, nonSnapshots) = mappings.partition(_._1.isSnapshot) + val (snapshots, releases) = mappings.partition(_._1.isSnapshot) if(snapshots.nonEmpty) { publishSnapshot(snapshots.flatMap(_._2), snapshots.map(_._1)) } - if(nonSnapshots.nonEmpty) { - publishRelease(nonSnapshots.flatMap(_._2), nonSnapshots.map(_._1)) + val releaseGroups = releases.groupBy(_._1.group) + for((group, groupReleases) <- releaseGroups){ + publishRelease(groupReleases.flatMap(_._2), group, releases.map(_._1)) } } @@ -66,10 +68,11 @@ class SonatypePublisher(uri: String, } private def publishRelease(payloads: Seq[(String, Array[Byte])], + stagingProfile: String, artifacts: Seq[Artifact]): Unit = { - val profileUri = api.getStagingProfileUri(artifacts.map(_.group).mkString("-")) + val profileUri = api.getStagingProfileUri(stagingProfile) val stagingRepoId = - api.createStagingRepo(profileUri, artifacts.map(_.group).mkString("-")) + api.createStagingRepo(profileUri, stagingProfile) val baseUri = s"$uri/staging/deployByRepositoryId/$stagingRepoId/" val publishResults = payloads.map { |