diff --git a/build.sbt b/build.sbt index 46c6cbb..4254ff2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,10 @@ import Common._ import Dependencies._ -import sbtprotobuf.{ProtobufPlugin=>PB} import BuildTask._ -PB.protobufSettings -javaSource in PB.protobufConfig <<= (sourceDirectory in Compile)(_ / "generated") lazy val root = (project in file(".")). settings(commonSettings:_*). settings(libraryDependencies ++= allDeps). - settings(buildtaskSettings:_*) \ No newline at end of file + settings(buildtaskSettings:_*). + settings(Common.protoBufSettings:_*) \ No newline at end of file diff --git a/project/Common.scala b/project/Common.scala index e53734f..4015be6 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -1,5 +1,7 @@ +import sbt._ import sbt.Keys._ import sbtassembly.AssemblyPlugin.autoImport._ +import sbtprotobuf.{ProtobufPlugin => PB} object Common { @@ -18,4 +20,13 @@ object Common { }, test in assembly := {} ) + + val protoBufSettings = + PB.protobufSettings ++ Seq( + version in PB.protobufConfig := Dependencies.Versions.pbVer, + javaSource in PB.protobufConfig := sourceDirectory.value / "generated", + PB.runProtoc in PB.protobufConfig := { args => + com.github.os72.protocjar.Protoc.runProtoc(s"-v${Dependencies.Versions.pbVer.replace(".", "")}" +: args.toArray) + } + ) } \ No newline at end of file diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 1f84308..9b31e0f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -10,6 +10,7 @@ object Dependencies { val sprayVer = "1.3.1" val jodaVer = "2.9.4" val akkaVer = "2.3.15" + val pbVer = "2.4.1" } import Versions._ diff --git a/project/plugins.sbt b/project/plugins.sbt index cbc2c60..2fe7941 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % "0.5.2") -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3") \ No newline at end of file +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3") +libraryDependencies += "com.github.os72" % "protoc-jar" % "3.0.0-b2" \ No newline at end of file