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

Transition to jakarta.inject.Inject (#115) #122

Closed rvesse closed 2 years ago

rvesse commented 2 years ago

Switches to the 2.x releases of the jakarta.inject dependency which use the new jakarta.inject package.

For backwards compatibility continue to support old javax.inject based annotations. This is done by creating a airline-backcompact-javaxinject module that uses the old javax.inject dependency so that we can have mixtures of old and new annotations in our applications. This dependency change is intended to be a temporary measure for the 2.9.x releases only, 2.10.x will mark these dependencies as optional and 3.x will remove them entirely.

The ParserMetadata now declares the composition annotations that are inspected. This defaults to using the new @AirlineModule annotation which is our own new annotation, plus maintains the existing behaviour (javax.inject.Inject or com.google.inject.Inject) and supports the newer jakarta.inject.Inject annotation providing both forwards and backwards compatibility. Advanced users can choose to fully customise the choice of annotations as they see fit.

Documentation around composition and dependencies has been updated to make this as clear as possible and note the forthcoming deprecation of the ability to use @Inject out of the box.

Remaining Work

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 629


Changes Missing Coverage Covered Lines Changed/Added Lines %
airline-core/src/main/java/com/github/rvesse/airline/builder/GroupBuilder.java 12 13 92.31%
airline-core/src/main/java/com/github/rvesse/airline/builder/ParserBuilder.java 11 12 91.67%
airline-maven-plugin/src/main/java/com/github/rvesse/airline/maven/Source.java 0 1 0.0%
airline-core/src/main/java/com/github/rvesse/airline/help/suggester/SuggestCommand.java 0 6 0.0%
airline-core/src/main/java/com/github/rvesse/airline/model/MetadataLoader.java 92 104 88.46%
<!-- Total: 127 148 85.81% -->
Files with Coverage Reduction New Missed Lines %
airline-core/src/main/java/com/github/rvesse/airline/help/suggester/CommandSuggester.java 1 0%
airline-core/src/main/java/com/github/rvesse/airline/model/MetadataLoader.java 2 91.7%
airline-core/src/main/java/com/github/rvesse/airline/model/ParserMetadata.java 2 67.31%
airline-core/src/main/java/com/github/rvesse/airline/builder/GroupBuilder.java 3 75.38%
<!-- Total: 8 -->
Totals Coverage Status
Change from base Build #248: 0.1%
Covered Lines: 5711
Relevant Lines: 7913

💛 - Coveralls
gsmet commented 2 years ago

@rvesse I will test this further today!

gsmet commented 2 years ago

@rvesse I confirm all is good from my side.

rvesse commented 2 years ago

@gsmet FYI I have pushed out a 2.10.0-SNAPSHOT build already that makes the jakarta-inject and airline-backcompat-javaxinject dependencies optional so you won't automatically pick them up transitively nor need explicit exclusions

gsmet commented 2 years ago

@rvesse cool, thanks!