gpt4 book ai didi

scala - 为什么 SBT 只编译最后一个子项目?

转载 作者:行者123 更新时间:2023-12-01 08:48:48 26 4
gpt4 key购买 nike

我快疯了,真的:-(

给定以下 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)
}

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

任何帮助将不胜感激。发送。

最佳答案

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

关于scala - 为什么 SBT 只编译最后一个子项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14127367/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com