These are chat archives for sbt/sbt

Jul 2017
Han van Venrooij
Jul 05 09:46
What's the preferred way of making sure that your tests succeed before publishing?
I used to do publish := publish dependsOn(test in Test). But this doesn't seem execute anything :(
Dale Wijnand
Jul 05 09:58
publish := (publish dependsOn (test in Test)).value
The preferred way is to use sbt-release, or a custom command that runs tests before pubish
Leaving publish to be purely about publishing.
Han van Venrooij
Jul 05 10:00
Thanks @dwijnand, that helped a lot. I'll checkout sbt-publish
Marek ┼╗ebrowski
Jul 05 10:42
I have a problem with adding additional unmanagedResourceDirectories
I did:
unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main" / "webapp"
in my project but in target/scala-2.12/classes/webapp only folders from src/main/webapp appears - no files
Do I need to set something else (include/exclude filter) to make it work ?
Daniel Wunsch
Jul 05 10:59
iirc unmanagedResourceDirectories is just used to calculate relative paths for files coming out of something in resourceGenerators
not sure, but you might need something like resourceGenerators in Compile += Def.task { (baseDirectory.value / "src" / "main" / "webapp").***.get } in addition to your line above
but: shouldn't unmanaged resources go into the target folder? i think you're using the wrong key here.
Dale Wijnand
Jul 05 11:03
I think simply compile doesn't copy resources into target.
I forget what the various keys are, but there's a copyResources key - does that copy your resources?

and it says:

For example, to add extra-resources to be an additional directory containing main resources,
unmanagedResourceDirectories in Compile += baseDirectory.value / "extra-resources"
but that does not do what I expect

N.S. Cutler
Jul 05 15:55
has 0.13.16-M1 been published, or do plugin authors need to build from source in order to use it?
N.S. Cutler
Jul 05 16:30
never mind, was looking for an sbt-launch.jar to place in my ~/bin, can just update in applicable plugin projects...
andy scott
Jul 05 19:21
Given a ProjectRef, is there any way to get the project ref to the root project for that build? I'm dealing with a source dependency across SBT build files.
Jul 05 19:32
RootProject ?
andy scott
Jul 05 19:39
lazy val ref = ProjectRef(..., "foo") is my starting reference. I want to inject some settings to the other transitive projects in that build.
Alternatively I could start from the root project, bit then how do I resolve a subproject from the ref?
Dale Wijnand
Jul 05 22:12
What do you mean by "other transitive projects"? No such thing as a transitive project.
oh source dependencies?
Then you have mulitple builds.
andy scott
Jul 05 22:16
Yeah my terminology here is poor.
Inside the build for my main project:

lazy val ref = ProjectRef(uri("path-to/other/project", "foo")
Inside the build for the foo project:

lazy val foo = Project(....).dependsOn(bar)
lazy val bar = ....

I need to inject settings into the bar project.

To be clear: I would never in a million years organize my projects this way, or use source dependencies like this. Except my hand has been forced in this situation.
Dale Wijnand
Jul 05 22:21
so ProjectRef(uri("path-to/other/project", "bar") is the reference you want to use