Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:twitter/snowflake

  • Loading branch information...
commit 3a7482801edafdc3ca8863a02ecb6f3b3da72687 2 parents fb21b3c + cbce713
Ryan King authored
View
2  .gitignore
@@ -11,3 +11,5 @@ lib_managed
project/boot
.DS_Store
src_managed
+sbt-launch.jar
+.classpath.txt
View
2  .travis.yml
@@ -1,3 +1,3 @@
language: scala
scala:
- - 2.9.2
+ - 2.9.1
View
60 project/Build.scala
@@ -0,0 +1,60 @@
+import sbt._
+import Keys._
+import com.twitter.sbt._
+
+object Snowflake extends Build {
+ val utilVersion = "5.2.0"
+
+ val sharedSettings = Seq(
+ version := "5.1.1-SNAPSHOT",
+ organization := "com.twitter",
+ SubversionPublisher.subversionRepository := Some("https://svn.twitter.biz/maven-public"),
+ libraryDependencies ++= Seq(
+ "org.scala-tools.testing" %% "specs" % "1.6.9" % "test" withSources(),
+ "junit" % "junit" % "4.8.1" % "test" withSources(),
+ "org.mockito" % "mockito-all" % "1.8.5" % "test" withSources()
+ ),
+ resolvers += "twitter-repo" at "http://maven.twttr.com",
+
+ ivyXML :=
+ <dependencies>
+ <exclude org="com.sun.jmx" module="jmxri" />
+ <exclude org="com.sun.jdmk" module="jmxtools" />
+ <exclude org="javax.jms" module="jms" />
+ </dependencies>,
+
+ scalacOptions ++= Seq("-encoding", "utf8"),
+ scalacOptions += "-deprecation",
+
+ // This is bad news for things like com.twitter.util.Time
+ parallelExecution in Test := false,
+
+ // This effectively disables packageDoc, which craps out
+ // on generating docs for generated thrift due to the use
+ // of raw java types.
+ packageDoc in Compile := new java.io.File("nosuchjar"),
+
+ unmanagedResourceDirectories in Compile <+= baseDirectory{ _ / "config"}
+ )
+
+ lazy val finagleCore = Project(
+ id = "snowflake",
+ base = file("."),
+ settings = Project.defaultSettings ++
+ StandardProject.newSettings ++
+ CompileThrift.newSettings ++
+ sharedSettings
+ ).settings(
+ name := "snowflake",
+ libraryDependencies ++= Seq(
+ "commons-codec" % "commons-codec" % "1.4",
+ "org.slf4j" % "slf4j-api" % "1.5.8",
+ "org.slf4j" % "slf4j-nop" % "1.5.8",
+ "thrift" % "libthrift" % "0.5.0",
+ "com.twitter" % "ostrich" % "8.2.0",
+ "com.twitter" % "scala-zookeeper-client" % "3.0.6",
+ "com.twitter" % "util-logging" % "5.3.0",
+ "com.twitter" % "util-thrift" % "5.3.0"
+ )
+ )
+}
View
24 project/plugins.sbt
@@ -0,0 +1,24 @@
+sbtResolver <<= (sbtResolver) { r =>
+ Option(System.getenv("SBT_PROXY_REPO")) map { x =>
+ Resolver.url("proxy repo for sbt", url(x))(Resolver.ivyStylePatterns)
+ } getOrElse r
+}
+
+resolvers <<= (resolvers) { r =>
+ (Option(System.getenv("SBT_PROXY_REPO")) map { url =>
+ Seq("proxy-repo" at url)
+ } getOrElse {
+ r ++ Seq(
+ "twitter.com" at "http://maven.twttr.com/",
+ "scala-tools" at "http://scala-tools.org/repo-releases/",
+ "maven" at "http://repo1.maven.org/maven2/",
+ "freemarker" at "http://freemarker.sourceforge.net/maven2/"
+ )
+ }) ++ Seq("local" at ("file:" + System.getProperty("user.home") + "/.m2/repo/"))
+}
+
+externalResolvers <<= (resolvers) map identity
+
+addSbtPlugin("com.twitter" % "sbt-package-dist" % "1.0.5")
+
+addSbtPlugin("com.twitter" % "sbt-thrift2" % "0.0.1")
View
42 sbt
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+root=$(
+ cd $(dirname $(readlink $0 || echo $0))/..
+ /bin/pwd
+)
+
+sbtjar=sbt-launch.jar
+
+if [ ! -f $sbtjar ]; then
+ echo 'downloading '$sbtjar 1>&2
+ curl -O http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2/$sbtjar
+fi
+
+test -f $sbtjar || exit 1
+
+sbtjar_md5=$(openssl md5 < $sbtjar|cut -f2 -d'='|awk '{print $1}')
+
+if [ "${sbtjar_md5}" != 2886cc391e38fa233b3e6c0ec9adfa1e ]; then
+ echo 'bad sbtjar!' 1>&2
+ exit 1
+fi
+
+test -f ~/.sbtconfig && . ~/.sbtconfig
+
+java -ea \
+ $SBT_OPTS \
+ $JAVA_OPTS \
+ -Djava.net.preferIPv4Stack=true \
+ -XX:+AggressiveOpts \
+ -XX:+UseParNewGC \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+CMSParallelRemarkEnabled \
+ -XX:+CMSClassUnloadingEnabled \
+ -XX:MaxPermSize=1024m \
+ -XX:SurvivorRatio=128 \
+ -XX:MaxTenuringThreshold=0 \
+ -Xss8M \
+ -Xms512M \
+ -Xmx3G \
+ -server \
+ -jar $sbtjar "$@"
Please sign in to comment.
Something went wrong with that request. Please try again.