How can I get my application's home dir?

Hi everyone,

I see the Application plugin’s generated shell files essentially compute the app’s home dir in the variable APP_HOME. However, this value is only used in the shell file and dropped. Is there a way to get this variable passed through to the app (accessible by System.getenv()). Ideally, maybe the generated batch file would create a environment variable named PROJECT_NAME_HOME or something like that?

Alternatively, how does one go about futzing with the automatically generated shell files?

Thanks, Graham.

I’ve raised GRADLE-2299 as a feature request to make the scripts more customisable.

In the meantime, see this post for some examples of how to tweak the scripts after the fact.