Raynes / lein-bin

Standalone console executables for your project.
155 stars 19 forks source link

add support for jvm-opts overrides and environment variables #26

Closed BrunoBonacci closed 8 years ago

BrunoBonacci commented 8 years ago

This enables to specify a set of :jvm-opts which will be baked in the executable jar. The options you want to bake into the executable might be different than those ones you use for the development (lein repl). In addition to this it supports environment variables such as $JVM_OPTS which currently aren't in leiningen and it correctly convert to %JVM_OPTS% for windows platform

example:

    :jvm-opts ["-Xmx2g"]
    :bin {:name "foo"
          :jvm-opts ["-server" "$JVM_OPTS" "-Dfile.encoding=utf-8"]}

the output

$ head -3 ./target/foo
:;exec java -server $JVM_OPTS -Dfile.encoding=utf-8 -Dfoo.version=0.5.7 -jar $0 "$@"
@echo off
java -server %JVM_OPTS% -Dfile.encoding=utf-8 -Dfoo.version=0.5.7 -jar %1 "%~f0" %*
BrunoBonacci commented 8 years ago

Hi, any chance to see this PR merged in any time soon?

Raynes commented 8 years ago

Yep, if you keep complaining at least one more time tomorrow. I'm very complaint oriented. I wait until people are actually frustrated before I merge.

BrunoBonacci commented 8 years ago

:-) ok i'll try again tomorrow

Raynes commented 8 years ago

Mostly just because it's 4AM and I desperately need sleep.

BrunoBonacci commented 8 years ago

here we go... is today a good day to merge this PR?

sathyavijayan commented 8 years ago

I have been bit by this too.. +1

DayoOliyide commented 8 years ago

:+1: :+1:

BrunoBonacci commented 8 years ago

hi @Raynes, any update on this PR?

BrunoBonacci commented 8 years ago

This is now available in lein-binplus