sbt

How to have sbt multi-project builds configure setting for subprojects?

廉价感情. 提交于 2019-12-23 01:52:43
问题 I have an sbt (0.13.1) project with a bunch of subprojects. I am generating eclipse project configurations using sbteclipse. My projects only have scala source files, so I want to remove the generated src/java folders. I can achieve that by (redundantly) adding the following to the build.sbt of each subproject: unmanagedSourceDirectories in Compile := (scalaSource in Compile).value :: Nil unmanagedSourceDirectories in Test := (scalaSource in Test).value :: Nil I tried just adding the above

Trying to include GSON in Play! 2.0 project

时光怂恿深爱的人放手 提交于 2019-12-23 01:36:10
问题 I've added "com.google.gson" % "gson" % "2.2" to my AppDependencies but when I run play update, I get: [info] Updating {file:/Users/levinotik/Dev/scala/throw-away/myFirstApp/}myFirstApp... [warn] module not found: com.google.gson#gson;2.1.0 [warn] ==== local: tried [warn] /Users/levinotik/dev/scala/play-2.0.4/framework/../repository/local/com.google.gson/gson/2.1.0/ivys/ivy.xml [warn] ==== Typesafe Releases Repository: tried [warn] http://repo.typesafe.com/typesafe/releases/com/google/gson

how to cache the results of an sbt TaskKey?

六眼飞鱼酱① 提交于 2019-12-22 22:23:51
问题 I have an expensive task that I need to reference in my tests lazy val exampleSources = TaskKey[Seq[File]]("exampleSources", "for use in tests") exampleSources := (updateClassifiers in Test).value.select( artifact = artifactFilter(classifier = "sources") ) (and then I can pass exampleSources.value as a parameter to my forked tests) However, every time I run a test, this task is called, and updateClassifiers (expensive) is called. But I'm happy caching the value on first call and then using

Error while importing SBT project

拟墨画扇 提交于 2019-12-22 22:22:13
问题 The below is the Log that i can see when building the SBT project.What is the below trying to say ! I'm using IntelliJ IDE and Scala 2.12 and SBT 1.0.3 to build the project. I have verified the IDE Proxy settings ,its setup and works fine for other Build tools. Is something missing my SBT installation ?? I tried accessing the failing links in the log and they too are throwing up with errors. "C:\Program Files\Java\jdk1.8.0_131\bin\java" -agentlib:jdwp=transport=dt_socket,address=12805,suspend

Error while importing SBT project

冷暖自知 提交于 2019-12-22 22:21:46
问题 The below is the Log that i can see when building the SBT project.What is the below trying to say ! I'm using IntelliJ IDE and Scala 2.12 and SBT 1.0.3 to build the project. I have verified the IDE Proxy settings ,its setup and works fine for other Build tools. Is something missing my SBT installation ?? I tried accessing the failing links in the log and they too are throwing up with errors. "C:\Program Files\Java\jdk1.8.0_131\bin\java" -agentlib:jdwp=transport=dt_socket,address=12805,suspend

Scala类型系统——高级类类型(higher-kinded types)

喜欢而已 提交于 2019-12-22 20:08:27
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 高级类类型就是使用其他类型构造成为一个新的类型,因此也称为 类型构造器(type constructors)。它的语法和高阶函数(higher-order functions)相似,高阶函数就是将其它函数作为参数的函数;高级类类型则是将构造类类型作为参数类型。一个高级类类型可以有一个或者多个类型作为参数。在Scala中,你可以使用type关键字声明,如下: type Callback[T] = Function1[T,Unit] 这里定义了一个高级类类型Callback,该类型接收一个类型 T,并构造一个新的类型Function1。类型Callback不是一个完整的类型,直到它实现了参数化。 Function0,Function1,... 表示接收类型个数1,2,3,... ,如Function0[A],Function1[A,B]... ,一共23个FunctionX。用于定义匿名语法,实现语法糖。 高级类类型可以用于创建复杂类型,如M[N[T,X],Y],但可以看作更简单的类型,F[X]。 Higher-kinded types 除了上面说的用关键字type定义的类型外,高级类类型最常见的实现是使用占位符代替。即F[_],在Scala中,占位符 _ 有特别的意义,可以表示任何东西。 User Story

Declaring a different compile path for CoffeeScript

假装没事ソ 提交于 2019-12-22 18:45:37
问题 I have a Scalatra app that compiles CoffeeScript, using https://github.com/softprops/coffeescripted-sbt, to a default location, target/scala-2.9.1/resource_managed/main/js . I want to put the generated javascripts somewhere available to me publicly, in a folder called src/main/webapp/coffee , but the example given defaults to `/target/...' resourceManaged in (Compile, CoffeeKeys.coffee)) <<= (crossTarget in Compile)(_ / "your_preference" / "js") My build.sbt: seq(coffeeSettings: _*) // doesn

How to make a SBT task depend on a module defined in the same SBT project?

ぐ巨炮叔叔 提交于 2019-12-22 18:36:21
问题 I have module A and module B in a multi-module SBT project. I want to write a resource generator task for module B that invokes code from module A. One way to do this is to pull all the code from module A under project/ but that is unfeasible as module A is massive and I would like to keep it where it is (see https://stackoverflow.com/a/47323703/471136). How do I do this in SBT? Secondly, is it possible to get rid of module B altogether i.e. I want the resource generator task for module A

sbt switch dependencies for runtime

怎甘沉沦 提交于 2019-12-22 18:18:39
问题 I am developing a spark application which is using xgboost4j. https://github.com/dmlc/xgboost/tree/master/jvm-packages This package requires to be compiled to the local architecture due to local C dependencies of the jar. But the cluster has a different architecture than the development laptop. How can I substitute the package when running sbt assembly via one from the cluster? Or would you suggest to solve this via a % "provided" ? 回答1: Use suffix for (provided/compile) libs as like: val

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

余生长醉 提交于 2019-12-22 17:35:11
问题 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