sbt

Publish asset files of play framework plugin

爱⌒轻易说出口 提交于 2020-01-01 19:42:09
问题 using publishTo in build.sbt file, it can be automation the publishing progress. But asset files( in public folder) does not packaged. how to package and publish asset files? 回答1: For locally publishing assets files , add this snippet in build.sbt file import play.PlayImport.PlayKeys._ packagedArtifacts in publishLocal := { val artifacts: Map[sbt.Artifact, java.io.File] = (packagedArtifacts in publishLocal).value val assets: java.io.File = (playPackageAssets in Compile).value artifacts +

scala sbt test run setup and cleanup command once on multi project

那年仲夏 提交于 2020-01-01 10:16:30
问题 I know I can add setup and cleanup code in sbt for the test phase by modifying the testOptions, e.g.: val embedMongoTestSettings: Seq[Setting[_]] = Seq( testOptions in Test += Tests.Setup( () => createMongod()), testOptions in Test += Tests.Cleanup( () => destroyMongod()) ) The problem I have is that this done on a per project basis and then done once for every project. So when I have a multi project set up, I fire up several databases in this case (which would work, but means I have to

Getting “how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name” compile error

北城以北 提交于 2020-01-01 09:43:19
问题 My Play 2.1.1 project uses SBT 0.12.3, and when compiling it on my dev machine, everything's fine, I get no errors, and the app runs without any issues. When I try to compile it on an EC2 instance used for testing, I get the superlong error message below. The only possibly relevant difference between the two environments is that I have java 6 (1.6.0_45) on my dev machine, and java 7 (1.7.0_19) on EC2, but I can't currently change neither. Have you ever seen something like this? What can this

SBT: Cross-platform way to set java.library.path?

我只是一个虾纸丫 提交于 2020-01-01 09:06:30
问题 I was working on a project that requires loading of native libraries, and so far, all development was restricted to Linux. In order to run my project, I could simply enable forking and modify java.library.path as follows: javaOptions in run += "-Djava.library.path=some/common/path:lib/native/linux" My question is: How can I do the same in a cross-platform way, so that I can share my build.sbt with a Windows-based developer. There are in particular three things that I couldn't figure out so

What frameworks to use to bootstrap my first production scala project?

若如初见. 提交于 2020-01-01 08:52:42
问题 I am making my first foray into scala for a production app. The app is currently packaged as a war file. My plan is to create a jar file of the scala compiled artifacts and add that into the lib folder for the war file. My enhancement is a mysql-backed app exposed via Jersey & will be integrated with a 3rd party site via HttpClient invocations. I know how to do this via plain java. But when doing it in scala, there are several decision points that I am pussyfooting on. scala 2.7.7 or 2.8 RC ?

What frameworks to use to bootstrap my first production scala project?

ぐ巨炮叔叔 提交于 2020-01-01 08:51:10
问题 I am making my first foray into scala for a production app. The app is currently packaged as a war file. My plan is to create a jar file of the scala compiled artifacts and add that into the lib folder for the war file. My enhancement is a mysql-backed app exposed via Jersey & will be integrated with a 3rd party site via HttpClient invocations. I know how to do this via plain java. But when doing it in scala, there are several decision points that I am pussyfooting on. scala 2.7.7 or 2.8 RC ?

sbt to exclude source directory

允我心安 提交于 2020-01-01 08:20:55
问题 How do I config build.sbt to exclude src/main/java directory? I would like to put my Java sources there but I don't want to compile them. Also, can I exclude a file or group of files specify with RE. Can these be easily configured in build.sbt? 回答1: javaSource and scalaSource are inputs to unmanagedSourceDirectories . You can then set unmanagedSourceDirectories to be scalaSource only: unmanagedSourceDirectories in Compile <<= scalaSource in Compile apply ( (s: File) => s :: Nil) or a bit

Showing inferred types of Scala expressions

自闭症网瘾萝莉.ら 提交于 2020-01-01 05:01:05
问题 How can I see the types inferred by the Scala compiler for expressions etc.? I have some code with complicated type inference and implicit conversions, and it's hard to see what's going on just by reading the code. I've tried adding scalacOptions in Compile += "-Xprint-types" in build.sbt, but this has no effect. Using scalac directly isn't very appealing because I have lots of dependencies. I use the Eclipse Scala plugin and ENSIME to write code, and SBT to build. 回答1: It needs to be

Importing test classes into Scala console in sbt?

∥☆過路亽.° 提交于 2020-01-01 03:58:27
问题 I am building a Scala project in the standard directory layout using sbt. I want to run sbt console and import my unit tests so that I can play with them in the Scala REPL. What is the easiest way to do this? Is there a command I can pass to sbt, or something I can add to build.sbt ? Note that I don't necessarily want to run unit tests from the sbt console . (Though that would be nice too.) Instead a have test fixtures that set up data structures that I want to use in my REPL session. 回答1:

Configure sbt to not utilize user home directory

放肆的年华 提交于 2020-01-01 03:36:08
问题 Last week we had the user directory permissions changed on our CI servers and we no longer have write access to the user home directory. Hence sbt fails to boot because it cannot write to ~/.ivy etc with the following stacktrace. java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1006) at xsbt.boot.Locks$.apply0(Locks.scala:34) at xsbt.boot.Locks$.apply(Locks.scala:28) at xsbt.boot.Launch.locked