rvesse / airline

Java annotation-based framework for parsing Git like command line structures with deep extensibility
https://rvesse.github.io/airline/
Apache License 2.0
128 stars 20 forks source link

Add proper module-info.java to all eligible modules #124

Closed rvesse closed 2 years ago

rvesse commented 2 years ago

All eligible modules now have a proper hand-crafted module-info.java

Outstanding issues

Need to address resource loading issues:

Exception in thread "main" java.lang.IllegalArgumentException: Failed to locate resource /exit-codes.csv with any of the configured resource locators
    at com.github.rvesse.airline.help.external@2.10.0-SNAPSHOT/com.github.rvesse.airline.help.external.factories.ExternalHelpFactory.parseTabular(ExternalHelpFactory.java:230)
    at com.github.rvesse.airline.help.external@2.10.0-SNAPSHOT/com.github.rvesse.airline.help.external.factories.ExternalHelpFactory.createSection(ExternalHelpFactory.java:73)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.help.sections.factories.HelpSectionRegistry.getHelpSection(HelpSectionRegistry.java:97)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.model.MetadataLoader.loadHelpSections(MetadataLoader.java:508)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.model.MetadataLoader.loadCommand(MetadataLoader.java:470)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.model.MetadataLoader.loadCommand(MetadataLoader.java:435)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.SingleCommand.<init>(SingleCommand.java:80)
    at com.github.rvesse.airline@2.10.0-SNAPSHOT/com.github.rvesse.airline.SingleCommand.singleCommand(SingleCommand.java:49)
    at com.github.rvesse.airline.examples@2.10.0-SNAPSHOT/com.github.rvesse.airline.examples.ExampleExecutor.executeSingleCommand(ExampleExecutor.java:44)
    at com.github.rvesse.airline.examples@2.10.0-SNAPSHOT/com.github.rvesse.airline.examples.userguide.help.sections.ExternalHelp.main(ExternalHelp.java:58)

This is because with a JPMS application we can't use generic resource like /foo.txt and load it directly. Should look at building a ResourceLocator that leverages JRT URIs per JEP 220 to resolve this:

This resolves #105

rvesse commented 2 years ago

Still having some issues with reading resources from the Module Path. Closing the ClassGraph ScanResult in a try with resources also closed any InputStream you have returned. Need to create an InputStream wrapper that takes in the ScanResult and only closes it when the InputStream is returned