Skip to content

Commit

Permalink
Merge pull request #7 from nebula-plugins/fix-VersionWithSelector
Browse files Browse the repository at this point in the history
fix GradleVersion comparison in VersionWithSelector for DefaultVersionSelectorScheme
  • Loading branch information
rpalcolea authored Sep 11, 2019
2 parents ddd37a6 + 9444098 commit e9d05f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/com/netflix/nebula/interop/versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ private val VERSIONED_COMPARATOR = DefaultVersionComparator()
private val VERSION_COMPARATOR = VERSIONED_COMPARATOR.asVersionComparator()
private val VERSION_PARSER = VersionParser()
private val VERSION_SELECTOR_SCHEME_CLASS = DefaultVersionSelectorScheme::class.java
private val VERSION_SCHEME = if(GradleVersion.current().versionGreaterThan("5.0")) VERSION_SELECTOR_SCHEME_CLASS.getConstructor(VersionComparator::class.java).newInstance(VERSIONED_COMPARATOR) else VERSION_SELECTOR_SCHEME_CLASS.getConstructor(VersionComparator::class.java, VersionParser::class.java).newInstance(VERSIONED_COMPARATOR, VERSION_PARSER)
private val VERSION_SCHEME = if(GradleVersion.current().versionGreaterThan("5.0"))
VERSION_SELECTOR_SCHEME_CLASS.getConstructor(VersionComparator::class.java, VersionParser::class.java).newInstance(VERSIONED_COMPARATOR, VERSION_PARSER)
else
VERSION_SELECTOR_SCHEME_CLASS.getConstructor(VersionComparator::class.java).newInstance(VERSIONED_COMPARATOR)

data class VersionWithSelector(val stringVersion: String, val version: Version = VERSION_PARSER.transform(stringVersion)) : Comparable<Version>, Version by version {
private val selector: VersionSelector by lazy {
Expand Down

0 comments on commit e9d05f6

Please sign in to comment.