sbt-scalariform插件-无法解析设置 [英] sbt-scalariform plugin - can't resolve settings
问题描述
我想将scalariform
工具集成到SBT
中.跟随 https://github.com/sbt/sbt-scalariform/tree/master 我用行创建了plugins.sbt
文件
I wanted to integrate scalariform
tool into SBT
. Following the https://github.com/sbt/sbt-scalariform/tree/master I created plugins.sbt
file with line
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
然后我用
scalariformSettings
在这里,我被困住了,当我尝试为我的项目运行SBT
时,我会得到
Here I am stuck, when I try to run SBT
for my project I am getting
scalariform.sbt:1: error: not found: value scalariformSettings
我也尝试过
import com.typesafe.sbt.SbtScalariform
SbtScalariform.scalariformSettings
scalariform.sbt
中,然后我得到
scalariform.sbt:1: error: object typesafe is not a member of package com
import com.typesafe.sbt.SbtScalariform
^
scalariform.sbt:3: error: not found: value SbtScalariform
SbtScalariform.scalariformSettings
^
我看到了线程 Sbt找不到SbtScalariform ,但建议将版本更改为(1.1.0
).即使此方法有效(并且无效),我还是希望使用1.3.0
版本.
I saw the thread Sbt can't find SbtScalariform but it suggest changing the version to (1.1.0
). Even if this worked (and it does not) I would prefer 1.3.0
version.
推荐答案
您的插件文件是否位于正确的位置?对于SBT 0.13.x,我可以进行以下工作:
Is your plugin file in the correct location? For SBT 0.13.x, I have the following working:
在build.sbt
import scalariform.formatter.preferences._
name := "app"
organization := "example"
version := "0.0.0"
libraryDependencies += // ...
scalariformSettings
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(RewriteArrowSymbols, true)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, true)
在project/plugins.sbt
中:
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
这篇关于sbt-scalariform插件-无法解析设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!