These are chat archives for sbt/sbt

19th
Sep 2016
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 07:59
Hi. When I start SBT with system property, e.g. sbt -Dfoo=bar I always get Warning: invalid system property 'foo' and exception. I have to call sbt -D"foo=bar". Why?
Dale Wijnand
@dwijnand
Sep 19 2016 08:09
@gslowikowski can you share the exception? I can't reproduce it.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:17
https://gist.github.com/gslowikowski/ac115b0ec17f84f5d0630900f9089ef2 Exception is thrown because system property wasn't properly passed to SBT
I'm testing manually one scripted test
Dale Wijnand
@dwijnand
Sep 19 2016 08:20
Oh on Windows.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:20
yes
is this known problem?
Dale Wijnand
@dwijnand
Sep 19 2016 08:20
There have been recent fixes in the script there, can you try the sbt 0.13.13-RC1 release?
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:20
ok
Dale Wijnand
@dwijnand
Sep 19 2016 08:20
I would need to check the issue tracker, I'm not sure.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:20
thanks
Dale Wijnand
@dwijnand
Sep 19 2016 08:21
Otherwise feel free to open an issue: https://github.com/sbt/sbt-launcher-package
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:22
BTW, can you create 1.0.0 tag. I wanted to get launcher sources to debug this problem, but there is only v1.0.0-M1 tag
I mean git repo tag
It's already there
oh oops
ok I'll tag sbt/launcher@3eee3f0
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 08:25
great, thanks
nguruwe55
@nguruwe55
Sep 19 2016 09:28
Hi all, wondered if anyone has a working solution for this StackOverflow question? http://stackoverflow.com/questions/39509629/how-to-create-a-custom-sbt-task-that-sets-java-options-before-running-the-app
There are a couple of answers, but neither do the trick unfortunately
Miles Sabin
@milessabin
Sep 19 2016 11:02
@gslowikowski can you say what you're trying to do here? Why not use project/plugins.sbt to load plugins?
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 11:05
@milessabin I've run one of my scripted tests manually and didn't want to modify this lines
test was hanging, but I couldn't find a log file showing what's going on
Dale Wijnand
@dwijnand
Sep 19 2016 11:06
@gslowikowski you're aware there's a $ pause feature in scripted, which gives you the directory?
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 11:08
If there is a bug in e.g. build.sbt SBT hangs and waits for input from the console (q-quit, etc.). In forked test I cannot find, where is the console output redirected
Miles Sabin
@milessabin
Sep 19 2016 11:09
I'm sure @dwijnand can suggest a better method, but I've found that output from scripted tests is swallowed unless there's an error. So for debugging I've added a bogus command at the end of the script.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 11:09
Looked in temporary directory created by scripted, but couldn't find
Dale Wijnand
@dwijnand
Sep 19 2016 11:10
@milessabin scriptedBufferLog := false
Miles Sabin
@milessabin
Sep 19 2016 11:10
I wish I'd known that :-)
Dale Wijnand
@dwijnand
Sep 19 2016 11:10
:)
I wish I'd known that too, for the times before I knew that :)
@gslowikowski task output is in target/streams/
Miles Sabin
@milessabin
Sep 19 2016 11:10
Is that documented anywhere? I don't remember seeing it in the scripted README.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 11:11
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 12:32
I want to get coverage report for all Scala versions in one execution. required command sequence is: coverage test coverageReport
Tried with no luck:
  1. sbt clean +coverage +test +coverageReport- no coverage data,
  2. sbt clean +";coverage;test;coverageReport" - but it's not proper syntax,
  3. create alias addCommandAlias("mycov", ";coverage;test;coverageReport") and call sbt clean +mycov- ignored + sign and generated report for scalaVersion only.
    How to do it properly?
Dale Wijnand
@dwijnand
Sep 19 2016 12:35
Try addCommandAlias("mycov", ";coverage;+test;coverageReport")
which should also work as sbt clean coverage +test coverageReport
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 12:40
It doesn't work. coverage is a command toggiling boolean flag, with it turned on, the ode is instrumented. With your proposal, code is not instrumented at all (+test doesn't see the state changed by coverage, like there was no coverage command at all)
and coverageReport tries to generate report for one Scala version only (but it skips, because there is no scoverage data)
BennyHill
@BennyHill
Sep 19 2016 12:41
I did a PR already for this scoverage/sbt-scoverage#182
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 12:42
So what's the call syntax with your PR?
(use system property indtead of coverage command?)
And we discussed it here https://gitter.im/scoverage/scoverage
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 12:48
Different question - if ;coverage;test;coverageReport sequence can properly use the same build state (it works now), there should be the way to fire multiple such sequences for different Scala versions, right?
@BennyHill , I mean, even without your changes to coverage command
BennyHill
@BennyHill
Sep 19 2016 12:49
Sorry, I'm busy as I have some other issues I am working on
Dale Wijnand
@dwijnand
Sep 19 2016 12:50
the facility to do cross versions is the + command followed by a task, like compile or test. But it won't work with coverage as it's a command.
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 13:21
Thank's Dale. Would it work with series of tasks, like ;test;it-test?
Is series of tasks treated as a task?
Dale Wijnand
@dwijnand
Sep 19 2016 13:31
no, but creating a task to run a sequence of tasks is trivial
Def.sequential(..)
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 13:32
sure
thx
Grzegorz Slowikowski
@gslowikowski
Sep 19 2016 13:58
I tried sbt clean coverage +mycov, where mycov is defined as mycov := Def.sequential(test in Test, coverageReport).value but it does not generate coverage info. My task doesn't see changes in build state made by coverage command.
nscarcella
@nscarcella
Sep 19 2016 18:30
Hello guys, I left a question on StackOverflow regarding an issue I have with SBT compile order and it would be great if someone here could give me a hand understanding it: https://stackoverflow.com/questions/39579764/plugins-compile-order-in-sbt
Redrield
@Redrield
Sep 19 2016 20:43
Can anyone help me figure out why this build file won't work? https://gist.github.com/Redrield/187169934d829a236632af454b24cdaa
And the repository/dependency that I'm using works fine with things like gradle or maven. It's just sbt that's giving me grief