zyxist / chainsaw

Gradle plugin: adds support for building Java 9 modules.
Apache License 2.0
70 stars 4 forks source link

Rewrite 'installDist' support to use custom templates instead of changing generated files #28

Open zyxist opened 6 years ago

zyxist commented 6 years ago

The Gradle API for installDist task supports providing custom templates for Unix and Windows scripts. It is a much easier way for providing Jigsaw support in the start scripts, than updating already generated files.

  1. Take the original Gradle templates
  2. Update them for Jigsaw, and configure installDist task to use them,
  3. Pass Jigsaw flags to the templates.

This would allow solving issues #13, #16 and #20 in (almost) one shot.

API reference:

https://docs.gradle.org/current/dsl/org.gradle.jvm.application.tasks.CreateStartScripts.html#org.gradle.jvm.application.tasks.CreateStartScripts:windowsStartScriptGenerator