Hello. First, this is not technically a bug, but this seemed like the most relevant place to post this. If it belongs elsewhere then I apologize.
I recently ported a heavily customized Ant-based build system to Gradle and one frustration I had involved the default behavior around start scripts as configured by the Application plugin.
The start scripts’ install/include location is not customizable. We have an existing distro layout that we want to keep, in which start scripts are at the root instead of
/bin, but because this is not configurable you are left with two options:
eachFile(see #2) or disabling
startScriptsand including your own separately (then you hit #3).
You can work around the lack of configurability by using an
eachFileclosure on your distribution to selectively modify the relative path just for the start scripts. This works for the zip/tar distributions, but causes
installApp) to fail (see #3).
installDistis hard-coded to run
$destDir/bin/$appName. This will cause the task to fail if the file doesn’t exist, perhaps because you moved it or you disabled
What we ended up doing was
startScriptsentirely (so the default scripts would not be included in any distributions)
- including our own custom scripts as normal files in the distributions
- creating a dummy script before
installDistand then deleting it and
/binafterward (see here)
There are two ways things could be better:
- The bin dir could be set via a property, so that one could include custom scripts by customizing the output of
startScriptsbut leave everything else as default, and/or
- In case you want to simply disable
startScriptsand handle things yourself,
installDistcould be made to not attempt to modify permissions of nonexistent files.