sbt

pick up different source file for different Scala version

廉价感情. 提交于 2021-02-04 20:01:11
问题 Hi I would like to know if using SBT is possible to cross compiling against different Scala version using different sources for some classes. To keep back compatibility basically but leverage also on the new language features. Thanks. 回答1: You can add additional source directories based on scala version by adding to the unmanagedSourceDirectories setting. Something like this: unmanagedSourceDirectories in Compile <+= (scalaVersion, sourceDirectory in Compile) { case (v, dir) if v startsWith

Scala read method annotations from another project

旧城冷巷雨未停 提交于 2021-01-29 16:14:53
问题 I have a sbt config with scala play! server, a scalajs client, and shared project which contains classes which are passed between the two. I want my client to have strong type information for the server API calls so I'm writing a task that for each route in the routes file builds a corresponding method in the client. I have a prototype that is able to parse almost all of the information I need out of the routes file. The only thing I can't get is return types. Here's what I have so far (I

project folder in sbt

走远了吗. 提交于 2021-01-29 06:10:59
问题 I understand that in an sbt project, sbt generates a folder called project containing build.properties and plugins.sbt . Now if I have one project that has multi subprojects, should I have only one folder called project in the root project or different folders named project foreach subproject? 回答1: You should have only one project folder. You can read about it at Multi-project builds in sbt documentation. For example, to the following sbt: name := "new_proj" version := "0.1" scalaVersion :=

sbt run/debug configuration broken showing unknown after upgrading intellij to 2020.1

情到浓时终转凉″ 提交于 2021-01-29 05:10:25
问题 I just upgraded IntelliJ community edition to latest version 2020.1 as of today. All my SBT run/debug configurations are broken and currently show Unknown under Edit configuration. I have checked the workspace.xml and configuration seems correct. I have also checked I've got the latest SBT plugin. Any help or pointers will be much appreciated as I have dozens of projects with lots of configurations so will be annoying to have to create them again. 回答1: After a couple of hours finally figure

sbt/sbt : no such file or directory error

爱⌒轻易说出口 提交于 2021-01-28 12:42:12
问题 I'm trying to install spark in my ubuntu machine. I have installed sbt and scala. I'm able to view their versions. But, when I try to install spark using 'sbt/sbt assembly' command, i get the below error. 'bash: sbt/sbt: No such file or directory' Can you please let me know where I am making a mistake. I have been stuck here since yesterday. Thank you for the help in advance. 回答1: You may had downloaded the pre-built version of Spark. If its a pre-built you dont need to execute built tool

Unresolved Dependencies sbt with play framework

南楼画角 提交于 2021-01-28 09:14:32
问题 As i am new to Stack Overflow please be patient i am working on a project with Play 2.5 exactly the starter example from the Website. As i have to work with ebean i followed the Steps of Setting ebean in the plugins.sbt as like addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.0") and also in my build.sbt file name := """play-java""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean) scalaVersion := "2.11.11" libraryDependencies +=

An exception or error caused a run to abort: org.mockito.internal.progress.ThreadSafeMockingProgress.mockingProgress()L

做~自己de王妃 提交于 2021-01-28 09:02:01
问题 My environment is Intellij, SBT, Scala and Play. What might be causing the following exception? It doesn't happen all the time. At times I am unable to run my test cases due to the following exception. I am using "org.mockito" % "mockito-core" % "2.24.5" % "test", I suspect there might be some library mismatch or inconsistency but I can't figure out what it is? I have tried to clean/recompile the project (sbt) but haven't been able to solve the issue. An exception or error caused a run to

What's the difference between :, :: and / in SBT?

℡╲_俬逩灬. 提交于 2021-01-28 00:18:56
问题 I was trying to recall whether it was test:compile , test::compile or test/compile that I wanted while doing something on SBT, when it struck me that though I have some intuition on which separator to use for what, I don't have a clear notion of what each separator is used for. So, when typing tasks on the sbt console, when/for what do I use : , :: and / ? 回答1: Different separators were used for different scope axis: single colon : follows a configuration axis double colon :: follows a task

Make one sbt config depend on another

折月煮酒 提交于 2021-01-27 07:36:16
问题 The sbt documentation shows example of how to declare dependency only between projects. But I'm positive that there are ways to declare one config be dependent on another, just like the Test configuration uses classpath from the Compile configuration. How can I declare my own configuration so that it would depend on the Compile config generated classpath? I take a more close look to suggested solution and bunch of question arose again. So I reopen the question I can not deduce sbt behavior

Make one sbt config depend on another

不想你离开。 提交于 2021-01-27 07:34:17
问题 The sbt documentation shows example of how to declare dependency only between projects. But I'm positive that there are ways to declare one config be dependent on another, just like the Test configuration uses classpath from the Compile configuration. How can I declare my own configuration so that it would depend on the Compile config generated classpath? I take a more close look to suggested solution and bunch of question arose again. So I reopen the question I can not deduce sbt behavior