-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
40 lines (30 loc) · 1.11 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import AssemblyKeys._
seq(assemblySettings: _*)
name := "scala-storm-starter"
version := "0.0.2-SNAPSHOT"
scalaVersion := "2.9.2"
fork in run := true
resolvers ++= Seq(
"twitter4j" at "http://twitter4j.org/maven2",
"clojars.org" at "http://clojars.org/repo"
)
libraryDependencies ++= Seq(
"storm" % "storm" % "0.7.2" % "provided",
"org.clojure" % "clojure" % "1.4.0" % "provided",
"org.twitter4j" % "twitter4j-core" % "2.2.6-SNAPSHOT",
"org.twitter4j" % "twitter4j-stream" % "2.2.6-SNAPSHOT",
"org.specs2" %% "specs2" % "1.11" % "test"
)
mainClass in Compile := Some("storm.starter.topology.ExclamationTopology")
mainClass in assembly := Some("storm.starter.topology.ExclamationTopology")
TaskKey[File]("generate-storm") <<= (baseDirectory, fullClasspath in Compile, mainClass in Compile) map { (base, cp, main) =>
val template = """#!/bin/sh
java -classpath "%s" %s "$@"
"""
val mainStr = main getOrElse error("No main class specified")
val contents = template.format(cp.files.absString, mainStr)
val out = base / "bin/run-main-topology.sh"
IO.write(out, contents)
out.setExecutable(true)
out
}