3

我快疯了,真的:-(

鉴于以下 SBT 构建文件...

import sbt._
import sbt.Keys._

object BrixBuild extends Build {

  lazy val buildSettings = Project.defaultSettings ++ Seq(
    organization := "com.mycompany",
    version := "0.1-SNAPSHOT",
    scalaVersion := "2.10.0-RC3",
    scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-deprecation", "-feature", "-unchecked"),
    resolvers += Resolvers.typesafe,
    target := file("target")
  )

  lazy val util = Project(
    id = "brix-util",
    base = file("brix-util"),
    settings = buildSettings ++ Seq(
      libraryDependencies ++= Dependencies.util
    )
  )

  lazy val slick = Project(
    id = "brix-slick",
    base = file("brix-slick"),
    settings = buildSettings ++ Seq(
      libraryDependencies ++= Dependencies.slick
    )
  )
}

object Resolvers {

  val typesafe = "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases"
}

object Dependencies {

  private object Compile {
    val commonsCodec = "commons-codec" % "commons-codec" % "1.7"
    val slick = "com.typesafe" %% "slick" % "1.0.0-RC1"
  }

  private object Test {
    val specs2 = "org.specs2" %% "specs2" % "1.12.3" % "test"
    val slf4j = "org.slf4j" % "slf4j-nop" % "1.6.4" % "test"
    val h2 = "com.h2database" % "h2" % "1.3.166" % "test"
  }

  val util = Seq(Compile.commonsCodec, Test.specs2, Test.slf4j)
  val slick = Seq(Compile.slick, Test.specs2, Test.slf4j, Test.h2)
}

...只有最后一个子项目被编译。为什么?我错过了什么吗?

任何帮助将非常感激。德克萨斯州。

4

1 回答 1

3

您应该定义一个聚合子项目的“父”项目。有关示例,请参见https://github.com/typesafehub/scalalogging/blob/master/project/Build.scala

于 2013-01-02T19:00:47.113 回答