japicmp icon indicating copy to clipboard operation
japicmp copied to clipboard

Implement usage of SemVer ordering rules for resolving previous artifact

Open UnasZole opened this issue 8 years ago • 3 comments

As title says, makes it so that resolving the previous artifact follows the ordering rules defined in SemVer 2.0.0 specification ( http://semver.org/spec/v2.0.0.html ).

Not complete yet : I'm planning to add some JUnits on the JApiCmpMojo to validate the changes better, and probably to improve management of error cases. Still, I wanted to open the PR to get feedback on the principle before finalising everything :-)

Basically :

  • Extends SemanticVersion class with ability to parse according to the spec, and implement Comparable following the spec's rules.
  • Create SemanticArtifactVersion implementing Maven's ArtifactVersion interface.
  • Do some crazy stuff to get these SemanticArtifactVersion inside the maven version range used for comparison.
  • Add a plugin parameter (false by default) to enable this behaviour.

Also, one point to note : I added dependency in test scope to hamcrest matchers in order for my JUnit to use assertThat cleanly, being consistent with your JUnits. If you are unhappy with the dependency addition, I could rewrite the tests to use good old assertTrue, it's not a big deal :-)

UnasZole avatar Jul 09 '17 22:07 UnasZole

Thank you for providing a pull request. Your implementation looks fine. I would merge the PR once it is finished. Please also extend the documentation under src/site/markdown.

siom79 avatar Jul 11 '17 19:07 siom79

Thanks for the feedback, and sorry for the late answer :-) I'll do that as soon as I get a bit of time.

UnasZole avatar Jul 18 '17 12:07 UnasZole

@UnasZole may I help you to complete the PR?

twogee avatar Jul 22 '18 18:07 twogee