compile but not runtime dependency scope for macros

45 views
Skip to first unread message

James Roper

unread,
Nov 21, 2012, 3:28:33 AM11/21/12
to simple-b...@googlegroups.com
Macros often need dependencies at compile time which are not needed in the runtime classpath (eg, scala-reflect).  Is there any way this can be specified in SBT, ie say this dependency is required at compile time, but not at runtime and should not be inherited transitively?

The reason I'd like to do this is that Play uses the runtime classpath to build its distribution artifacts, and the size of these artifacts can really matter, for example when deploying to heroku, which limits your deployment artifact size to 100mb, a 3mb jar that is not needed at runtime would be really nice to not include.

Mark Harrah

unread,
Nov 21, 2012, 8:45:55 AM11/21/12
to simple-b...@googlegroups.com
On Wed, 21 Nov 2012 00:28:33 -0800 (PST)
James Roper <jro...@gmail.com> wrote:

> Macros often need dependencies at compile time which are not needed in the
> runtime classpath (eg, scala-reflect). Is there any way this can be
> specified in SBT, ie say this dependency is required at compile time, but
> not at runtime and should not be inherited transitively?

Use the 'provided' configuration, which works like the Maven 'provided' scope.

-Mark

> The reason I'd like to do this is that Play uses the runtime classpath to
> build its distribution artifacts, and the size of these artifacts can
> really matter, for example when deploying to heroku, which limits your
> deployment artifact size to 100mb, a 3mb jar that is not needed at runtime
> would be really nice to not include.
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/VRNhXJQfUmAJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

Reply all
Reply to author
Forward
0 new messages