These are chat archives for sbt/sbt

13th
May 2016
Perry
@pfn
May 13 2016 02:15
@eed3si9n, so, 1.0.0 is gonna break sbt-android huh :(
eugene yokota
@eed3si9n
May 13 2016 02:16
1.0.0-M4 is really just a beta
sort of the first step to try it out, and get more feedback
Perry
@pfn
May 13 2016 02:18
I'll try to build with it tomorrow morning and see the lols
eugene yokota
@eed3si9n
May 13 2016 02:18
I'm currently porting bintray-sbt, so I can try on sbt-assembly
Marius B. Kotsbak
@mkotsbak
May 13 2016 05:35
When can we expected sbt built with scala-native? :)
Is it using any java or reflection that would prohibit that?
Marius B. Kotsbak
@mkotsbak
May 13 2016 05:42
I guess it is using Java IO libs heavily so they needs to be ported to a new lib with C backing.
Dale Wijnand
@dwijnand
May 13 2016 08:20
It's using a lot of everything there, but it would be a very interesting project to try and ship
Marius B. Kotsbak
@mkotsbak
May 13 2016 09:07
Japp, maybe avoid waiting 5 minutes for sbt to boot
Sam Halliday
@fommil
May 13 2016 15:06
is there a way to have an aggregate Task, which depends on a Task that is only evaluated once?
my usecase is: I want to do some I/O (some git log parsing) and then pass the result of that down to each project. But I don't want each project to redo the I/O work.
Perry
@pfn
May 13 2016 15:19
so just depend on the task defined once
it won't be repeated for any aggregated run
koertkuipers
@koertkuipers
May 13 2016 15:58
why does "sbt clean publish" not run tests? do we really want someone to be able to publish without having run unit tests?
Sam Halliday
@fommil
May 13 2016 15:58
@pfn I'm not sure I follow
Perry
@pfn
May 13 2016 15:59
I don't understand what you're asking, this happens automatically already
Sam Halliday
@fommil
May 13 2016 15:59
you mean have something like (myExpensiveTask in ThisBuild).value rather than myExpensiveTask.value ?
Dale Wijnand
@dwijnand
May 13 2016 15:59
@koertkuipers publish is the pure definition of publish, perhaps you want to use sbt-release to setup a sequence of events to happen to make a release
Sam Halliday
@fommil
May 13 2016 16:00
I'm pretty sure that still runs it again every time
eugene yokota
@eed3si9n
May 13 2016 16:13
@fommil I think it's deduplicated
lazy val foo = taskKey[Unit]("")
lazy val bar = taskKey[Unit]("")

lazy val root = (project in file(".")).
  aggregate(app1, app2).
  settings(inThisBuild(List(
    foo := { println("foo") }
    )),
    bar := ()
  )

lazy val app1 = (project in file("app1")).
  settings(
    bar := {
      (foo in ThisBuild).value
      println("app1/bar")
    }
  )

lazy val app2 = (project in file("app2")).
  settings(
    bar := {
      (foo in ThisBuild).value
      println("app2/bar")
    }
  )
