These are chat archives for sbt/sbt

8th
Nov 2016
Eric Torreborre
@etorreborre
Nov 08 2016 11:19
this should be a beginner question. I am trying to remove deprecation warnings in sbt 0.13.13. In particular I have a Task[Tests.Output] which I would like to assign to a TaskKey[Tests.Output]but I can't find the right operator to do this. Anyone has an idea?
Dale Wijnand
@dwijnand
Nov 08 2016 11:25
@etorreborre .value on the Task while using :=
Eric Torreborre
@etorreborre
Nov 08 2016 11:26
The task itself is using other .value like (streams in Test).value so I get
error: Illegal dynamic dependency
    (streams in Test).value,
Adam Warski
@adamw
Nov 08 2016 11:30

hey, this probably popped up before but google isn't very helpful when it comes to gitter ... I'm trying out the new sbt new, but it seems there's no "default template".

is there some place which lists templates? Or is there a template for a "plain", traditional scala application?

Dale Wijnand
@dwijnand
Nov 08 2016 11:38
@adamw we mentioned https://github.com/eed3si9n/hello.g8 in the release notes (sbt new eed3si9n/hello.g8) but a good plain, traditional scala application template is https://github.com/scala/scala-seed.g8 sbt new scala/scala-seed.g8
@etorreborre Then you might need to wrap it in Def.taskDyn
Adam Warski
@adamw
Nov 08 2016 11:40
@dwijnand ah great, that's what I was looking for, thanks! :) I was wondering if the eed3si9n/hello.g8 is the "official" one or just an example (not anything against eed3si9n, but scala/scala-seed looks like the right thing to use ;) )
Eric Torreborre
@etorreborre
Nov 08 2016 11:41

@dwijnand I tried different variations on

  task := Def.taskDyn(Defaults.allTestGroupsTask(
    (streams in Test).value,
    (loadedTestFrameworks in Test).value,
    (testLoader in Test).value,
    (testGrouping in Test in test).value,
    (testExecution in Test in task).value,
    (fullClasspath in Test in test).value,
    (javaHome in test).value
  )).value

but nothing seems to compile

Dale Wijnand
@dwijnand
Nov 08 2016 11:41
@adamw I don't know, they're pretty similar, but I think we want to make scala-seed the official one
Adam Warski
@adamw
Nov 08 2016 11:41
maybe it would be a good idea to use scala-seed in the docs (http://www.scala-sbt.org/0.13/docs/sbt-new-and-Templates.html) instead of eed3si9n/hello.g8? (if the site is PR-able I can do that :) )
Dale Wijnand
@dwijnand
Nov 08 2016 11:41
and thank you :)
Adam Warski
@adamw
Nov 08 2016 11:41
thanks :)
Dale Wijnand
@dwijnand
Nov 08 2016 11:42
@etorreborre try
-)).value
+).value).value
Eric Torreborre
@etorreborre
Nov 08 2016 11:43
still not doing it
found   : sbt.Tests.Output
 required: sbt.Def.Initialize[sbt.Task[?]]
  task := Def.taskDyn(Defaults.allTestGroupsTask(
Dale Wijnand
@dwijnand
Nov 08 2016 11:53
@etorreborre what did it look like before the migration?
Eric Torreborre
@etorreborre
Nov 08 2016 11:55
it was
task <<= (
streams in Test, 
loadedTestFrameworks in Test, 
testLoader in Test,
testGrouping in Test in test, 
testExecution in Test in task,
fullClasspath in Test in test, 
javaHome in test) flatMap Defaults.allTestGroupsTask
Note that the whole thing is to be able to create custom "testOnly" tasks with specific arguments
def testTaskDefinition(task: TaskKey[Tests.Output], options: Seq[TestOption]) =
  Seq(testTask(task))                          ++
    inScope(GlobalScope)(defaultTestTasks(task)) ++
    inConfig(Test)(testTaskOptions(task))        ++
    (testOptions in (Test, task) ++= options)
there might be a better way to do that now in sbt
Dale Wijnand
@dwijnand
Nov 08 2016 12:00
@etorreborre sorry, do you have a handy definition of setting testExecution in Test in task?
Eric Torreborre
@etorreborre
Nov 08 2016 12:01
sorry I don't understand your question
I don't any redefinition of testExecution in Test in task in my build file if that's what you mean
Dale Wijnand
@dwijnand
Nov 08 2016 12:02
np, found this that removes my undefined setting problems:
Defaults.defaultTestTasks(task1)
testExecution in Test in task1 := Defaults.testExecutionTask(task1).value
pingbat
@pingbat
Nov 08 2016 12:39
My SBT 0.13.13 seems to be using Scala 2.10.6 but scala-compiler and scala-reflect 2.10.4 on the classpath when that java.lang.NoSuchMethodError: scala.reflect.internal.TreeInfo.isConstructorWithDefault(Lscala/reflect/internal/Trees$Tree;)Z happens
is that a bad ivy or pom cache somewhere? should it all be 2.10.6? How can I force it?
pingbat
@pingbat
Nov 08 2016 13:05
We're also using a Nexus proxy to make it harder to find. If I overwrite the scala-compiler and scala-reflect 2.10.4 jars with 2.10.6 (renamed) in my ivy cache it all works
christobill
@christobill
Nov 08 2016 13:32

Hey all,
I am trying to use paths in sbt. But I get the following deprecation warning:

[warn] /home/christophe/Development/sbt-cassandra/src/main/scala/com/misterbell/SbtCassandra.scala:39: method / in class RichFileSetting is deprecated: Use a standard setting definition.
[warn]     cassandraHome       := (cassandraPluginDir / "cassandra").value,
[warn]

But still, I am following sbt guide: http://www.scala-sbt.org/0.13/docs/Paths.html
What am I missing?

Jules Ivanic
@guizmaii
Nov 08 2016 13:33
cassandraPluginDir.value / « cassandra » ?
Dale Wijnand
@dwijnand
Nov 08 2016 13:34
yeah
christobill
@christobill
Nov 08 2016 13:36
Thanks @guizmaii !
Jules Ivanic
@guizmaii
Nov 08 2016 13:36
:)
de nada ;)

