These are chat archives for sbt/sbt

17th
Apr 2015
Jacek Laskowski
@jaceklaskowski
Apr 17 2015 11:36
hi
is there a sbt plugin to get notified when a test fails with ~test? I’m on MacOS.
Dale Wijnand
@dwijnand
Apr 17 2015 11:41
once upon a time there was once https://github.com/softprops/sbt-growl-plugin
Jacek Laskowski
@jaceklaskowski
Apr 17 2015 11:42
looks abandoned
but useful anyway…gonna give it a try
thanks
Dale Wijnand
@dwijnand
Apr 17 2015 12:15
yeah that's what I meant by "once upon a time", I only recently remembered it with this (via twitter) https://github.com/djspiewak/sbt-growl-plugin/tree/feature/notification-center
Sam Halliday
@fommil
Apr 17 2015 18:25
hi all, I have my sonatype Credentials in ~/.sbt/0.13/sonatype.sbt and also this in my projects https://github.com/ensime/ensime-sbt/blob/master/build.sbt#L41
but the build.sbt seems to be winning and unless I set the envvars for it to kick in, I can't publish to sonatype anymore. Any ideas?
I'm pretty sure this was working until very recently
Josh Suereth
@jsuereth
Apr 17 2015 18:27
build.sbt is supposed to win, that could be a recent "fix"
Sam Halliday
@fommil
Apr 17 2015 18:27
is there a way to conditionally add a Credential ?
Josh Suereth
@jsuereth
Apr 17 2015 18:27
actually... wait, not I think user-level should win, nevermind
You can configure that actually
Sam Halliday
@fommil
Apr 17 2015 18:27
maybe user level is not seen. lemme comment out the build.sbt defn and see
that works, so it looks like build.sbt is trumping
eugene yokota
@eed3si9n
Apr 17 2015 18:29
wouldn't you want the build level to always win?
Sam Halliday
@fommil
Apr 17 2015 18:30
credentials ++= for {
  username <- sys.env.get("SONATYPE_USERNAME")
  password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)
no way! I want the local setting to win. The build.sbt setting is for CI and my local one is far more private.
Josh Suereth
@jsuereth
Apr 17 2015 18:30
@eed3si9n Theoretically, yes, but that's not how it works
Sam Halliday
@fommil
Apr 17 2015 18:31
that doesn't compile btw, but it's the sort of thing I want in the build.sbt
Josh Suereth
@jsuereth
Apr 17 2015 18:31
Yeah, override order != load order though is odd
@fommil If you "toSeq" the top one there, that might work
Sam Halliday
@fommil
Apr 17 2015 18:31
I can make the problem go away by only adding this if it has a chance of being valid, any ideas how to fix my syntax?
aah, of course. toIterable I think with options
nope, .toSeq works
sweet! This works
credentials ++= {
  for {
    username <- sys.env.get("SONATYPE_USERNAME")
    password <- sys.env.get("SONATYPE_PASSWORD")
  } yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)
}.toSeq
I'm going to add that to all my projects
btw, why do I have to type my GPG passphrase 4 times here?
it used to be just once, but I've upgraded a lot of the supporting plugins
Josh Suereth
@jsuereth
Apr 17 2015 18:37
that sounds like some wierd classloader issue
Sam Halliday
@fommil
Apr 17 2015 18:38
I'm using "com.typesafe.sbt" % "sbt-pgp" % "0.8.3"
with useGpg := true
eugene yokota
@eed3si9n
Apr 17 2015 18:38
global setting (user-level) should be used mostly for personal preference stuff. i don't really have a good solution for where release specific settings should go
Josh Suereth
@jsuereth
Apr 17 2015 18:39
Ah, so GPG isn't saving it....
eugene yokota
@eed3si9n
Apr 17 2015 18:39
build level is related idea that I had - https://github.com/sbt/sbt/wiki/User-Stories:-Build-Level
Sam Halliday
@fommil
Apr 17 2015 18:41
oh, maybe I need a GPG setting to cache for 10 mins or something
I'm using the defaults, which should cache for 5 minutes. Hmm.
Sam Halliday
@fommil
Apr 17 2015 19:14
this might be something to do with gpg-agent
sounds like it needs to be started as a daemon process and envvars set for passphrase caching to work
nope, that didn't fix it
Sam Halliday
@fommil
Apr 17 2015 19:26
yeah, gpg-agent seems to be caching passphrases but sbt-gpg is ignoring it
nope, gpg is still requiring passphrases every time. (what the hell is the point of the agent, then?)
Sam Halliday
@fommil
Apr 17 2015 19:34
I've decided that the amount of time to fix this is going to be significantly more than the amount of time it takes me to type my passphrase 4 times
because I have no idea what is going wrong
Sam Halliday
@fommil
Apr 17 2015 19:40
this might be a gpg vs gpg2 issue
yes, that's it! gpg2 uses the cache but gpg doesn't
Sam Halliday
@fommil
Apr 17 2015 19:47
@jsuereth ok, got it. You need to be using gpg2 not gpg to get caching. Does your sbt-pgp support that?
I'll try customising gpgCommand
error: not found: value gpgCommand
gpgCommand := "/usr/bin/gpg2"
and with your "com.jsuereth" version I get
error: not found: value useGpg
useGpg := true
Sam Halliday
@fommil
Apr 17 2015 19:53
there's a rock, and there's a hard place
Sam Halliday
@fommil
Apr 17 2015 20:29
yay! useGpgAgent := true
oh, sbt build for scala/scala just landed
Sam Halliday
@fommil
Apr 17 2015 20:29
not in the docs, but I found it in the sources
@soc really?
@soc I don't see it in their master branch
oh you mean scala/scala#4455
interesting
in my least favourite SBT format, but better than nothing :-)
Sam Halliday
@fommil
Apr 17 2015 20:39
@soc you mean .sbt format?
shudder yeah. agreed. hocus pocus
yes ... it's not so much that it's custom syntax, but that it makes it impossible to have the build definition in one place
Sam Halliday
@fommil
Apr 17 2015 20:42
we're basically never going to support .sbt in ENSIME
as I ranted a while ago: "The fact that every build tools wants to put its configuration into the root directory is not "consistency", it's part of the problem."
Sam Halliday
@fommil
Apr 17 2015 20:42
nothing wrong with scala
yup, "project" is a perfectly good place for.... project files
I strongly prefer project/scala.{build,sbt,properties}
everything in one place, no explanation necessary. scala/scala now ships with three build systems all placed in the root folder. explaining that to new people will be a lot of fun.