These are chat archives for sbt/sbt

11th
May 2017
Sam Halliday
@fommil
May 11 08:57
is there any way to load a non-triggered AutoPlugin from an allRequirements AutoPlugin? I have a funny feeling I hit this recently and the answer was no, but that might have been subtely different.
Dale Wijnand
@dwijnand
May 11 09:26
The answer is no. That feature is stuck in debate sbt/sbt#2093
Sam Halliday
@fommil
May 11 09:37
btw is there a ticket anywhere about reducing scope axis for sbt 2.0?
Dale Wijnand
@dwijnand
May 11 09:38
Nope, just chatter.
Sam Halliday
@fommil
May 11 11:18
is there any way to silence this? [warn] Skipped generating '<exclusion/>' for log4j#*. Dependency exclusion should have both 'org' and 'module' to comply with Maven POM's schema.
this is for an application that is not published, but this is clogging up the build logs
Dale Wijnand
@dwijnand
May 11 11:22
That's from sbt/sbt#168. You could dig into the details described there to understand the reason(s) it's happening to try and avoid it/them.
Simon Hafner
@reactormonk
May 11 11:29
@jvican hmm, the solution doesn't actually run :-(
Sam Halliday
@fommil
May 11 11:30
@dwijnand yeah, I know why it's happening but I don't care
because I'm not publishing to a maven repo
Dale Wijnand
@dwijnand
May 11 11:30
@fommil Maybe there's a way to stop it generating the pom then
Sam Halliday
@fommil
May 11 11:30
hmm
Jorge
@jvican
May 11 11:31
@reactormonk If it doesn't run, it means that you're not scoping it correctly
Simon Hafner
@reactormonk
May 11 11:37
resourceGenerators in (proj, Compile) += should be right?
Jorge
@jvican
May 11 11:37
Yes, that's correctly scoped.
But there must be something inside the implementation that is not correctly scoped.
Simon Hafner
@reactormonk
May 11 11:38
Time for some println debugging?
Jorge
@jvican
May 11 11:38
Looks like it, yeah
Simon Hafner
@reactormonk
May 11 11:39
resourceGenerators in (proj, Compile) += Def.task { println("foo"); Seq() } should run?
Jorge
@jvican
May 11 11:40
I think it should be resourceGenerators in (proj, Compile) += Def.task { println("foo"); Seq() }.taskValue
Simon Hafner
@reactormonk
May 11 11:40
Compiled without that :-/
Jorge
@jvican
May 11 11:40
Okay, then it's fine.
Simon Hafner
@reactormonk
May 11 11:41
Nope, not run.
Jorge
@jvican
May 11 11:42
Are you doing it from the console?
Simon Hafner
@reactormonk
May 11 11:42
Is there a specific command for "generate resources"?
Running clean; compile from the console, yes.
Jorge
@jvican
May 11 11:42
Check the file I linked, that explains pretty much everything you should know.
What are you typing in?
Simon Hafner
@reactormonk
May 11 11:43
clean, then compile
Jorge
@jvican
May 11 11:43
on which project?
Simon Hafner
@reactormonk
May 11 11:43
proj is the main project. I've tried with proj/compile too.
Jorge
@jvican
May 11 11:44
My advice: reduce the resource generator as much as you can, and follow the "Howto-generating-files" tutorial.
Try to see what's not working.
Simon Hafner
@reactormonk
May 11 11:45
Ah, I see how I got it to work in a previous project... https://github.com/reactormonk/fleet-buddy/blob/master/build.sbt#L55
Jorge
@jvican
May 11 11:46
I guess you're looking forward to using trailing commas, huh?
:D
Simon Hafner
@reactormonk
May 11 11:47
yeap
Ok, I can't get the example in the doc to work, lemme try copypasta
Jorge
@jvican
May 11 11:49
resourceGenerators should work
Simon Hafner
@reactormonk
May 11 11:50
I copypasta'd that code into the settings block of my project - should be fine?
Jorge
@jvican
May 11 11:50
Use .taskValue instead of .value
See this in the tutorial:
resourceGenerators in Compile += Def.task {
  makeSomeResources((resourceManaged in Compile).value / "demo")
}.taskValue
Simon Hafner
@reactormonk
May 11 11:50
Yeah, I copypasta'd the code block below.
Then I'm running compile, and find . | grep demo in the repl - nothing.
... or does sbt clean them up?
Jorge
@jvican
May 11 11:52
If you do clean they will be removed, yes, that's my guess.
Can you check?
Simon Hafner
@reactormonk
May 11 11:52
I didn't do clean.
I ran the find directly after compile.
Jorge
@jvican
May 11 11:53
Can you reproduce this in an independent minimal build?
Simon Hafner
@reactormonk
May 11 11:54
wtf, when I run show proj/compile:managedResources, it runs (well, error)
Jorge
@jvican
May 11 11:54
and when you do proj/compile, it doesn't?
Simon Hafner
@reactormonk
May 11 11:54
I think so, yes. Testing again.
Yep, doesn't run.
Jorge
@jvican
May 11 11:55
Hmmm...
Hold on.
Simon Hafner
@reactormonk
May 11 11:56
The error in the toTask is "Expected whitespace character` at the first position
Jorge
@jvican
May 11 11:56
sbt/sbt#1832
Simon Hafner
@reactormonk
May 11 11:57
got it.
Jorge
@jvican
May 11 11:58
I think we should have two resourceGenerators. One scoped in Compile, and the other scoped in another configuration, maybe Runtime, that is used to generate resources for the runtime.
That will support the use case that Lars shows. Though most of the times, the resource generators are necessary at runtime, not at compile time.
Simon Hafner
@reactormonk
May 11 11:58
Yeah, runtime is correct.
Jorge
@jvican
May 11 11:59
Can you file a ticket to document this better, please?
Cross-link to that issue too :)
Simon Hafner
@reactormonk
May 11 11:59
Jorge
@jvican
May 11 11:59
sbt/website
Simon Hafner
@reactormonk
May 11 12:10
Opened a PR - it's probably not good to merge yet, but should be a starting point.
Jorge
@jvican
May 11 12:10
Thank you @reactormonk :)
Guillaume Martres
@smarter
May 11 12:26
Is it okay to publish an sbt plugin on maven? Anything that could go wrong?
Jeffrey Olchovy
@jeffreyolchovy
May 11 12:27
I've published to both bintray and on central in the past.. have been using bintray exclusively now, but it has worked without issue for me in the past
Jorge
@jvican
May 11 12:38
@smarter Should work out of the box
Todd Leo
@toddleo
May 11 12:53
dear community: is there a way to exclude a application.conf file , when doing sbt publish to Nexus?
Dale Wijnand
@dwijnand
May 11 12:53
@smarter It's not flawless, but the only breakages I've seen aren't fundamental. Because of the artifactId mangling certain things don't work such as linking and download stats.
Jorge
@jvican
May 11 12:54
Didn't know that @dwijnand, is there a sbt ticket about that?
Dale Wijnand
@dwijnand
May 11 12:56
Nope.
(to my knowledge)
It might not be sbt's fault. It might be Sonatype's software assuming that artifactId == artefact names (jar/pom/etc). Needs triaging.
Alan Johnson
@acjay
May 11 13:00
what might cause very sudden module not found errors in SBT? things were working fine yesterday, but this morning, it's a whole bunch of errors and my project wont compile
Aruj Padbidri
@aruj244
May 11 14:30
How can I specify a Bill of Materials in SBT for my dependencies to pull from? The AWS Java SDK for example offers the below functionality for Maven POM (see more). What would its equivalent be in SBT?
 <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-bom</artifactId>
        <version>1.10.10</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-ec2</artifactId>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-dynamodb</artifactId>
    </dependency>
  </dependencies>
