如何更改SBT的sbt-xjc插件中的源目录?

时间:2011-11-08 15:15:37

标签: sbt xjc

根据docs,默认位置为: 的src /主/资源。

我的XSD位于src / main / schema中,因此我需要更改源设置。

所以我使用了以下内容:

sources in (xjc, Compile)  <+= sourceDirectory / "main" / "schema"

这导致:

overloaded method value in with alternatives:
[error]   (p: sbt.Reference,t: sbt.Scoped)sbt.ScopedTask[Seq[java.io.File]] <and>
[error]   (p: sbt.Reference,c: sbt.ConfigKey)sbt.ScopedTask[Seq[java.io.File]] <and>
[error]   (c: sbt.ConfigKey,t: sbt.Scoped)sbt.ScopedTask[Seq[java.io.File]]
[error]  cannot be applied to (sbt.TaskKey[Seq[java.io.File]], sbt.Configuration)
[error] Error occurred in an application involving default arguments.
[error]       sources in (xjc, Compile) <+= sourceDirectory / "main" / "schema"
[error]               ^
[error] one error found

1 个答案:

答案 0 :(得分:1)

sources in (Compile, xjc) <<= sourceDirectory map (_ / "main" / "schema" ** "*.xsd" get)

文档已更新。