sbt

Globally disable sbt supershell

廉价感情. 提交于 2020-07-09 09:04:07
问题 Similar to this question I'd like to stop sbt from spamming the shell with messages and blank lines. It stops if I run sbt with the option sbt -Dsbt.supershell=false , but I'd like to disable it globally via a dotfile in ~/.sbt or similar. I could replace the sbt binary with a wrapper which always adds this option, but that seems inelegant. I've tried each of the following in a file called ~/.sbt/1.0/global.sbt and ~/.sbt/1.3/global.sbt , but none have an effect: sbt.supershell := false

Reference scala file from build.sbt

帅比萌擦擦* 提交于 2020-06-28 05:20:42
问题 I have the following problem: I need to write a file into a build directory with the content that is defined in the project sbt is going to build. prj | |_src/main/scala/FancyScalaFile.scala | |_build.sbt | |_project/build.properties Here is how the FancyScalaFile.scala looks like object FancyScalaFile { def extractString: String() = //... } Is there a way to call extractString from build.sbt ? 回答1: Yes, you can add additional source directory to project/build.sbt (create this file if it

sbt: How to run integration test

左心房为你撑大大i 提交于 2020-06-17 04:42:40
问题 According to the documentation: The standard testing tasks are available, but must be prefixed with it:. For example, > IntegrationTest / testOnly org.example.AnIntegrationTest As described, I added this to my build.sbt : lazy val server = (project in file("server")) .configs(IntegrationTest) I want to run only integration tests. So I tried different ways - but none worked: [IJ][play-binding-form-server] $ it:test [error] No such setting/task [error] it:test ... [IJ][play-binding-form-server]

sbt 1.3.8 displaying a lot of useless messages

。_饼干妹妹 提交于 2020-06-16 17:17:14
问题 After I upgrade sbt to 1.3.8, I see a lot of unuseful messages in the sbt console, which is very annoying. I searched online but didn't find a good key word. Does anyone know how to disable the messages showing like below? | => Zero / checkBuildSources / dynamicInputs 0s | => Zero / checkBuildSources / dynamicInputs 0s | => Global / previousCache 0s | => Zero / checkBuildSources / dynamicInputs 0s | => Global / previousCache 0s 回答1: These messages are progress logging from the sbt "super

sbt 1.3.8 displaying a lot of useless messages

旧城冷巷雨未停 提交于 2020-06-16 17:16:52
问题 After I upgrade sbt to 1.3.8, I see a lot of unuseful messages in the sbt console, which is very annoying. I searched online but didn't find a good key word. Does anyone know how to disable the messages showing like below? | => Zero / checkBuildSources / dynamicInputs 0s | => Zero / checkBuildSources / dynamicInputs 0s | => Global / previousCache 0s | => Zero / checkBuildSources / dynamicInputs 0s | => Global / previousCache 0s 回答1: These messages are progress logging from the sbt "super

Strange issue with SBT, println, and scala console application

懵懂的女人 提交于 2020-06-14 07:55:06
问题 When I run my scala code (I'm using SBT), the prompt is displayed after I enter some text as shown here: C:\... > sbt run [info] Loading project definition [...] [info] Set current project to [...] Running com[...] test >> exit >> >> >> >> >> >> [success] Total time[...] It seems like it's stacking up the print() statements and only displaying them when it runs a different command. If I use println() it works as it should (except that I don't want a newline) The code: ... def main(args:Array

How to use given in Dotty?

依然范特西╮ 提交于 2020-06-12 07:35:25
问题 I was looking at Dotty docs under Contextual Abstractions page and I saw the Given Instances . Given instances (or, simply, "givens") define "canonical" values of certain types that serve for synthesizing arguments to given clauses. Example: trait Ord[T] { def compare(x: T, y: T): Int def (x: T) < (y: T) = compare(x, y) < 0 def (x: T) > (y: T) = compare(x, y) > 0 } given intOrd: Ord[Int] { def compare(x: Int, y: Int) = if (x < y) -1 else if (x > y) +1 else 0 } given listOrd[T]: (ord: Ord[T])

How to share sbt plugin configuration between multiple projects?

假如想象 提交于 2020-06-09 10:58:51
问题 We have a multitude of smaller sbt projects, which we would like to keep separate (no multi-project build). However we would like to share configuration between the builds. In order to do so we currently have yet another project, which all the projects use as a libraryDependency in their project/project/Build.scala files. We were able to centralize build configuration using only built-in sbt features this way. What we haven't figured out is how to centralize plugin specific build

How to share sbt plugin configuration between multiple projects?

ⅰ亾dé卋堺 提交于 2020-06-09 10:58:14
问题 We have a multitude of smaller sbt projects, which we would like to keep separate (no multi-project build). However we would like to share configuration between the builds. In order to do so we currently have yet another project, which all the projects use as a libraryDependency in their project/project/Build.scala files. We were able to centralize build configuration using only built-in sbt features this way. What we haven't figured out is how to centralize plugin specific build

Using vs code, how to get scala format to work and format my code?

喜你入骨 提交于 2020-05-30 02:46:08
问题 I have the scala format plugin in my multi project sbt repository. addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2") So in the sbt console if I run scalafmt it works fine My build.sbt has: scalafmtOnCompile := true If I do a ~compile in sbt or just compile manually, it doesn't format my code during compilation. What is wrong with my setup? Also, running scalafmt works but it doesn't format my .scala files in /project like my Dependencies.scala file. Why is it ignoring these files? I am