Permalink
Browse files

Update build: sbt 0.11.2, maven central publish config, gpg

  • Loading branch information...
havocp committed Apr 12, 2012
1 parent f0e4dfd commit db3a676c02a084dd4ecd64f483ee37be4e9fccaf
Showing with 75 additions and 18 deletions.
  1. +2 −2 build.sbt
  2. +6 −8 config/build.sbt
  3. +59 −3 project/Build.scala
  4. +1 −1 project/build.properties
  5. +7 −4 project/plugins.sbt
View
@@ -9,9 +9,9 @@
// Versions and git tags should follow: http://semver.org/
// except using -SNAPSHOT instead of without hyphen.
-version in GlobalScope := "0.3.0-SNAPSHOT"
+version in GlobalScope := "0.3.1-SNAPSHOT"
-organization in GlobalScope := "com.typesafe.config"
+organization in GlobalScope := "com.typesafe"
scalacOptions in GlobalScope in Compile := Seq("-unchecked", "-deprecation")
View
@@ -1,3 +1,4 @@
+import com.jsuereth.pgp.sbtplugin.PgpPlugin
import de.johoop.findbugs4sbt.FindBugs._
import de.johoop.findbugs4sbt.ReportType
import de.johoop.jacoco4sbt._
@@ -34,13 +35,10 @@ JavadocKeys.javadocOptions += "-exclude com.typesafe.config.impl"
doc in Compile <<= JavadocKeys.javadoc
-publishTo <<= (isSnapshot) { snapshot =>
- import Classpaths._
- val releases = "Maven releases" at "http://repo.typesafe.com/typesafe/maven-releases/"
- val snapshots = "Maven snapshots" at "http://repo.typesafe.com/typesafe/maven-snapshots/"
- Some(if (snapshot) snapshots else releases)
-}
+seq(PgpPlugin.configurationSettings : _*)
-publishMavenStyle := true
+seq(PgpPlugin.signingSettings : _*)
-credentials += Credentials(Path.userHome / ".ivy2" / ".typesafe-credentials")
+PgpPlugin.useGpg := true
+
+//PgpPlugin.useGpgAgent := true
View
@@ -13,8 +13,13 @@ object ConfigBuild extends Build {
publishLocal := {}
)
- // this is in newer sbt versions, for now cut-and-pasted
- val isSnapshot = SettingKey[Boolean]("is-snapshot", "True if the the version of the project is a snapshot version.")
+ object sonatype extends PublishToSonatype(ConfigBuild) {
+ def projectUrl = "https://github.com/typesafehub/config"
+ def developerId = "havocp"
+ def developerName = "Havoc Pennington"
+ def developerUrl = "http://ometer.com/"
+ def scmUrl = "git://github.com/typesafehub/config.git"
+ }
override val settings = super.settings ++ Seq(isSnapshot <<= isSnapshot or version(_ endsWith "-SNAPSHOT"))
@@ -23,7 +28,8 @@ object ConfigBuild extends Build {
settings = Project.defaultSettings ++ unpublished) aggregate(testLib, configLib, simpleLib, simpleApp)
lazy val configLib = Project(id = "config",
- base = file("config")) dependsOn(testLib % "test->test")
+ base = file("config"),
+ settings = Project.defaultSettings ++ sonatype.settings) dependsOn(testLib % "test->test")
lazy val testLib = Project(id = "test-lib",
base = file("test-lib"),
@@ -41,3 +47,53 @@ object ConfigBuild extends Build {
base = file("examples/complex-app"),
settings = Project.defaultSettings ++ unpublished) dependsOn(simpleLib)
}
+
+// from https://raw.github.com/paulp/scala-improving/master/project/PublishToSonatype.scala
+
+abstract class PublishToSonatype(build: Build) {
+ import build._
+
+ val ossSnapshots = "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
+ val ossStaging = "Sonatype OSS Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
+
+ def projectUrl: String
+ def developerId: String
+ def developerName: String
+ def developerUrl: String
+
+ def licenseName = "Apache License, Version 2.0"
+ def licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0"
+ def licenseDistribution = "repo"
+ def scmUrl: String
+ def scmConnection = "scm:git:" + scmUrl
+
+ def generatePomExtra(scalaVersion: String): xml.NodeSeq = {
+ <url>{ projectUrl }</url>
+ <licenses>
+ <license>
+ <name>{ licenseName }</name>
+ <url>{ licenseUrl }</url>
+ <distribution>{ licenseDistribution }</distribution>
+ </license>
+ </licenses>
+ <scm>
+ <url>{ scmUrl }</url>
+ <connection>{ scmConnection }</connection>
+ </scm>
+ <developers>
+ <developer>
+ <id>{ developerId }</id>
+ <name>{ developerName }</name>
+ <url>{ developerUrl }</url>
+ </developer>
+ </developers>
+ }
+
+ def settings: Seq[Setting[_]] = Seq(
+ publishMavenStyle := true,
+ publishTo <<= (isSnapshot) { (snapshot) => Some(if (snapshot) ossSnapshots else ossStaging) },
+ publishArtifact in Test := false,
+ pomIncludeRepository := (_ => false),
+ pomExtra <<= (scalaVersion)(generatePomExtra)
+ )
+}
View
@@ -1 +1 @@
-sbt.version=0.11.0
+sbt.version=0.11.2
View
@@ -1,8 +1,11 @@
-addSbtPlugin("de.johoop" % "findbugs4sbt" % "1.1.2")
+addSbtPlugin("de.johoop" % "findbugs4sbt" % "1.1.6")
libraryDependencies ++= Seq(
- "org.jacoco" % "org.jacoco.core" % "0.5.3.201107060350" artifacts(Artifact("org.jacoco.core", "jar", "jar")),
- "org.jacoco" % "org.jacoco.report" % "0.5.3.201107060350" artifacts(Artifact("org.jacoco.report", "jar", "jar")))
+ "org.jacoco" % "org.jacoco.core" % "0.5.6.201201232323" artifacts(Artifact("org.jacoco.core", "jar", "jar")),
+ "org.jacoco" % "org.jacoco.report" % "0.5.6.201201232323" artifacts(Artifact("org.jacoco.report", "jar", "jar")))
-addSbtPlugin("de.johoop" % "jacoco4sbt" % "1.2.0")
+addSbtPlugin("de.johoop" % "jacoco4sbt" % "1.2.2")
+resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
+
+addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")

0 comments on commit db3a676

Please sign in to comment.