since with rubygems most (almost all) dependencies will be declared via versions ranges an tools like bundler are very strict on how to resolve those versions - i.e. the reolved version needs to obey each given contraint. maven does the same but gradle and ivy do pick the latest and newest version when there are more then on contraint for the same gem - which can create problems when using bundler alongside gradle. when converting a gempsec into a maven pom.xml the translation of a gem version range into a maven version range. typically '~> 1.0' from ruby becomes [1.0, 1.99999] on the maven side. so most dependencies from gem artifacts will use such version ranges. to help gradle to be closer to the rubygems world when resolving gem artifacts, it needs to calculate intersection between version ranges in maven manner. this class basically represents a maven version range with boundary (exclusive vs. inclusive) and its lower and upper bounded version and allows to intersect its range with another version range. it also translate fixed version '1.0' to [1.0, 1.0] or the gradle notation 1.2+ to [1.2, 1.99999] or 1.+ to [1.0, 1.99999] following the gemspec-to-pom pattern.
Constructor and description |
---|
GemVersion
(java.lang.String version) converts the given string to a version range with inclusive or exclusive boundaries. |
Type | Name and description |
---|---|
boolean |
conflict() examines the version range on conflict, i.e. lower bound bigger then upper bound. |
GemVersion |
intersect(java.lang.String otherVersion) since GemVersion is version range with lower bound and upper bound this method just calculates the intersection of this version range with the given other version range. it also honors whether the boundary itself is included or excluded by the respective ranges. |
java.lang.String |
toString() string of the underlying data as maven version range. for prereleased versions with ranges like [1.pre, 1.pre] the to range will be replaced by the single boundary of the range. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
converts the given string to a version range with inclusive or exclusive boundaries.
String
- versionexamines the version range on conflict, i.e. lower bound bigger then upper bound.
since GemVersion is version range with lower bound and upper bound this method just calculates the intersection of this version range with the given other version range. it also honors whether the boundary itself is included or excluded by the respective ranges.
String
- the other version range to be intersected with this version rangestring of the underlying data as maven version range. for prereleased versions with ranges like [1.pre, 1.pre] the to range will be replaced by the single boundary of the range.
Groovy Documentation