Re: [sbt] Custom scalac-options when packaging with assembly plugin

84 views
Skip to first unread message

Mark Harrah

unread,
Dec 3, 2012, 8:24:23 AM12/3/12
to simple-b...@googlegroups.com
On Mon, 3 Dec 2012 01:39:09 -0800 (PST)
Nikolay Artamonov <narta...@gmail.com> wrote:

> I wrote few @elidable code (with level 300) for debugging purposes. So when
> I test my program with SBT 'compile' and 'run' commands, debug code is
> including in binary code and executing at run-time.
>
> But when I'm ready to release my program via 'assembly' command I want to
> exclude all debugging code from resulting *.jar. I tried this setting:
>
> scalacOptions in assembly ++= Seq("-Xelide-below", "400")
>
> But it doesn't work: debug code still presents in resulting jar. How I can
> solve this trouble? Thanks!

As far as I know, assembly doesn't recompile your code (and it shouldn't) so this wouldn't do anything. The proper way might be to use something like the sbt-release plugin and set the option only for building the release.

https://github.com/sbt/sbt-release

-Mark

> --
> Nikolay Artamonov
>
> --
> 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/-/SnfNh_jpFVoJ.
> 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.
>

Nikolay Artamonov

unread,
Dec 4, 2012, 4:38:05 AM12/4/12
to simple-b...@googlegroups.com
Thanks, Mark! After few experiments I discovered that assembly actually recompiles code. I didn't know about sbt-release, seems very helpful plugin for my purpose.

понедельник, 3 декабря 2012 г., 17:24:23 UTC+4 пользователь Mark Harrah написал:
Reply all
Reply to author
Forward
0 new messages