These are chat archives for sbt/sbt

9th
Jan 2017
nafg
@nafg
Jan 09 00:54
@aholland even if you have multiple projects you're not recompiling all of them all the time. I would go with the better processor.
@aholland that's not the only thing either. SSD makes a big difference in compile time (presumably faster SSD is even better). Plenty of RAM (the type of RAM might matter too, not familiar enough to say)
Guillaume Martres
@smarter
Jan 09 02:09

Is there a better way to write this?

org.ensime.EnsimeKeys.ensimeServerJars := Def.taskDyn {
  if (scalaVersion.value.startsWith("0.1")) {
    Def.task { Seq[File]() }
  }
  else {
    Def.task { org.ensime.EnsimeKeys.ensimeServerJars.value }
  }
}.value

The point is that I only want org.ensime.EnsimeKeys.ensimeServerJars.value to be evaluated if scalaVersion.value.startsWith("0.1") is false, but if I don't wrap everything through taskDyn and task, it will be eagerly evaluated (sbt still makes no sense to me)

Guillaume Martres
@smarter
Jan 09 03:07
Separate question: is there a way to tell sbt to mark a dependency as optional? I want to do libraryDependency += foo but not to stop with an error if foo is not found
Or perhaps only conditionally adding the dependency? if (foo is present) libraryDependency += foo ?
Tim Moore
@TimMoore
Jan 09 03:31
I think the latter would be another dynamic task
Oh, sorry, libaryDepencies is a setting, not a task
Tim Moore
@TimMoore
Jan 09 03:42
What are you using the optional dependency for? Do you just want to manage certain jars manually? http://www.scala-sbt.org/0.13/docs/Library-Management.html#Manual+Dependency+Management
or maybe you want to use a custom configuration http://www.scala-sbt.org/0.13/docs/Library-Management.html#Configurations
Tim Moore
@TimMoore
Jan 09 03:48
oh, looks like it supports an “optional” configuration out of the box http://stackoverflow.com/questions/37883459/optional-dependency-in-sbt
Loki Coyote
@lokkju
Jan 09 08:00
should I be able to use SettingKey.value within a SettingKey transformation? i.e., with a mySettingKey ~= {}, I want to get the value of another SettingKey. compiler is throwing a "error: value can only be used within a task or setting macro, such as :=, +=, ++=, Def.task, or Def.setting."
Mirco Dotta
@dotta
Jan 09 12:10
@smarter About your first question, the way you have done it is the one I know to avoid eager evaluation. If you don’t wrap “things” in a taskDyn then both tasks are evaluted because of sbt parallel task evaluation.
Anthony Holland
@aholland
Jan 09 12:31
@nafg yes, for SSDs and RAM the choice is clear. For the processor, the meaning of "better" depends on the nature of the task.
anahita91
@anahita91
Jan 09 13:14

Dear friends,

I am trying to run a run a spark code on Google cloud using submit job.
https://cloud.google.com/dataproc/docs/tutorials/spark-scala

My question is about the part "argument".
In my spark code, they are some variables that their values are defined in a shell file (.sh), as following:

--trainFile=small_train.dat \
--testFile=small_test.dat \
--numFeatures=9947 \
--numRounds=100 \

  • I have tried to enter only the values and each value in a separate box as following but it is not working:

data/small_train.dat
data/small_test.dat
9947
100

I have also tried to give the parameters like in this below, but it is not working neither:
trainFile=small_train.dat
testFile=small_test.dat
numFeatures=9947
numRounds=100

I added the files small_train.dat and small_test.dat in the same bucket where I saved the .jar file. Let's say if my bucket is named test, I added spark.jar, small_train.dat and small_test.dat in the bucket "test".

Does anyone know, how I can enter these values in the argument part?

Thanks

Li Haoyi
@lihaoyi
Jan 09 18:29
Anyone know if it's possible to add additional files into an sbt-assembly fat-jar?
I have a project that depends on a Scala.js subproject's fastOpt javascript for normal development, but I want to include the fullOpt javascript when I jar everything up
whether I include the fastOpt javascript file when jarring things doesn't matter, but I don't want to include the fullOpt javascript file during development because it's slow
Daniel Cazares
@danielchristiancazares
Jan 09 22:18
@lihaoyi How is what you want to do different from including it in the resources folder?
Maksym Besida
@mbesida
Jan 09 23:42
Having multimodule project, if project a(scalaVersion 2.12) depends on project b(scalaVersion 2.11) how to define such dependency in build.sbt?
simply dependsOn(b) doesn't find dependency