diff options
author | Nikolay Tatarinov <rockjam@actor.im> | 2016-10-03 20:19:27 +0300 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-10-03 13:19:27 -0400 |
commit | 669ef3dfc3201fffa451b47d2b629a856afc0b25 (patch) | |
tree | 7bcb64c58266a4fe2dd3965dda47dc6f8fa71b04 /stage2/Publish.scala | |
parent | 174c52b2c24b8491eef687ee5eb3c3b77c34a61c (diff) | |
download | cbt-669ef3dfc3201fffa451b47d2b629a856afc0b25.tar.gz cbt-669ef3dfc3201fffa451b47d2b629a856afc0b25.tar.bz2 cbt-669ef3dfc3201fffa451b47d2b629a856afc0b25.zip |
Sonatype release plugin (#247)
Diffstat (limited to 'stage2/Publish.scala')
-rw-r--r-- | stage2/Publish.scala | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/stage2/Publish.scala b/stage2/Publish.scala index 96e856b..7e00620 100644 --- a/stage2/Publish.scala +++ b/stage2/Publish.scala @@ -35,37 +35,15 @@ trait Publish extends PackageJars{ ) // ========== publish ========== - final protected val releaseFolder = s"/${groupId.replace(".","/")}/${artifactId}_$scalaMajorVersion/$version/" - private def snapshotUrl = new URL("https://oss.sonatype.org/content/repositories/snapshots") - private def releaseUrl = new URL("https://oss.sonatype.org/service/local/staging/deploy/maven2") - def publishUrl = if(version.endsWith("-SNAPSHOT")) snapshotUrl else releaseUrl - override def copy(context: Context) = super.copy(context).asInstanceOf[Publish] - - protected def sonatypeCredentials: Option[String] = { - // FIXME: this should probably not use cbtHome, but some reference to the system's host cbt - Some(new String(readAllBytes((context.cbtRootHome ++ "/sonatype.login").toPath)).trim) - } - - def publishSnapshot: Unit = { - copy( context.copy(version = Some(version+"-SNAPSHOT")) ).publishUnsigned - } + private val releaseFolder = s"/${groupId.replace(".","/")}/${artifactId}_$scalaMajorVersion/$version/" - def publishLocal: Unit = { + def publishLocal: Unit = lib.publishLocal( sourceFiles, `package` :+ pom, context.paths.mavenCache, releaseFolder ) - } - def publishSnapshotLocal: Unit = { + def publishSnapshotLocal: Unit = copy( context.copy(version = Some(version+"-SNAPSHOT")) ).publishLocal - } - def publishUnsigned: Unit = { - lib.publishUnsigned( - sourceFiles, `package` :+ pom, publishUrl ++ releaseFolder, sonatypeCredentials - ) - } - def publishSigned: Unit = { - lib.publishSigned( - sourceFiles, `package` :+ pom, publishUrl ++ releaseFolder, sonatypeCredentials - ) - } + def isSnapshot: Boolean = version.endsWith("-SNAPSHOT") + + override def copy(context: Context) = super.copy(context).asInstanceOf[Publish] } |