diff --git a/project/Project.scala b/project/Project.scala index 73431b039fc..f187f9f6a62 100644 --- a/project/Project.scala +++ b/project/Project.scala @@ -91,6 +91,39 @@ object Zipkin extends Build { val OSTRICH_VERSION = "8.0.1" val UTIL_VERSION = "5.0.3" + lazy val common = + Project( + id = "zipkin-common", + base = file("zipkin-common"), + settings = Project.defaultSettings ++ + StandardProject.newSettings ++ + SubversionPublisher.newSettings ++ + CompileThriftScrooge.newSettings + ).settings( + version := "0.2.0-SNAPSHOT", + + libraryDependencies ++= Seq( + "com.twitter" % "finagle-thrift" % FINAGLE_VERSION, + "com.twitter" % "finagle-zipkin" % FINAGLE_VERSION, + "com.twitter" % "ostrich" % OSTRICH_VERSION, + "com.twitter" % "util-core" % UTIL_VERSION, + + "com.twitter" % "scrooge" % "3.0.1" intransitive(), + "com.twitter" % "scrooge-runtime_2.9.2" % "3.0.1" intransitive(), + + /* Test dependencies */ + "org.scala-tools.testing" % "specs_2.9.1" % "1.6.9" % "test", + "org.jmock" % "jmock" % "2.4.0" % "test", + "org.hamcrest" % "hamcrest-all" % "1.1" % "test", + "cglib" % "cglib" % "2.2.2" % "test", + "asm" % "asm" % "1.5.3" % "test", + "org.objenesis" % "objenesis" % "1.1" % "test" + ), + + CompileThriftScrooge.scroogeVersion := "3.0.1" + ) + + lazy val server = Project( id = "zipkin-server", @@ -99,7 +132,6 @@ object Zipkin extends Build { StandardProject.newSettings ++ SubversionPublisher.newSettings ++ CompileThriftScrooge.newSettings).settings( - name := "zipkin-server", version := "0.2.0-SNAPSHOT", libraryDependencies ++= Seq( @@ -145,5 +177,5 @@ object Zipkin extends Build { base => (base / "config" +++ base / "src" / "test" / "resources").get } - ) + ).dependsOn(common) } diff --git a/zipkin-server/src/main/scala/com/twitter/zipkin/common/Annotation.scala b/zipkin-common/src/main/scala/com/twitter/zipkin/common/Annotation.scala similarity index 100% rename from zipkin-server/src/main/scala/com/twitter/zipkin/common/Annotation.scala rename to zipkin-common/src/main/scala/com/twitter/zipkin/common/Annotation.scala diff --git a/zipkin-server/src/main/scala/com/twitter/zipkin/common/Endpoint.scala b/zipkin-common/src/main/scala/com/twitter/zipkin/common/Endpoint.scala similarity index 100% rename from zipkin-server/src/main/scala/com/twitter/zipkin/common/Endpoint.scala rename to zipkin-common/src/main/scala/com/twitter/zipkin/common/Endpoint.scala diff --git a/zipkin-server/src/main/scala/com/twitter/zipkin/common/IncompleteTraceDataException.scala b/zipkin-common/src/main/scala/com/twitter/zipkin/common/IncompleteTraceDataException.scala similarity index 100% rename from zipkin-server/src/main/scala/com/twitter/zipkin/common/IncompleteTraceDataException.scala rename to zipkin-common/src/main/scala/com/twitter/zipkin/common/IncompleteTraceDataException.scala diff --git a/zipkin-server/src/main/scala/com/twitter/zipkin/common/Span.scala b/zipkin-common/src/main/scala/com/twitter/zipkin/common/Span.scala similarity index 100% rename from zipkin-server/src/main/scala/com/twitter/zipkin/common/Span.scala rename to zipkin-common/src/main/scala/com/twitter/zipkin/common/Span.scala diff --git a/zipkin-common/src/main/thrift/zipkinCore.thrift b/zipkin-common/src/main/thrift/zipkinCore.thrift new file mode 120000 index 00000000000..1f2a5d75c42 --- /dev/null +++ b/zipkin-common/src/main/thrift/zipkinCore.thrift @@ -0,0 +1 @@ +../../../../zipkin-thrift/src/main/thrift/zipkinCore.thrift \ No newline at end of file diff --git a/zipkin-server/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala b/zipkin-common/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala similarity index 99% rename from zipkin-server/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala rename to zipkin-common/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala index aa832a9af7e..e1a9fb40eb6 100644 --- a/zipkin-server/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala +++ b/zipkin-common/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala @@ -1,6 +1,6 @@ /* * Copyright 2012 Twitter Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/zipkin-server/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala b/zipkin-common/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala similarity index 99% rename from zipkin-server/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala rename to zipkin-common/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala index b962fb549c9..e0679515d50 100644 --- a/zipkin-server/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala +++ b/zipkin-common/src/test/scala/com/twitter/zipkin/common/EndpointSpec.scala @@ -1,6 +1,6 @@ /* * Copyright 2012 Twitter Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/zipkin-server/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala b/zipkin-common/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala similarity index 98% rename from zipkin-server/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala rename to zipkin-common/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala index 023760987d7..98e09eb8429 100644 --- a/zipkin-server/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala +++ b/zipkin-common/src/test/scala/com/twitter/zipkin/common/SpanSpec.scala @@ -1,6 +1,6 @@ /* * Copyright 2012 Twitter Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,7 +24,7 @@ class SpanSpec extends Specification { val annotationValue = "NONSENSE" val expectedAnnotation = Annotation(1, annotationValue, Some(Endpoint(1, 2, "service"))) val expectedSpan = Span(12345, "methodcall", 666, None, - List(expectedAnnotation), Nil) + List(expectedAnnotation), Nil) val annotation1 = Annotation(1, "value1", Some(Endpoint(1, 2, "service"))) val annotation2 = Annotation(2, "value2", Some(Endpoint(3, 4, "service")))