Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move stuff around to more sane locations
o Remove amount of config needed in build.sbt
o Move publishing stuff to separate publish.sbt
o Move source to default positions
o 2.11 build
  • Loading branch information
hamnis committed Oct 16, 2014
1 parent 19185ee commit d14beeb
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 73 deletions.
73 changes: 3 additions & 70 deletions build.sbt
@@ -1,81 +1,14 @@
import sbtrelease.ReleasePlugin._

name := "scala-storm"

scalaVersion := "2.10.4"
scalaVersion := "2.11.2"

crossScalaVersions := Seq("2.9.2", "2.10.4")
crossScalaVersions := Seq("2.10.4", "2.11.2")

organization := "com.github.velvia"

// sbt defaults to <project>/src/test/{scala,java} unless we put this in
unmanagedSourceDirectories in Test <<= Seq( baseDirectory( _ / "test" ) ).join

unmanagedSourceDirectories in Compile <<= Seq( baseDirectory( _ / "src" ) ).join

resolvers ++= Seq("clojars" at "http://clojars.org/repo/",
"clojure-releases" at "http://build.clojure.org/releases")

libraryDependencies += "org.apache.storm" % "storm-core" % "0.9.2-incubating" % "provided" exclude("junit", "junit")

// This is to prevent error [java.lang.OutOfMemoryError: PermGen space]
javaOptions += "-XX:MaxPermSize=1g"

javaOptions += "-Xmx2g"

scalacOptions += "-Yresolve-term-conflict:package"

scalacOptions ++= {
if (scalaVersion.value.startsWith("2.10")) {
Seq("-feature", "-language:implicitConversions")
} else {
Seq()
}
}
scalacOptions ++= Seq("-feature", "-deprecation", "-Yresolve-term-conflict:package")

// When doing sbt run, fork a separate process. This is apparently needed by storm.
fork := true

// set Ivy logging to be at the highest level - for debugging
ivyLoggingLevel := UpdateLogging.Full

// Aagin this may be useful for debugging
logLevel := Level.Info

//************ Publishing info *********
publishMavenStyle := true

publishTo <<= version { (v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

publishArtifact in Test := false

pomIncludeRepository := { _ => false }

pomExtra := (
<url>https://github.com/velvia/ScalaStorm</url>
<licenses>
<license>
<name>Apache</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:velvia/ScalaStorm.git</url>
<connection>scm:git:git@github.com:velvia/ScalaStorm.git</connection>
</scm>
<developers>
<developer>
<id>velvia</id>
<name>Evan Chan</name>
<url>http://github.com/velvia</url>
</developer>
</developers>)

seq(releaseSettings: _*)
32 changes: 32 additions & 0 deletions publish.sbt
@@ -0,0 +1,32 @@
publishMavenStyle := true

publishTo <<= version { (v: String) =>
if (v.trim.endsWith("SNAPSHOT")) Some(Opts.resolver.sonatypeSnapshots) else Some(Opts.resolver.sonatypeStaging)
}

publishArtifact in Test := false

pomIncludeRepository := { _ => false }

pomExtra := (
<url>https://github.com/velvia/ScalaStorm</url>
<licenses>
<license>
<name>Apache</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:velvia/ScalaStorm.git</url>
<connection>scm:git:git@github.com:velvia/ScalaStorm.git</connection>
</scm>
<developers>
<developer>
<id>velvia</id>
<name>Evan Chan</name>
<url>http://github.com/velvia</url>
</developer>
</developers>)

releaseSettings
Expand Up @@ -5,6 +5,7 @@ import collection.JavaConversions._
import storm.trident.tuple.TridentTuple
import storm.trident.operation.{TridentCollector, BaseFunction}
import backtype.storm.tuple.Fields
import scala.language.implicitConversions

/**
* Functional DSL for Trident so you can easily use Scala closures with Trident.
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,7 +7,7 @@ import backtype.storm.topology.OutputFieldsDeclarer
import backtype.storm.tuple.{Fields, Tuple}
import backtype.storm.task.OutputCollector
import backtype.storm.task.TopologyContext

import scala.language.implicitConversions

// The StormBolt class is an implementation of IRichBolt which
// provides a Scala DSL for making Bolt development concise.
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -7,6 +7,7 @@ import backtype.storm.topology.TopologyBuilder
import collection.mutable.{ListBuffer, HashMap}
import util.Random
import backtype.storm.tuple.{Fields, Tuple}
import scala.language.postfixOps

/*
* This is an example of streaming aggregation for different web metrics.
Expand Down
Expand Up @@ -6,7 +6,7 @@ import backtype.storm.LocalCluster
import backtype.storm.testing.TestWordSpout
import backtype.storm.topology.TopologyBuilder
import backtype.storm.tuple.{Fields, Tuple, Values}

import scala.language.postfixOps

class ExclamationBolt extends StormBolt(outputFields = List("word")) {
def execute(t: Tuple) {
Expand Down
Expand Up @@ -7,6 +7,7 @@ import backtype.storm.topology.TopologyBuilder
import backtype.storm.tuple.{Fields, Tuple, Values}
import collection.mutable.{Map, HashMap}
import util.Random
import scala.language.postfixOps


class RandomSentenceSpout extends StormSpout(outputFields = List("sentence")) {
Expand Down Expand Up @@ -66,4 +67,4 @@ object WordCountTopology {
Thread sleep 10000
cluster.shutdown
}
}
}

0 comments on commit d14beeb

Please sign in to comment.