From e958dec0dbbcf7f7a28cd21641e76390fb3dba6a Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Mon, 7 Mar 2016 01:36:40 -0500 Subject: cleanup: whitespace changes, separated more things into their own files, use ++ for strings everywhere. Added ++ method to File and URL and use it in many places --- stage2/PublishBuild.scala | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 stage2/PublishBuild.scala (limited to 'stage2/PublishBuild.scala') diff --git a/stage2/PublishBuild.scala b/stage2/PublishBuild.scala new file mode 100644 index 0000000..e4e8fd7 --- /dev/null +++ b/stage2/PublishBuild.scala @@ -0,0 +1,41 @@ +package cbt +import java.io.File +import java.net.URL +import scala.collection.immutable.Seq + +abstract class PublishBuild(context: Context) extends PackageBuild(context){ + def name = artifactId + def description: String + def url: URL + def developers: Seq[Developer] + def licenses: Seq[License] + def scmUrl: String + def scmConnection: String + def pomExtra: Seq[scala.xml.Node] = Seq() + + // ========== package ========== + + /** put additional xml that should go into the POM file in here */ + def pom: File = lib.pom( + groupId = groupId, + artifactId = artifactId, + version = version, + name = name, + description = description, + url = url, + developers = developers, + licenses = licenses, + scmUrl = scmUrl, + scmConnection = scmConnection, + dependencies = dependencies, + pomExtra = pomExtra, + jarTarget = jarTarget + ) + + // ========== publish ========== + final protected def releaseFolder = s"/${groupId.replace(".","/")}/$artifactId/$version/" + def snapshotUrl = new URL("https://oss.sonatype.org/content/repositories/snapshots") + def releaseUrl = new URL("https://oss.sonatype.org/service/local/staging/deploy/maven2") + def publishSnapshot: Unit = lib.publishSnapshot(sourceFiles, pom +: `package`, snapshotUrl ++ releaseFolder ) + def publishSigned: Unit = lib.publishSigned(sourceFiles, pom +: `package`, releaseUrl ++ releaseFolder ) +} -- cgit v1.2.3