sbt

Set current project to default-6c6f02 (in build file:/home/user_name/Videos/ [duplicate]

可紊 提交于 2021-02-19 07:21:37
问题 This question already has an answer here : Why is sbt current project name “default” in 0.10? (1 answer) Closed 6 years ago . what does it mean when running sbt command in command line in scala . Set current project to default-6c6f02 (in build file:/home/user_name/Videos/ what should i set after this statement? 回答1: This happens if you call sbt command in the folder where you don't have built. sbt or project/Build.scala , as i understand in your case it's /home/user_name/Videos/ . And because

java.lang.NoSuchMethodException: scala.collection.immutable.$colon$colon

你离开我真会死。 提交于 2021-02-19 06:30:55
问题 I am trying to call a function using a variable as String type dynamically i.e. variable will contain a function name as String. So, I need to call a function using that variable. So, I am using Scala Reflection. It is working if the function is accepting datatype as Sting, But it is throwing error List[Map[String, Double]] I used below link to refer a code Is there any Scala feature that allows you to call a method whose name is stored in a string? and below is a test program which I am

How to add Scala compiler plugin only for test sources

核能气质少年 提交于 2021-02-19 06:14:58
问题 Is it possible to add a Scala compiler plugin only when compiling test sources? When a compiler plugin is added by calling SBT's addCompilerPlugin then a library dependency is added. The relevant methods are: /** Transforms `dependency` to be in the auto-compiler plugin configuration. */ def compilerPlugin(dependency: ModuleID): ModuleID = dependency.withConfigurations(Some("plugin->default(compile)")) /** Adds `dependency` to `libraryDependencies` in the auto-compiler plugin configuration. *

How to add Scala compiler plugin only for test sources

江枫思渺然 提交于 2021-02-19 06:14:34
问题 Is it possible to add a Scala compiler plugin only when compiling test sources? When a compiler plugin is added by calling SBT's addCompilerPlugin then a library dependency is added. The relevant methods are: /** Transforms `dependency` to be in the auto-compiler plugin configuration. */ def compilerPlugin(dependency: ModuleID): ModuleID = dependency.withConfigurations(Some("plugin->default(compile)")) /** Adds `dependency` to `libraryDependencies` in the auto-compiler plugin configuration. *

How to add Scala compiler plugin only for test sources

≯℡__Kan透↙ 提交于 2021-02-19 06:14:15
问题 Is it possible to add a Scala compiler plugin only when compiling test sources? When a compiler plugin is added by calling SBT's addCompilerPlugin then a library dependency is added. The relevant methods are: /** Transforms `dependency` to be in the auto-compiler plugin configuration. */ def compilerPlugin(dependency: ModuleID): ModuleID = dependency.withConfigurations(Some("plugin->default(compile)")) /** Adds `dependency` to `libraryDependencies` in the auto-compiler plugin configuration. *

Scala sbt file dependency from github repository

浪尽此生 提交于 2021-02-19 05:20:14
问题 Is it possible to include a dependency from github? The repository does not have a jar file, just a build.sbt file and a source folder. 回答1: You can create a new project which points to the source in your build.sbt and then use dependsOn : lazy val projectIDependOn = RootProject(uri("git://github.com/user/Project.git")) lazy val myProject = project in file("my-project").dependsOn(projectIDependOn) An alternative approach would be to clone to github repository and then use sbt-assembly to

Scala sbt file dependency from github repository

断了今生、忘了曾经 提交于 2021-02-19 05:20:13
问题 Is it possible to include a dependency from github? The repository does not have a jar file, just a build.sbt file and a source folder. 回答1: You can create a new project which points to the source in your build.sbt and then use dependsOn : lazy val projectIDependOn = RootProject(uri("git://github.com/user/Project.git")) lazy val myProject = project in file("my-project").dependsOn(projectIDependOn) An alternative approach would be to clone to github repository and then use sbt-assembly to

How do I start a server before running a test suite in SBT?

孤人 提交于 2021-02-19 04:23:07
问题 Problem is that if I do test in Test <<= (taskA, taskB) { (A, B) => A doFinally B or test in Test := (taskB dependsOn taskA).value and taskA is forked , then sbt execution doesn't continue to taskB and get's stuck indefinitely. It's caused by doFinally/dependsOn , because they probably makes it a single-threaded sequential execution. But I can't find any other way to order those 2 tasks, to make them run sequentially. So far I've gotten this far : lazy val startServer = taskKey[Unit]("Start

scala issue with reading file from resources directory

此生再无相见时 提交于 2021-02-17 02:44:47
问题 I wrote something like this to read file from resource directory: val filePath = MyClass.getClass.getResource("/myFile.csv") val file = filePath.getFile println(file) CSVReader.open(file) and the result I got was something like this: file:/path/to/project/my_module/src/main/resources/my_module-assembly-0.1.jar!/myFile.csv Exception in thread "main" java.io.FileNotFoundException: file:/path/to/project/my_module/src/main/resources/my_module-assembly-0.1.jar!/myFile.csv (No such file or

How to automatically increment version number from my sbt and uploaded to git

故事扮演 提交于 2021-02-16 16:41:25
问题 How do I can increment project version number from my build.sbt file so that when you compile it automatically uploads to git? 回答1: The sbt-release plugin will do all of this for you. If you issue the command sbt release from the command line, this plugin will remove the -SNAPSHOT suffix, tag, commit and push the changes to your repository, build, test and release the artifact, then update the version version number (adding the -SNAPSHOT suffix back again), committing the changes once more.