These are chat archives for sbt/sbt

30th
Aug 2017
Cause Chung
@cuzfrog
Aug 30 05:49
sbt exit code alway is 0, no matter whether tests fail or not. this happens when test is triggered by another task, which is executed on the command-line.
mariop-da
@mariop-da
Aug 30 11:42
I have a sbt plugin that depends on another package containing the logic that the sbt-plugin will use. The other package uses logback for logging. Is there a way to pass a log configuration to a sbt-plugin so that I can configure the plugin log level?
I know that sbt has it's own logging facility but the logic is not defined together with sbt and the logic can be used without sbt. That's why the sbt logging facility is not really a solution to this problem.
Arnout Engelen
@raboof
Aug 30 15:44
Could someone add an sbt-reproducible-builds repo under the sbt github org for me? (or is this not the right place to ask? :) )
Brian P. Holt
@bpholt
Aug 30 16:50

Is it possible to add resources to the sbt meta-build definition?

I’m trying to add a logback config file to a project that has logback added to its libraryDependencies in project/plugins.sbt, but I can’t figure out where to put the file so that it gets picked up. I’ve tried project/src/main/resources/logback.xml, project/resources/logback.xml, and project/logback.xml without success.

(This is in 0.13, but info on 1.0 would be helpful too)
Brian P. Holt
@bpholt
Aug 30 17:02

Hmm, fwiw it looks like project/src/main/resources/logback.xml should have worked?

> reload plugins
[info] Loading global plugins from …/.sbt/0.13/plugins
[info] Loading project definition from …/project
> show resourceDirectories
[info] * …/project/src/main/resources
[info] * …/project/target/scala-2.10/sbt-0.13/resource_managed/main
> show resources
[info] * …/project/src/main/resources
[info] * …/project/src/main/resources/logback.xml
[success] Total time: 1 s, completed Aug 30, 2017 12:00:13 PM

(to be clear… it did not work)

Jangoolie
@jangoolie
Aug 30 17:02
Hey, how do I configure plugin settings in a .Scala file in project/ ?
I have addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.1.1") in project/plugins.sbt
But if I put "val warts = Warts.allBut(..." in my project/Common.scala then Warts is not defined
and I can't import org.wartremover either
and I can't find anywhere in the documentation that that explains the relationship between plugins and project/blah.scala
Nepomuk Seiler
@muuki88
Aug 30 18:16

Hi folks,

What is the current way of setting up a test project for an sbt-plugin describe in this section:
http://www.scala-sbt.org/0.13/docs/Plugins.html#1d%29+Project+dependency

In sbt-native-packager I'm using the test-project-simple to debug stuff and this configuration isn't working anymore:

plugins.sbt

lazy val root = project
    .dependsOn(packager)

lazy val packager = project.in(file(".."))

I get the following error

info] Loading settings from plugins.sbt ...
[info] Loading settings from build.sbt ...
[error] java.lang.AssertionError: assertion failed: Directory /home/muki/dev/git/sbt-native-packager/test-project-simple is not contained in build root /home/muki/dev/git/sbt-native-packager/test-project-simple/project
[error]     at scala.Predef$.assert(Predef.scala:219)
[error]     at sbt.internal.Load$.checkProjectBase(Load.scala:565)
[error]     at sbt.internal.Load$.resolve$1(Load.scala:603)

Using lazy val packager = project.in(file(".").getParentFile) even results in NPE.

One thing. Before I the outer plugin was defined with an URI file("..").getAbsoluteFile.toURI, not as a Classpath dependency
Maciej Kowalski
@fkowal
Aug 30 19:43

Hello
i am trying to upgrade a plugin to support cross sbt builds

^ compile
[info] Setting sbtVersion in pluginCrossBuild to 0.13.16
[info] Set current project to sbt-release-plugin (in build file:/Users/maciej.kowalski/branches/allegro/sbt-release-plugin/)
[success] Total time: 0 s, completed Aug 30, 2017 9:40:58 PM
[info] Setting sbtVersion in pluginCrossBuild to 1.0.1
[info] Set current project to sbt-release-plugin (in build file:/Users/maciej.kowalski/branches/allegro/sbt-release-plugin/)
[info] Updating sbt-release-plugin
[info] Resolved sbt-release-plugin dependencies
[trace] Stack trace suppressed: run last :coursierResolutions for the full output.
[error] (
:coursierResolutions) coursier.ResolutionException: Encountered 2 error(s) in dependency resolution:
[error] com.typesafe.sbt:sbt-native-packager;sbtVersion=0.13;scalaVersion=2.12:1.2.2:
[error] not found:
[error] /Users/myname/.ivy2/local/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_0.13/1.2.2/ivys/ivy.xml

i've got
sbtPlugin := true
crossSbtVersions := Seq("0.13.16", "1.0.1")
in my build.sbt

any help will be greatly appreciated
thx

Brian P. Holt
@bpholt
Aug 30 19:48
@fkowal it shouldn’t be using scala_2.12 for sbt_0.13. Most 0.13 plugins are only published for Scala 2.10
Bjørn Madsen
@aeons
Aug 30 19:49
most === all
Brian P. Holt
@bpholt
Aug 30 19:50
yeah, I wasn’t sure if there were some weird ones 🤷‍♂️
Maciej Kowalski
@fkowal
Aug 30 19:57
@bpholt the thing is i haven't specified the scalaVersion
i have no idea why 2.12 is inferred
Maciej Kowalski
@fkowal
Aug 30 20:18
[warn] com.github.gseitz:sbt-release:1.0.6 (scalaVersion=2.12, sbtVersion=0.13) (/Users/.../build.sbt#L76-77)
[warn] +- packge:myplugin:0.xx-sbt1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)

this is what i get without coursier

for some reason the sbtVersion for my plugin appears ok but for the dependecy it's broken

can it have something to do with the fact the
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6")

is added in build.sbt where the sbtVersion -> build.properties is 0.13.16
and ^^ compile resolves the plugin with the globalVersion ?

Brian P. Holt
@bpholt
Aug 30 21:59
Oh… yes, I think that may be it @fkowal. See sbt/sbt#3393