sbt-scalabuff的SBT设置

时间:2014-04-11 14:27:15

标签: scala sbt protocol-buffers

有人能为我提供sbt-scalabuff的最小工作设置吗?那里的信息似乎不完整。我目前正在尝试使用addSbtPlugin("com.github.sbt" % "sbt-scalabuff" % "0.2"),但我得到sbt.ResolveException: unresolved dependency: net.sandrogrzicic#scalabuff-runtime_2.9.2;1.3.6: not found。我想我错过了一个存储库。

为什么它使用2.9.2呢?我有scalaVersion := 2.10.3

build.sbt

organization := "com.confabulous"

name := "protobuf"

version := "0.0.1-SNAPSHOT"

scalaVersion := "2.10.4"

scalacOptions += "-deprecation"

resolvers ++= Seq(
  "sonatype releases"  at "https://oss.sonatype.org/content/repositories/releas
  "sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapsh
  "typesafe repo"      at "http://repo.typesafe.com/typesafe/releases/"
)

libraryDependencies += "net.sandrogrzicic" %% "scalabuff-runtime" % "1.3.6"

plugins/plugins.sbt

addSbtPlugin("com.github.sbt" % "sbt-scalabuff" % "0.2")

项目/ Build.scala

import sbt._
import scalabuff.ScalaBuffPlugin._

object build extends Build {
  lazy val root = Project("main", file("."), settings = Defaults.defaultSetting
}

输出

$ sbt compile
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
[info] Loading project definition from /home/dan/projects/confabulous/protobuf/project
[info] Updating {file:/home/dan/projects/confabulous/protobuf/project/}default-6a3ff1...
[info] Resolving org.scala-sbt#precompiled-2_10_1;0.12.4 ...
[info] Done updating.
[info] Set current project to protobuf (in build file:/home/dan/projects/confabulous/protobuf/)
[info] Compiling 1 Scala source to /home/dan/projects/confabulous/protobuf/target/scala-2.10/classes...
[error] /home/dan/projects/confabulous/protobuf/target/scala-2.10/src_managed/scala/com/confabulous/protobuf/ConfabulousProtobuf.scala:11: not found: value net
[error]     with net.sandrogrzicic.scalabuff.Message[Pair] {
[error]          ^
[error] /home/dan/projects/confabulous/protobuf/target/scala-2.10/src_managed/scala/com/confabulous/protobuf/ConfabulousProtobuf.scala:76: not found: value net
[error]     with net.sandrogrzicic.scalabuff.Message[Notice] {
[error]          ^

1 个答案:

答案 0 :(得分:0)

https://dl.bintray.com/actor/maven添加到您的SBT解析器

 public function buildRules(RulesChecker $rules)
 {
     $rules->add($rules->isUnique(['username']));
     $rules->add($rules->isUnique(['email']), 
         ['errorField' => 'email', 'message' => 'Este email já encontra-se em uso.']
     );
     return $rules;
}