These are chat archives for sbt/sbt

12th
Dec 2016
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:00
I will try that out. A ex coworker setup our sbt multi-project at my work really well, I am spoiled by it, can run tests, debug, any which way I want. It's always my first try when working on an open source project but almost never works. Seems while IntelliJ has a lot of mindshare in offices, it has little with Library authors.
I get by using sbt in a terminal, but am far, far less productive.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:01
it's been incredibly useful for me to be forced into the sbt console
learning how to inspect the build via the console - stuff IntelliJ just won't surface is available
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:02
How many leave when forced to do that though. Speaking from personal experience, the Circe author tweeted a request for help with an easy ticket in July. I thought heck yeah, I want to help, spent 6 hours futzing with build, never got it working, and didn't contribute. How often does that happen? We really don't know.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:02
inspect sourceManaged and inspect compile:sourceManaged and inspect test:sourceManaged was enlightening - helped me understand how a setting can change depending on its configuration...
yeah... I'm with you. My first pass at SBT was very disappointing. But the more I've learned about it, the more I feel it may be the single best build tool I've ever worked with
which is saying something
of course, it's still got some nasty warts
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:04
I get so little out of that. Wish I was better. Spent hours at it today. Would set some source directories, then show sources in root, and see ArrayBuffer(). I have been hearing how great it is for 3 years now, bought two books on it, studied, practiced, everything possible, I just don't get it. Something about how SBT is designed doesn't click with how I think. Although if the tooling were compatible it wouldn't matter right? I would just open a project, click build, write a failing test, implement a fix, and be on my way. In a perfect world.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:04
good help me - the resolvers management stuff has given me conniptions
point taken
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:05
Will give it a shot. I lost last weekend to that myself, something like 16 hours again not contributing to open source. The wound is fresh though so I may have some insight.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:05
it should "just work"
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:07
What is your resolver question? I looked ^^^ but see codegen question.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:08
oh, the resolver thing is just an ongoing issue
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:08
Also, how do you see more with inspect? I always have problems in multi-build projects and inspect always truncates. I tried using the built-in grep for it but never can make that work either.
Ah....I reallllllly wish SBT supported vendoring artifacts like every other build tool I use but no luck. Best advice I have gotten is to install artifactory locally, which sorta kinda works.
Would save me a lot of resolver futzing, and perform better as well.
My usual answer would be to just add the feature but I can't make heads or tails of SBT's design philosphy so I am unable to contribute to it. Maybe someday I will get it though.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:10
inspect vintage-codegen/compile:sourceManaged
inspect vintage-codegen/*:sourceManaged
inspect vintage-codegen/test:sourceManaged
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:11
So you just drill down into each subproject until the list is small enough it doesn't truncate?
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:12
it shouldn't truncate
if you're running it in a terminal, do you have unlimited scrollback?
you on a mac or windows or linux?
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:13
I do, but it always stops after a screenful and shows
[info] readme/test:sourceManaged
[info] root/test:sourceManaged
[info] scalafix-tests/test:sourceManaged
[info] readme/compile:sourceManaged
[info] ...
For example. Those are not my ...'s, sbt does that.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:13
I've never seen that on my output
interesting
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:13
I'm on a mac.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:14
hmmmm - which version of sbt?
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:14
0.13.13
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:14
and scala?
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:15
I didn't actually install scala, let sbt handle it, but the project I am working on today (this has happened with all projects though) is scalafix.
So 2.11.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:16
that's very strange
I don't know what to tell you...
I've not once seen my output "ellipsisized"
(say that five times fast) :)
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:17
No need, kind of funny to hear it's not that way for you though. Me and my coworkers all get it. Must be some setting somewhere for it if I dig through the source.
G. Richard Bellamy
@rbellamy
Dec 12 2016 00:19
hmmmm
anyway, like I said - gotta get back to breaking shit.... have a good one!
Shane Delmore
@ShaneDelmore
Dec 12 2016 00:20
You too.
FelAl
@FelAl
Dec 12 2016 17:42

hello.

  val database = conf.getConfig("database2")
  println(database.toString)

  println("======")
  val db = Database.forConfig("database2")
database2 {
  dataSourceClass = org.postgresql.ds.PGSimpleDataSource
  properties = {
    url = "postgres://0.0.0.0:32769"
    databaseName = “postgres”
    user = “local”
    password = “local”
  }
  numThreads = 10
}

I get this:

Config(SimpleConfigObject({"dataSourceClass":"org.postgresql.ds.PGSimpleDataSource","numThreads":10,"properties":{"databaseName":"“postgres”","password":"“local”","url":"postgres://0.0.0.0:32769","user":"“local”"}}))
...
Caused by: java.lang.NullPointerException
    at org.postgresql.PGProperty.get(PGProperty.java:334)

I want to run sbt console with all dependencies(including classes i defined) and try to change connection options in realtime and see what happens.
maybe there is a better way to debug it?

G. Richard Bellamy
@rbellamy
Dec 12 2016 20:06
I have a custom resource generator which I pass the log stream (e.g. Codegen.generateMappings(elasticMappingsFilesRoot.value, streams.value.log).toSeq) - when this task is called explicitly, I get the log output, but when it's called via the normal task resolution and execution process, I see no output. What gives?