Skip to content

Commit 841b394

Browse files
committed
Include travis build number in sonatype repository description
1 parent 7735d16 commit 841b394

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/scala/ScalaModulePlugin.scala

+7-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ object ScalaModulePlugin extends AutoPlugin {
4141
sonatypeProfileName := "org.scala-lang",
4242

4343
// The staging repository name. The default is `[sbt-sonatype] name version`. We include the
44-
// Scala/Scala.js/Scala Native versions to avoid conflicts when running the travis jobs.
44+
// Scala/Scala.js/Scala Native versions and the travis job number to avoid conflicts when
45+
// running the travis jobs. Example: collection-compat has a two 2.12.x jobs, one for the
46+
// compat library, one for the migration rules, and both were writing to the same staging repo.
4547
sonatypeSessionName := {
46-
val sjs = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).map(v => s" Scala.js $v").getOrElse("")
47-
val native = Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).map(v => s" Scala Native $v").getOrElse("")
48-
s"${sonatypeSessionName.value} Scala ${scalaVersion.value}$sjs$native"
48+
val sjs = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).map(v => s" (js $v)").getOrElse("")
49+
val native = Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).map(v => s" (native $v)").getOrElse("")
50+
val jobNr = Option(System.getenv("TRAVIS_JOB_NUMBER")).filter(_.nonEmpty).map(v => s" (travis #$v)").getOrElse("")
51+
s"${sonatypeSessionName.value} Scala ${scalaVersion.value}$sjs$native$jobNr"
4952
},
5053
)
5154

0 commit comments

Comments
 (0)