If #23 got implements, it would be nice if you could apply the chainsaw plugin to Java 8 or older projects.
If it recognizes that it is applied to a Java 8 or older project (sourceCompatibility property) it could pimp the generated JAR by generating and compiling the generated module-info.java in a separate source set, e. g. moduleInfo which compileModuleInfoJava task is configure with sourceCompatibility = 9.
The jar task can then be configured to put the compiled module-info.class into META-INF/versions/9/ and the manifest attribute Multi-Release: true to be set, then the JAR can be used with Java 8 or older and is a proper named module with Java 9 or newer.
Support for multi-release JAR-s is already planned as issue #3 - if you see something useful that can be added to the topic, just post it there. I'm closing this issue as a duplicate.
If #23 got implements, it would be nice if you could apply the chainsaw plugin to Java 8 or older projects. If it recognizes that it is applied to a Java 8 or older project (
sourceCompatibility
property) it could pimp the generated JAR by generating and compiling the generatedmodule-info.java
in a separate source set, e. g.moduleInfo
whichcompileModuleInfoJava
task is configure withsourceCompatibility = 9
. Thejar
task can then be configured to put the compiledmodule-info.class
intoMETA-INF/versions/9/
and the manifest attributeMulti-Release: true
to be set, then the JAR can be used with Java 8 or older and is a proper named module with Java 9 or newer.