This message was deleted.
# general
s
This message was deleted.
v
To have a method directly callable there is probably not a much nicer way. I'd actually make the closure return the repository to be consistent with the built-in helpers and remove some unnecessary boiler-plate to have it a bit nicer, so it would then be
Copy code
val customRepo = KotlinClosure0<ArtifactRepository>({
    repositories.maven("<https://example.com/repo>") {
        name = "customRepo"
        credentials(PasswordCredentials::class)
    }
})
val closureType = typeOf<Closure<ArtifactRepository?>>()
(repositories as ExtensionAware).extensions.add(closureType, "customRepo", customRepo)
k
Thanks, that seems a bit nicer at least.