Zhange
@zhan-ge
May 11 15:36
Hi guys, I have a problem with first start the sbt 0.13.15 when I am importing a project in IDEA. It stuck for a very long time and I haven’t seen any networking IO from my pc dashboard, how can I fix this? Is there some way to load it’s dependencies manually? thx a lot!
Sam Halliday
@fommil
May 11 15:36
@smarter I use maven central. I don't understand the point of bintray.
Dale Wijnand
@dwijnand
May 11 16:08
@aruj244 BOMs aren't supported in sbt.
G. Richard Bellamy
@rbellamy
May 11 17:44
@dwijnand @smarter & @jvican - well, for one, the ivy version matcher syntax seems to work for build.sbt but not for plugins.sbt
when you publish your SBT plugins into a Maven repo...
e.g. addSbtPlugin("com.terradatum" % "sbt-docker-helper" % "0.7.+") will fail, and addSbtPlugin("com.terradatum" % "sbt-docker-helper" % "0.7.0") will not
Dale Wijnand
@dwijnand
May 11 18:07
Interesting. Thanks for sharing.
Justin Kaeser
@jastice
May 11 18:10
pretty sure it works for plugins. at least it used to for me
ah, maven repo
G. Richard Bellamy
@rbellamy
May 11 18:55
@jastice yeah, matchers work fine for ivy2 repos regardless of build or build-build resolution
Adelbert Chang
@adelbertc
May 11 22:49
is there a way to enable a plugin for an entire SBT multiproject in one go? i want to enable sbt-doge's CrossPerProjectPlugin for every project in my multiproject https://github.com/sbt/sbt-doge#crossperprojectplugin
Adelbert Chang
@adelbertc
May 11 23:53
oh its just literally drop enablePlugins(...) somewhere in the file