本文介绍了JOOQ sbt从0.3.16迁移到1.2.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将JOOQ构建和配置从sbt 0.3.16迁移到sbt 1.2.8
How migrate JOOQ building and configuration from sbt 0.3.16 to sbt 1.2.8
0.3.16中的JOOQ构建定义如下.
The JOOQ build definition in 0.3.16 as below.
val generateJOOQ = taskKey[Seq[File]]("Generate JooQ classes")
val generateJOOQTask = (baseDirectory, dependencyClasspath in Compile, runner in Compile, streams) map { (base, cp, r, s) =>
toError (r.run(
"org.jooq.util.GenerationTool",
cp.files,
Array("conf/openDoor.xml"),
s.log))
((base / "app" / "jooqSteps") ** "*.scala").get
}
generateJOOQ <<= generateJOOQTask
以及运行sbt(1.2.8)时的结果:
and the result when running sbt (1.2.8):
build.sbt:70: error: value map is not a member of (sbt.SettingKey[java.io.File], sbt.TaskKey[sbt.Keys.Classpath], sbt.TaskKey[sbt.ScalaRun], sbt.TaskKey[sbt.Keys
.TaskStreams])
val generateJOOQTask = (baseDirectory, dependencyClasspath in Compile, runner in Compile, streams) map { (base, cp, r, s) =>
^
C:\workPlay\anchor\build.sbt:71: error: not found: value toError
toError (r.run(
^
[error] sbt.compiler.EvalException: Type error in expression
谢谢您的帮助
推荐答案
根据从元组扩展中迁移指南和已弃用的发行说明,我们可以按以下方式迁移generateJOOQTask
According to migrating from tuple enrichments guide and dropped deprecations release notes we could migrate generateJOOQTask
as follows
val generateJOOQ = taskKey[Seq[File]]("Generate JooQ classes")
generateJOOQ := {
val base = baseDirectory.value
val cp = (dependencyClasspath in Compile).value
val r = (runner in Compile).value
val s = streams.value
r.run(
"org.jooq.util.GenerationTool",
cp.files,
Array("conf/openDoor.xml"),
s.log
).failed foreach (sys error _.getMessage)
((base / "app" / "jooqSteps") ** "*.scala").get
}
这篇关于JOOQ sbt从0.3.16迁移到1.2.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!