These are chat archives for sbt/sbt

22nd
Oct 2015
Sandeep Singh
@techaddict
Oct 22 2015 05:16
How Can I make a dependency “Provided” when making a jar(sbt assembly) and when compiling/ running should be included ?
Perry
@pfn
Oct 22 2015 05:18
that doesn't make sense
add the dependency as provided in the main project, create a running project that requires the dependency explicitly
Sandeep Singh
@techaddict
Oct 22 2015 05:19
I have marked spark dependency as provided so jar file doesn’t bloat up and since its provided by, but its needed to run it locally.
Perry
@pfn
Oct 22 2015 05:20
that still doesn't make sense
how can you run it locally when it should run inside of spark
in any case, 2 options, a subproject, or create an alternate configuration
Sandeep Singh
@techaddict
Oct 22 2015 05:22
locally spark run using spark-core and when you spark-submit it uses deployement’s jars
Thanks @pfn
Perry
@pfn
Oct 22 2015 05:27
I suppose that works too
Sandeep Singh
@techaddict
Oct 22 2015 05:29
yupp worked, just checked.
nafg
@nafg
Oct 22 2015 05:29
Hi, I'm using flyway-sbt and I now want to use Java (well actually scala) migrations. My current setup is that the .sql migrations, and the .sbt file that includes flywaySettings, are in a subproject called db
Now I'm a bit confused how "java" migrations are supposed to work, since it's running as an sbt plugin, not with the project classpath
FTR it's not working
TBH I don't care that much about how it's supposed to work, mostly about how I can make it work.
So I see that db/flywayMigrate depends on db/runtime:fullClasspath
Ok, I see in their code, they should be instantiating a URLClassLoader
nafg
@nafg
Oct 22 2015 05:34
So why isn't it working
Oh! Logs! How could I forget to check there ;)
[debug] Skipping non-instantiable class: db.migration.V6__housing_unit_development_id
Ok, it was my fault. Silly intellij, I don't think I asked you to add an abstract modifier did I?
Kaiyin Zhong
@kindlychung
Oct 22 2015 12:17
> inspect hello
[info] Task: Unit
[info] Description:
[info]     An example task
[info] Provided by:
[info]     {file:/private/tmp/hello/}root/*:hello
[info] Defined at:
[info]     /private/tmp/hello/build.sbt:9
[info] Delegates:
[info]     *:hello
[info]     {.}/*:hello
[info]     */*:hello
So {file:/private/tmp/hello/}root/*:hello is the scope of hello here?
Kaiyin Zhong
@kindlychung
Oct 22 2015 12:36
I think the scope documentation needs some more work: http://www.scala-sbt.org/0.13/tutorial/Scopes.html
Long paragraphs of description, very little demonstration (code).
Richard Gomes
@frgomes
Oct 22 2015 13:57
@kindlychung :: one simple example tells more than 1000 words!
matanster
@matanster
Oct 22 2015 14:22
I am using sbt-doge for making sbt respect versions specified in subprojects of a multi-project build. Motivation being that I need some of the projects to only compile with 2.10 as they are sbt-plugin related. Will this keep on working in 1.0? or will that capability be folded into sbt itself?
Kaiyin Zhong
@kindlychung
Oct 22 2015 14:36
@frgomes Exactly.
Perry
@pfn
Oct 22 2015 14:53
@matanster 1.0 isn't anytime soon, doesn't matter
@kindlychung scopes are a weak point of sbt, imo
Kaiyin Zhong
@kindlychung
Oct 22 2015 15:18
@pfn How so?
Perry
@pfn
Oct 22 2015 15:18
it's extremely difficult to discover what scopes are used by what
and it's extraordinarily error prone
much too easy to set configuration keys for the wrong scope and not understand why stuff doesn't work
avoid scopes as much as possible :p
Kaiyin Zhong
@kindlychung
Oct 22 2015 15:20
@pfn Nice to know.
Perry
@pfn
Oct 22 2015 15:20
half the time, I don't know what scope I should be using, and I've been using sbt for years :-/
matanster
@matanster
Oct 22 2015 17:44

project
[info] childProj (in build file:...repos/rootProj/)
baseDirectory
[info] ..../rootProj/childProj

But then in run my code sees rootProj as the working directory. Namely it seems that currently, the working directory for run is not the baseDirectory (?!)
Can it be explicitly overridden by me?

So that the working directory of the subproject is the subproject's root, not the root project's root?
Perry
@pfn
Oct 22 2015 21:34
don't count on the working directory being anything you expect, ever
matanster
@matanster
Oct 22 2015 21:44
only rely on resources I presume.