sbt

Compiling Java annotations with sbt

余生颓废 提交于 2019-12-19 22:02:00
问题 I've created Java annotations (since I need run time retention) under $PROJECT/src/main/java and my scala codewhich uses these java annotations us under $PROJECT/src/main/scala . The Java annotation thus created also makes use of a Java ENUM as it's value. If I compile the project then sbt doesn't seem to compile the Java annotations first and errors out on each usage of the enum in annotations. If I comment out all usages of the Java enum in annotations in scala code and do a compile,

ScalaTest on sbt not running any tests

北战南征 提交于 2019-12-19 17:40:47
问题 I am trying to run my tests with: sbt and then test. My build.sbt looks like this lazy val scalatest = "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test" lazy val root = (project in file(".")). settings( name := "highlight2pdf", version := "0.1", scalaVersion := "2.11.6", libraryDependencies += scalatest ) And i just put the example test on test/scala import collection.mutable.Stack import org.scalatest._ class ExampleSpec extends FlatSpec with Matchers { "A Stack" should "pop values in

How to fork the jvm for each test in sbt

偶尔善良 提交于 2019-12-19 13:47:25
问题 I am working with some classes that (for some reason) can only be used once within a single VM. My test cases work if I run them individually ( fork := true ) enabled in my sbt settings. If I run more than one of these tests, they fail with an exception that has to with a thread executor rejecting a task (it's most likely closed). It would be very time consuming to find out what causes the problem and even if I find the problem, I might not be able to resolve it (I do not have access to the

How to fork the jvm for each test in sbt

 ̄綄美尐妖づ 提交于 2019-12-19 13:47:23
问题 I am working with some classes that (for some reason) can only be used once within a single VM. My test cases work if I run them individually ( fork := true ) enabled in my sbt settings. If I run more than one of these tests, they fail with an exception that has to with a thread executor rejecting a task (it's most likely closed). It would be very time consuming to find out what causes the problem and even if I find the problem, I might not be able to resolve it (I do not have access to the

How to specify that to build project A another project B has to be built first?

ⅰ亾dé卋堺 提交于 2019-12-19 12:53:29
问题 Suppose one guy in my company has an sbt project called commons that's pretty general-purpose. This project is defined in the traditional sbt way: in the main folder with the build definition in project/Build.scala file. Now some other guy is developing a project called databinding that depends on commons . We want to define this project in the same way, with project/Build.scala . We have the following directory layout: dev/ commons/ src/ *.scala files here... project/ Build.scala databinding

Why does scalatest mix up the output?

一个人想着一个人 提交于 2019-12-19 12:38:41
问题 I run my scalatest from sbt, and the output gets mixed up - scalatest prints all the test run, and comments to them, and somewhere in the middle it prints the statistics: > test [info] Compiling 1 Scala source to /home/platon/Tor/scala-dojo-02/target/scala-2.9.1/classes... [info] FunsWithListsTests: [info] - should return list of labels [info] - should return the average rating of games belonging to Zenga [info] - should return the total ratings of all games [info] - should return the total

Does SBT use the Fast Scala Compiler (fsc)?

。_饼干妹妹 提交于 2019-12-19 12:23:36
问题 Does SBT make use of fsc? For test purposes I am compiling a 500-line program on a fairly slow Ubuntu machine (Atom N270). Three successive compile times were 77s, 66s, and 66s. I then compiled the file with fsc from the command line. Now my times were 80s, 25s, 18s. Better! That implies to me sbt is not using fsc . Am I right? If so, why doesn't it use it? I may try getting sbt to explicitly use fsc to compile, though I am not sure I will figure out the config. Has anyone done this? 回答1: SBT

Unresolved Dependencies for a new play 2.0 scala project

守給你的承諾、 提交于 2019-12-19 11:43:20
问题 Good day, After " play new todo " (new scala project) -> " cd todo " -> " play dependencies " I get this one unresolved dependency " org.slf4j:slf4j-api:1.6.1 required by "net.sf.ehcache:ehcache-core:2.5.0, org.hibernate:hibernate-validator:4.2.0.Final, play:play_2.9.1:2.0" reason " Evicted by 1.6.4 ". Actually there is already org.slf4j:slf4j-api:1.6.4 in resolved dependencies. I tried different things, nothing worked. It seems that in the internets there is only one guy here who have the

Setting `unmanagedResourceDirectories` breaks deployment of resources from `resourceDirectory`

感情迁移 提交于 2019-12-19 10:56:05
问题 I have a little bit odd setup. My Java sources are located at /src There are .properties files next to some Java classes. I want them to be packaged to final jar. Scala sources and resources follow SBT convention and are located at /srcnew/main/[scala|resources] Here is how my build.scala looks like sourceDirectory := baseDirectory.value / "srcnew", unmanagedResourceDirectories in Compile := Seq(baseDirectory.value / "src"), includeFilter in unmanagedResources := "*.properties", javaSource in

How to make an sbt task run on under multiple scopes

一世执手 提交于 2019-12-19 10:27:45
问题 I have written an sbt plugin that generates some sources and resources. It is hard coded to work in the Compile scope. How can I make it work in the Test scope too, so I can use the plugin when running tests and it will look in and output to the correct folder? For example, in various points in the code I refer to resourceManaged in Compile which relates to src/main/resources but when test is run, I would like it to be resourceManaged in Test when relates to src/test/resources . How do I