aboutsummaryrefslogtreecommitdiff
path: root/stage2/PublishBuild.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-03-07 01:36:40 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2016-03-07 01:36:40 -0500
commite958dec0dbbcf7f7a28cd21641e76390fb3dba6a (patch)
treeec0933e230b0c3f222fceb82b3eec177d56ea979 /stage2/PublishBuild.scala
parentf0dc760df8757caea1d83b15142a3d0704488636 (diff)
downloadcbt-e958dec0dbbcf7f7a28cd21641e76390fb3dba6a.tar.gz
cbt-e958dec0dbbcf7f7a28cd21641e76390fb3dba6a.tar.bz2
cbt-e958dec0dbbcf7f7a28cd21641e76390fb3dba6a.zip
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
Diffstat (limited to 'stage2/PublishBuild.scala')
-rw-r--r--stage2/PublishBuild.scala41
1 files changed, 41 insertions, 0 deletions
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 )
+}