From 3ed172ea5909499ded54b49d9a9c82ce9c35943f Mon Sep 17 00:00:00 2001 From: Patrick Wendell Date: Fri, 5 Oct 2012 20:59:31 -0700 Subject: Adding code for publishing to Sonatype. By default - I'm leaving this commented out. This is because there is a bug in the PGP signing plugin which causes it to active even duing a publish-local. So we'll just uncomment when we decide to publish. --- project/SparkBuild.scala | 56 +++++++++++++++++++++++++++++++++++++++++++++--- project/plugins.sbt | 4 ++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 4184008506..91e39f19f6 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -4,13 +4,15 @@ import Keys._ import sbtassembly.Plugin._ import AssemblyKeys._ import twirl.sbt.TwirlPlugin._ +// For Sonatype publishing +// import com.jsuereth.pgp.sbtplugin.PgpKeys._ object SparkBuild extends Build { // Hadoop version to build against. For example, "0.20.2", "0.20.205.0", or // "1.0.1" for Apache releases, or "0.20.2-cdh3u3" for Cloudera Hadoop. val HADOOP_VERSION = "0.20.205.0" - lazy val root = Project("root", file("."), settings = sharedSettings) aggregate(core, repl, examples, bagel) + lazy val root = Project("root", file("."), settings = rootSettings) aggregate(core, repl, examples, bagel) lazy val core = Project("core", file("core"), settings = coreSettings) @@ -33,7 +35,51 @@ object SparkBuild extends Build { retrieveManaged := true, transitiveClassifiers in Scope.GlobalScope := Seq("sources"), testListeners <<= target.map(t => Seq(new eu.henkelmann.sbt.JUnitXmlTestsListener(t.getAbsolutePath))), - publishTo <<= baseDirectory { base => Some(Resolver.file("Local", base / "target" / "maven" asFile)(Patterns(true, Resolver.mavenStyleBasePattern))) }, + + /* For Sonatype publishing + resolvers ++= Seq("sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", + "sonatype-staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2/"), + + publishMavenStyle := true, + + useGpg in Global := true, + + pomExtra := ( + http://spark-project.org/ + + + BSD License + https://github.com/mesos/spark/blob/master/LICENSE + repo + + + + scm:git:git@github.com:mesos/spark.git + scm:git:git@github.com:mesos/spark.git + + + + matei + Matei Zaharia + matei.zaharia@gmail.com + http://www.cs.berkeley.edu/~matei + U.C. Berkeley Computer Science + http://www.cs.berkeley.edu/ + + + ), + + publishTo <<= version { (v: String) => + val nexus = "https://oss.sonatype.org/" + if (v.trim.endsWith("SNAPSHOT")) + Some("sonatype-snapshots" at nexus + "content/repositories/snapshots") + else + Some("sonatype-staging" at nexus + "service/local/staging/deploy/maven2") + }, + + credentials += Credentials(Path.userHome / ".sbt" / "sonatype.credentials"), + */ + libraryDependencies ++= Seq( "org.eclipse.jetty" % "jetty-server" % "7.5.3.v20111011", "org.scalatest" %% "scalatest" % "1.6.1" % "test", @@ -64,6 +110,7 @@ object SparkBuild extends Build { "Spray Repository" at "http://repo.spray.cc/", "Cloudera Repository" at "http://repository.cloudera.com/artifactory/cloudera-repos/" ), + libraryDependencies ++= Seq( "com.google.guava" % "guava" % "11.0.1", "log4j" % "log4j" % "1.2.16", @@ -85,6 +132,10 @@ object SparkBuild extends Build { ) ) ++ assemblySettings ++ extraAssemblySettings ++ Twirl.settings + def rootSettings = sharedSettings ++ Seq( + publish := {} + ) + def replSettings = sharedSettings ++ Seq( name := "spark-repl", libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _) @@ -103,5 +154,4 @@ object SparkBuild extends Build { case _ => MergeStrategy.first } ) - } diff --git a/project/plugins.sbt b/project/plugins.sbt index 896fa4834f..36497f8eda 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,3 +11,7 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1") addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0") addSbtPlugin("cc.spray" %% "sbt-twirl" % "0.5.2") + +// For Sonatype publishing +// 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") -- cgit v1.2.3 From 6d328f54d06a92ffa44f0eb00544e9470107be13 Mon Sep 17 00:00:00 2001 From: Patrick Wendell Date: Wed, 10 Oct 2012 18:54:22 -0700 Subject: Changing tabs to spaces --- project/SparkBuild.scala | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 91e39f19f6..5aefdd2eed 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -47,34 +47,34 @@ object SparkBuild extends Build { pomExtra := ( http://spark-project.org/ - - BSD License - https://github.com/mesos/spark/blob/master/LICENSE - repo - + + BSD License + https://github.com/mesos/spark/blob/master/LICENSE + repo + - scm:git:git@github.com:mesos/spark.git - scm:git:git@github.com:mesos/spark.git + scm:git:git@github.com:mesos/spark.git + scm:git:git@github.com:mesos/spark.git - - matei - Matei Zaharia - matei.zaharia@gmail.com - http://www.cs.berkeley.edu/~matei - U.C. Berkeley Computer Science - http://www.cs.berkeley.edu/ - + + matei + Matei Zaharia + matei.zaharia@gmail.com + http://www.cs.berkeley.edu/~matei + U.C. Berkeley Computer Science + http://www.cs.berkeley.edu/ + ), publishTo <<= version { (v: String) => val nexus = "https://oss.sonatype.org/" if (v.trim.endsWith("SNAPSHOT")) - Some("sonatype-snapshots" at nexus + "content/repositories/snapshots") + Some("sonatype-snapshots" at nexus + "content/repositories/snapshots") else - Some("sonatype-staging" at nexus + "service/local/staging/deploy/maven2") + Some("sonatype-staging" at nexus + "service/local/staging/deploy/maven2") }, credentials += Credentials(Path.userHome / ".sbt" / "sonatype.credentials"), -- cgit v1.2.3