diff --git a/src/main/kotlin/com/netflix/nebula/interop/versions.kt b/src/main/kotlin/com/netflix/nebula/interop/versions.kt index f166ef0..7b408de 100644 --- a/src/main/kotlin/com/netflix/nebula/interop/versions.kt +++ b/src/main/kotlin/com/netflix/nebula/interop/versions.kt @@ -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 by version { private val selector: VersionSelector by lazy {