the output:
root> bar
foo
app2/bar
app1/bar
[success] Total time: 0 s, completed May 13, 2016 12:13:09 PM
Perry
@pfn
May 13 2016 16:21
in any given task graph, a task only runs once
unless you have it defined in duplicate across projects
Joseph Price
@joprice
May 13 2016 16:28
if i have root.configs(CustomConfig), how do I move that into an AutoPlugin, so that the user doesn’t have to call that directly on a project?
Sam Halliday
@fommil
May 13 2016 16:48
@pfn @eed3si9n sweet, that's exactly what I want
Maxim Karpov
@makkarpov
May 13 2016 18:37
When I try to refresh SBT project, IDEA uses sbt 0.13.5, which breaks by configs (since they are not separated by blank line anymore). When I try to execute SBT task from IDEA, it shows me correct version 0.13.11. Problem appeared after I enabled Play 2 integration. How to let IDEA use the correct version? (it's actually not SBT issue, but I think that some IDEA users are definitely chatting in this room)
Dale Wijnand
@dwijnand
May 13 2016 18:40
for starters don't use the sbt plugin in IntelliJ
it's old, and the behaviour has been folded into the scala plugin
so that might be why things are old and braking things
Maxim Karpov
@makkarpov
May 13 2016 18:46
I use Scala plugin, and this issue still happens
Perry
@pfn
May 13 2016 19:15
put in build.properties
build.properties defines what version of sbt to use
if you don't have one, it will default to the version of sbt-launch.jar that is bundled with IDEA
Maxim Karpov
@makkarpov
May 13 2016 19:15
It's set to 0.13.11
IDEA uses right version except one specific case - importing of SBT project with enabled Play integration
pfn @pfn shrugs
Calvin Lee Fernandes
@calvinlfer
May 13 2016 19:16
the Play test portion doesnt work properly
Perry
@pfn
May 13 2016 19:16
I blame play
Maxim Karpov
@makkarpov
May 13 2016 19:16
Maybe I can change default one, however. Just change bundled config?
Perry
@pfn
May 13 2016 19:16
they can't seem to setup a correct sbt build
this is what happens for me
the actual implementation highlights correctly, the tests don’t :-(
Maxim Karpov
@makkarpov
May 13 2016 19:18
Can I change default SBT version? I don't see any bundled file in sbt-launch.jar
Sam Halliday
@fommil
May 13 2016 19:19
how does one get the resource files for a project after filtering, I want the actual Seq[File] where each File is a file with a relative path from its base
Perry
@pfn
May 13 2016 19:19
@makkarpov replace sbt-launch.jar with one from 0.13.11
or you can just change your IDEA settings to point to a recent sbt-launch.jar
Sam Halliday
@fommil
May 13 2016 19:20
oh, ffs, it's just resources
hmm, no its not. That is a directory
there must be a task I have to run to get the a) filtered files b) relative paths
Maxim Karpov
@makkarpov
May 13 2016 19:25
Weird IDEA bug, I even replaced default IDEA sbt-launch with 0.13.11, and set custom SBT launcher in settings. Still happens, wow.
Perry
@pfn
May 13 2016 19:48
then something has set 0.13.5 as sbt.version
IDEA doesn't do anything special, it just runs sbt against your project while loading sbt-structure.jar
@fommily copyResources
Sam Halliday
@fommil
May 13 2016 19:49
@pfn that has some hints in it about what to do, but it's not what I want
I'm just writing my own task
Perry
@pfn
May 13 2016 19:49
huh?
allResourceFiles := copyResources.value.map(_._2)
Maxim Karpov
@makkarpov
May 13 2016 19:50
Also, more SBT-specific question
Sam Halliday
@fommil
May 13 2016 19:50
@pfn oh, with the side effect of actually copying the files...
Maxim Karpov
@makkarpov
May 13 2016 19:50
How to avoid resolve errors on source and javadocs jars on Maven?
Sam Halliday
@fommil
May 13 2016 19:50
and compiling your code..
Perry
@pfn
May 13 2016 19:50
copyResources doesn't depend on compile
Sam Halliday
@fommil
May 13 2016 19:50
because resources is managed and unmanaged
yes it does, I have seen it
Perry
@pfn
May 13 2016 19:50
then it's a plugin that does it
Sam Halliday
@fommil
May 13 2016 19:50
nope
Perry
@pfn
May 13 2016 19:51
neat, discoveredSbtPlugins depends on compile, wtf is that
> keypath resources compile
[info] Searching for: sbt/compile:resources <- sbt/compile:compile
.........
[info] sbt/compile:resources
[info]   +-- sbt/compile:managedResources
[info]   +-- sbt/compile:resourceGenerators
[info]   +-- sbt/compile:discoveredSbtPlugins
[info]   +-- sbt/compile:compile
Sam Halliday
@fommil
May 13 2016 19:52
yeah, that sounds about right
Perry
@pfn
May 13 2016 19:52
oh well
can't know all the resource file names without running resourceGenerators in any case
I wonder why discoveredSbtPlugins depends on compile, is it an artifact of allowing plugins in project/
Sam Halliday
@fommil
May 13 2016 19:53
there is also no way to rebase to get the relative path, it insists on doing it relative to a File
I only care about the unmanaged resources, because my project doesn't have resource generators
Perry
@pfn
May 13 2016 19:53
relativeResourcesPaths := copyResources.value.map(_._2 relativeTo baseDirectory.value)
Sam Halliday
@fommil
May 13 2016 19:54
not so simple, there is a Seq of bases
Perry
@pfn
May 13 2016 19:54
it's scala
write whatever you need to make it happen :P
Sam Halliday
@fommil
May 13 2016 19:55
I've already solved it, 5 minutes ago, sorry I thought you were just interested
Perry
@pfn
May 13 2016 19:55
not particularly...
Sam Halliday
@fommil
May 13 2016 19:58
it's a shame the entire sbt API is based on definitive packets of File
the nio API allows for so many faster implementations if it is streamed
Perry
@pfn
May 13 2016 20:11
neat
Dale Wijnand
@dwijnand
May 13 2016 20:35
interested in contributing that to sbt 1.0?
Sam Halliday
@fommil
May 13 2016 21:17
@dwijnand sure, it's Apache 2.0
just drop it in
I won't sign the Typesafe SLA though, because of the legal jurisdiction clause
so somebody will need to contribute it on my behalf