2011-11-08 40 views
1

根据docs,默认位置是: src/main/resources。如何更改SBT的sbt-xjc插件中的源代码目录?

我的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
sources in (Compile, xjc) <<= sourceDirectory map (_/"main"/"schema" ** "*.xsd" get) 

文档已被更新。