https://kotlinlang.org logo
Title
s

Stephan Schroeder

06/26/2019, 3:33 PM
only 2 problems left: - the
initialVersion
makes problems
scmVersion {
    versionIncrementer 'incrementMinor'
    tag {
        initialVersion = { config, position -> '1.0.0' }
    }
    checks {
        aheadOfRemote = false
        uncommittedChanges = false
    }
}
I got
tasks {
    scmVersion {
        versionIncrementer("incrementMinor")
        tag {
            initialVersion = { config, position -> "1.0.0" }
        }
        checks(delegateClosureOf<ChecksConfig> {
            aheadOfRemote = false
            uncommittedChanges = false
        })
    }
}
but there is no longer an
initialVersion
available, closest thing is maybe
init{versionCreator{...
this wants some closure.
I assume it will be something like
tag {
    init {
        versionCreator(delegateClosureOf<...> {
            ...
        })
    }
}
!?
latest version is:
tag(delegateClosureOf<TagNameSerializationConfig> {
            initialVersion = { rules: TagProperties, position: ScmPosition ->"1.0.0"}
        })
but there is a type mismatch between lambda and closure.
if I check the plugin groovy code there isn’t really a type attached to the closure:
Closure initialVersion = defaultInitialVersion()

private static Closure defaultInitialVersion() {
    return { TagProperties rules, ScmPosition position ->
        return '0.1.0'
    }
}
ok, I’m going now with
tag(delegateClosureOf<TagNameSerializationConfig> {
    initialVersion = KotlinClosure2<TagProperties, ScmPosition, String>({ _, _ ->"1.0.0"})
})