These are chat archives for sbt/sbt

9th
Nov 2016
Nguyễn Văn Viên
@viennv1709
Nov 09 2016 02:33
How to map query string in url to Map[String, String] in Play
Jan Christopher Vogt
@cvogt
Nov 09 2016 02:38
Is this the right room for this question? How about querySyring.split("&").map{ case Seq(key,value) => (key,URLDecoder.decode(value))}.toMap though?
I Guess url decode the keys too
Nguyễn Văn Viên
@viennv1709
Nov 09 2016 02:40
Have any better way
such as using Form in play
because I have many field in query string
Jan Christopher Vogt
@cvogt
Nov 09 2016 02:41
I don't know Play well. How about you ask in the play room not in the sbt room :)?
Nguyễn Văn Viên
@viennv1709
Nov 09 2016 02:42
Oh Thank you
I'm wrong to post in here
Thank you very much
Rob Norris
@tpolecat
Nov 09 2016 05:33
What is the sbt prompt equivalent of scalacOptions in (Compile, doc)?
i.e., show ... what
Really my question is, I want to say scalacOptions in (Compile, doc) += "-no-java-comments" but only for 2.12 because it's an error for earlier versions. this is a cross build
Rob Norris
@tpolecat
Nov 09 2016 05:41
well I figured out the first question ... compile:doc::scalacOptions
Rob Norris
@tpolecat
Nov 09 2016 05:51
got an answer elsewhere. nvm
drhumlen
@drhumlen
Nov 09 2016 11:13
I've recently downloaded and modified an open source library; but the author hasn't accepted my PR yet, so it's not yet published to maven. How do I, in SBT, say that I want to depend on code that's located in either (1) somewhere else on my machine -or- (2) on my github fork; so that I can use my modified version of the library right away?
Dominik Dorn
@domdorn
Nov 09 2016 12:16
sbt publishLocal
Justin Kaeser
@jastice
Nov 09 2016 13:07
@drhumlen in build.sbt:
lazy val projectDep = ProjectRef(uri("git://github.com/author/projectDep"),"projectDep")
dependsOn(projectDep)
(or publishLocal and depend on that)
drhumlen
@drhumlen
Nov 09 2016 13:09

Cool. Thanks! I also got this to work:

val main = (project in file("."))
  .dependsOn(ProjectRef(file("../scalatags-rx"), "scalatags-rx"))

But it's nice to known I have sbt publishLocal and github uri's that I can depend on when I need them

Justin Kaeser
@jastice
Nov 09 2016 13:11
yup!
Dominik Dorn
@domdorn
Nov 09 2016 13:11
wow.. sbt depending on a git project.. serious magic..
Jules Ivanic
@guizmaii
Nov 09 2016 13:19
lol
good to know !
RomanIakovlev
@RomanIakovlev
Nov 09 2016 13:31

Hey good people of SBT! I’m struggling with the IntegrationTest configuration. I have it enabled, but SBT still doesn’t run tests from src/it/scala. Why?
It’s enabled via an auto-plugin in project directory like this:

override def projectConfigurations: Seq[Configuration] = Seq(
    IntegrationTest
  )

It actually used to work, but I moved some code around recently, and upgraded to sbt 0.13.13, so I’m not sure where I’ve lost it.

I actually see the configuration enabled in the project, but it:test says it has nothing to run.
Devis Lucato
@dluc
Nov 09 2016 19:47
pardon the silly question, but is it possible to have the build.sbt file not in the root, but say in the "project" folder ? or viceversa, having the plugins.sbt file in the root? What's the historical reasons to have something in the root and something in a project folder? why not have it all in one place?
RomanIakovlev
@RomanIakovlev
Nov 09 2016 19:48
Project folder is for meta build, i.e. to build the build itself. Hence plugins go there.
turtles!
Matt Hicks
@darkfrog26
Nov 09 2016 20:50
How do I take a FiniteDuration and format it to HH:mm:ss?
Matt Hicks
@darkfrog26
Nov 09 2016 21:04
a little hacky, but this is what I did:
var d = seconds.seconds
    val hours = d.toHours
    d -= hours.hours
    val minutes = d.toMinutes
    d -= minutes.minutes
    f"$hours%02d:$minutes%02d:${d.toSeconds}%02d"
where seconds is a Double of the entire time in seconds.
Dominik Dorn
@domdorn
Nov 09 2016 21:05
I thought it should be possible to convert the finiteduration to a date and just use the normal dateformatter stuff.. but haven’t done that in a while
OlegYch
@OlegYch
Nov 09 2016 21:06
well it's not nowhere near a date
Dominik Dorn
@domdorn
Nov 09 2016 21:06
you tried new Date(yourDuration.toMillis) ?
RomanIakovlev
@RomanIakovlev
Nov 09 2016 21:08
You don't really want to mix duration with date.
Dominik Dorn
@domdorn
Nov 09 2016 21:15
you can also take a look at prettytime .. but its probably the wrong tool to use directly in sbt
http://www.ocpsoft.org/prettytime/
Devis Lucato
@dluc
Nov 09 2016 22:27
@darkfrog26 similarly hacky:
val formatted = { 
  val s = duration.toSeconds
  s"${s / 3600}:${(s % 3600) / 60}:${s % 60}"
}
Matt Hicks
@darkfrog26
Nov 09 2016 22:29
@dluc I like mine better...it's longer, but less "magic numbery" :-p
ritschwumm
@ritschwumm
Nov 09 2016 22:29
can FiniteDurations be negative?
Devis Lucato
@dluc
Nov 09 2016 22:30
I'd run it 10M times and compare the performance :P :P (kidding) @darkfrog26
@ritschwumm yes, and in that case my formula won't work
Matt Hicks
@darkfrog26
Nov 09 2016 22:36
@dluc if I were writing something that actually runs in a tight loop I'd probably opt for your solution, but fortunately that's not what I'm doing. ;)
Devis Lucato
@dluc
Nov 09 2016 22:42
sure, I was just kidding. Readability++
sometimes it's nice to solve these little problems because it takes me through scala libs source code
OlegYch
@OlegYch
Nov 09 2016 22:47
going through libs source code should be the default modus operandi