簡體   English   中英

在 sbt 程序集中運行 scalafmtCheck

[英]Run scalafmtCheck in an sbt assembly

我想在sbt assembly集中運行scalafmtCheck 我試圖添加:

(compile in Compile) := ((compile in Compile) dependsOn scalafmtCheck).value

我得到了那個錯誤:

[error] References to undefined settings: 
[error] 
[error]   submissions / scalafmtCheck from submissions / Compile / compile (/home/yass/Documents/Invenis/iss/build.sbt:45)
[error]      Did you mean submissions / Compile / scalafmtCheck ?
[error] 
[error]   scalafmtCheck from Compile / compile (/home/yass/Documents/Invenis/iss/build.sbt:45)
[error]      Did you mean Compile / scalafmtCheck ?
[error]

任何的想法?

你快到了。 scalafmtCheck也是一項任務,因此需要 scope。您需要做的是:

Compile / compile := (Compile / compile).dependsOn(Compile / scalafmtCheck).value

如果你想將它添加到組裝階段,你可以這樣做:

assembly := assembly.dependsOn(Compile / scalafmtCheck).value

如果您希望格式也將此應用於您的測試,您可以這樣做:

Compile / compile := (Compile / compile).dependsOn(Test / scalafmtCheck).value

或者僅在組裝階段:

assembly := assembly.dependsOn(Test / scalafmtCheck).value

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM