Skip to content

Commit

Permalink
fix GradleVersion comparison in VersionWithSelector for DefaultVersio…
Browse files Browse the repository at this point in the history
…nSelectorScheme
  • Loading branch information
rpalcolea committed Sep 11, 2019
1 parent ddd37a6 commit 9444098
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 9444098

Please sign in to comment.