val mavenRepo = publishExtension.repositories.find { it is MavenArtifactRepository }
if (mavenRepo != null) {
println("Repository URL:" + mavenRepo.url)
}
Just now, I wrote the code above. I think it works in theory.
Or did I miss something?
That’s the type of query I’m looking for, so why am I being asked to continue judging it once more?
val mavenRepo =
publishExtension.repositories.find { it is MavenArtifactRepository }
if (mavenRepo is MavenArtifactRepository) {
println("Repository URL:" + mavenRepo.url)
}
I’ve changed it to this now and it looks slightly redundant