sbt

sbt play cross build project setup: uTest runner doesn't seperate client/server projects correctly

☆樱花仙子☆ 提交于 2019-12-22 17:34:08
问题 I'm using an build.sbt which has cross compile settings and basically is an adapted version of "Play with scala-js example" and having some trouble getting a clean setup for my tests. Specifically, when running my server tests, my client tests also get executed (which is something that I want to avoid). I followed the instructions from Cannot get uTest to see my tests and added libraryDependencies += "com.lihaoyi" %%% "utest" % "0.3.0" My tests for some reason didn't get executed until I

Redefine an sbt task conditional on a setting

老子叫甜甜 提交于 2019-12-22 11:18:55
问题 I would like to redefine an sbt task conditional on the value of a setting. In the default case, it should execute the original task, in the other case, I want to run a custom task. Given a task and setting: val someSetting = Def.settingKey[Boolean]("some setting") val fooTask = Def.taskKey[String]("foo task") someSetting := true fooTask := { println("** foo effect **") "foo value" } Trying to redefine fooTask: fooTask := { if( someSetting.value ) fooTask else Def.task("whatever") }.value

SBT configuration vs Ivy module configuration

我的梦境 提交于 2019-12-22 10:57:27
问题 This appears similar to sbt Configuration vs Ivy configuration, though it doesn't seem like this question is asked: What is the difference between libraryDependencies += "com.example" % "foo" % "1.0" % "test" and libraryDependencies in Test += "com.example" % "foo" % "1.0" (And a similar question for IntegrationTest / "it" .) Should I always use SBT configuration, or Ivy configuration? Or does it depend on the particular case? I have seen the former more often, though it seems that the latter

project/Dependencies.scala not accessible from plugins.sbt

最后都变了- 提交于 2019-12-22 10:55:12
问题 I'm unable to reference the object Dependencies from within plugins.sbt on compile getting the error error: not found: value Dependencies /project/plugins.sbt /project/Dependencies.sbt Depencies.scala is just a collection of objects object Dependencies { object Play { ... val sbtPlugin = "..." ... Similarly I use it in ./build.sbt to add libraryDependencies without problems: lazy val root = (project in file(".")) .enablePlugins(PlayScala) .settings(libraryDependencies += Seq( Dependencies

I need to load application.conf via typesafe's ConfigFactory within an sbt Task

与世无争的帅哥 提交于 2019-12-22 10:48:37
问题 I have a simple project here: https://github.com/bloo/foo-gen-config/ .. that does one thing - load sbt and runs the task foo-gen , which fails. The Task def is here: https://github.com/bloo/foo-gen-config/blob/master/project/FooConfigPlugin.scala#L19-L25 (I alluded to this question along with a number of other convoluted issues here: How to make a sbt task use a specific configuration scope? but have since distilled it down to a single issue I need help with) I am open to suggestions on how

How to suppress Warning by sbt compile

时间秒杀一切 提交于 2019-12-22 10:34:22
问题 I am currently working on project, my project works fine and working. But i want to suppress the warning when i run sbt compile . when i run sbt compile i don't want my terminal to show warning. [warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:14: imported `QueryString' is permanently hidden by definition of class QueryString in package misc [warn] import misc.QueryString [warn] ^ [warn] /Users/kumarshubham/Documents/repositories/alice/app/misc/QueryDB.scala:26:

Error while importing sbt project , Server Access error, unresolved dependencies

馋奶兔 提交于 2019-12-22 10:26:31
问题 I am trying to import libraries in my project in build.sbt from IntelliJ IDE 15.0.2. I keep getting unresolved dependencies error. I tried to update settings from different forums to resolve it, but none works. Few things I tried: Update sbtconfig.txt with proxy settings, clean up and Invalidate/restart cache from project settings remove .sbt, .ivy2 folders and restart the IDE and launch project. Still no use. Here is the error I keep getting now: Nbr of module to sort : 0 resolved ivy file

Repeating dependent parsers with Scala/SBT parser combinators

寵の児 提交于 2019-12-22 09:38:45
问题 Parsing a string of the form Value[,Value]+ can be easily accomplished via rep1sep(Value, ',') . Is there a way to achieve rep1sep functionality when the Value parser is dependent on the previously parsed Values in the repetition? For example, enforcing a requirement that each value must be unique? The standard technique for dependent parsers is flatMap, but I am having trouble getting that working. Here's one such attempt: def Values(soFar: Set[Value]): Parser[Set[Value]] = Value(soFar)

How to keep sbt running (as a daemon process) after executing a command

巧了我就是萌 提交于 2019-12-22 09:24:23
问题 I want to launch scalatra server from sbt. How do I do that? The following does launch scalatra: sbt "container:start" But it exits immediately: [info] starting server ... [success] Total time: 2 s, completed Sep 12, 2015 2:39:32 PM > [info] waiting for server to shut down... Most preferably the whole thing would run in a nohup as a daemon process. 回答1: Don't do it on one line. Use two commands. ./sbt container:start 回答2: sbt "; <command>; console" does the trick. Note the initial semicolon

How to keep sbt running (as a daemon process) after executing a command

佐手、 提交于 2019-12-22 09:23:07
问题 I want to launch scalatra server from sbt. How do I do that? The following does launch scalatra: sbt "container:start" But it exits immediately: [info] starting server ... [success] Total time: 2 s, completed Sep 12, 2015 2:39:32 PM > [info] waiting for server to shut down... Most preferably the whole thing would run in a nohup as a daemon process. 回答1: Don't do it on one line. Use two commands. ./sbt container:start 回答2: sbt "; <command>; console" does the trick. Note the initial semicolon