Anyone for my problem:

I’m trying to do something like this:

lazy val npmStart = taskKey[Unit]("run npm start for dev env")
npmStart := {
  val frontendDir: File = baseDirectory.value / frontEndName
  Process("npm install", frontendDir) #> (frontendDir / "install.log") #&& Process("npm start", frontendDir) run
}
(runAll in ThisBuild) <<= { npmStart runBefore (runAll in ThisBuild) }

The command runAll is never launched because npm start does not end. Is there a way to « simulate » its end ?
FYI, I know that it can be done like this:

(runAll in ThisBuild) <<= { (runAll in ThisBuild) dependsOn(npmStart)  }

but with this solution it’s launched at the same time as runAll and I don’t want this behavior.
it’s aslo not a good solution because if npm start fail, runAll will continue

???

Eric Torreborre
@etorreborre
Nov 08 2016 14:08
@dwijnand should I open an issue on github for my problem?
Dale Wijnand
@dwijnand
Nov 08 2016 14:09
open a stackoverflow question is better for these kind of problems
I'll try and work on it after hours (if noone gets to it before me)
@eed3si9n might know as well, he might be able to help you in a bit
Eric Torreborre
@etorreborre
Nov 08 2016 14:16
ok, thanks
Justin Kaeser
@jastice
Nov 08 2016 14:25
I'm guessing there is no updated version of sbt-cross-building plugin that works with current sbt versions?
Dale Wijnand
@dwijnand
Nov 08 2016 14:26
Current as in cross-building between 0.13.13 and 1.0...something?
Justin Kaeser
@jastice
Nov 08 2016 14:26
as in working in a 0.13.13 build
also a version of the plugin that ubilds at all, because its dependencies have gone missing xD
cross-building is incompatible with 0.13.11+
Dale Wijnand
@dwijnand
Nov 08 2016 14:27
I've never worked with sbt-cross-building
Justin Kaeser
@jastice
Nov 08 2016 14:28
is there some cool new settings that make it superfluous?
Dale Wijnand
@dwijnand
Nov 08 2016 14:28
no, it might be necessary
for 0.13 -> 1.0 migration
but it might also be impossible
any ideas what broke it in 0.13.11?
Justin Kaeser
@jastice
Nov 08 2016 14:29
[error] (extractor/*:allDependencies) java.lang.NoSuchMethodError: sbt.ScalaArtifacts$.toolDependencies(Ljava/lang/String;Ljava/lang/String;)Lscala/collection/Seq;
[error] Total time: 4 s, completed Nov 8, 2016 1:56:05 PM
> last extractor/*:allDependencies
java.lang.NoSuchMethodError: sbt.ScalaArtifacts$.toolDependencies(Ljava/lang/String;Ljava/lang/String;)Lscala/collection/Seq;
    at sbt.SbtCrossCompat$$anonfun$allDependenciesSetting$1.apply(SbtCrossCompat.scala:14)
that method is now private
it's not a blocker for now, I can crossbuild from 0.13.9
sbt-cross-building is a bad citizen :)
Justin Kaeser
@jastice
Nov 08 2016 14:34
a-ha!
pingbat
@pingbat
Nov 08 2016 15:15
I found the problem, my root project's "project" directory had a build.sbt which had scalaVersion pinned to 2.10.4. All working now I've removed that.
Justin Kaeser
@jastice
Nov 08 2016 16:13
What's the reason behind this deprecation notice:
@deprecated("Only `allJars` and `jars` can be reliably provided for modularized Scala.", "0.13.0")
jars is just a concatenation of the deprecated field values