The workaround needed for the moditect-gradle-plugin issue is a bit brittle, but it seems to work for the current Lingua setup.
Only the regular JAR is a Multi-Release JAR with module descriptor; the created -with-dependencies.jar is not a proper Multi-Release JAR, but that probably does not matter because I think you would normally not use JARs with dependencies as modules.
Also adds a test to verify that the modular JAR can be used by using the incubating Gradle Test Suite feature.
One issue with the moditect-gradle-plugin is that it does not seem to detect incorrect configuration of the module-info.java file, such as missing requires or exports of a non-existent package (though the test suite added by this PR would hopefully catch that). An alternative might be to perform regular compilation of the module-info.java file, similar to what is described in this StackOverflow question but that would require some adjustments to create a Multi-Release JAR.
Awesome work @Marcono1234. Thank you so much for your help. :) I don't have much knowledge about Java 9 modules yet so I'm very grateful for any help in this regard. 👍
Resolves hopefully #120
The workaround needed for the moditect-gradle-plugin issue is a bit brittle, but it seems to work for the current Lingua setup. Only the regular JAR is a Multi-Release JAR with module descriptor; the created
-with-dependencies.jar
is not a proper Multi-Release JAR, but that probably does not matter because I think you would normally not use JARs with dependencies as modules.Also adds a test to verify that the modular JAR can be used by using the incubating Gradle Test Suite feature.
One issue with the moditect-gradle-plugin is that it does not seem to detect incorrect configuration of the
module-info.java
file, such as missingrequires
orexports
of a non-existent package (though the test suite added by this PR would hopefully catch that). An alternative might be to perform regular compilation of themodule-info.java
file, similar to what is described in this StackOverflow question but that would require some adjustments to create a Multi-Release JAR.