3

我已经使用插件包含scalaxb在我的项目中。sbt-scalaxb一切都很好,但我对放置源文件的默认位置并不完全满意。目前文件被放置在target/scala-2.11/src_managed/main/sbt-scalaxb/scalaxbGenerated(与我在我的build.sbt.

我更愿意将源文件(尽管不是编译的类)存储到src/main/scala/scalaxbGenerated(或类似的东西)中。有谁知道我可以使用的设置?(我假设有一个,我只是在不深入研究 scalaxb 源代码的情况下无法找到它)。

下面是我的意思的模型。

lazy val myProject = (project in file("."))
.enablePlugins(ScalaxbPlugin) // See project/scalaxb.sbt
.settings(commonSettings: _*)
.settings(
    name := "my-project",
    version := myVersion,
    libraryDependencies ++= myDependencies
)
.settings(
    scalaxbDispatchVersion in (Compile, scalaxb) := dispatchCoreVersion,
    scalaxbPackageName in (Compile, scalaxb)     := scalaXbGeneratedCodePackageName
    // TODO - store generated source code in src, not target
)
4

1 回答 1

3

scalaxb 使用sourceManaged设置(source)。您可以在 build.sbt 中更改它,例如:

sourceManaged in (Compile, scalaxb) := (sourceDirectory in Compile).value / "sbt-scalaxb"
于 2017-04-04T21:33:02.640 回答