I am using the maven-publish and signing Gradle plugins in my Android library's Groovy DSL build.gradle file as follows:
plugins {
id("maven-publish")
id("signing")
}
android {
publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
}
publishing {
publications {
release(MavenPublication) {
afterEvaluate {
from components.release
}
groupId getProperty("groupId")
artifactId getProperty("artifactId")
version getProperty("version")
}
}
repositories {
maven {
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username getProperty("sonatypeUsername")
password getProperty("sonatypePassword")
}
}
}
}
signing {
sign publishing.publications.release
}
I have omitted the parts of my build.gradle file which are unrelated to or optional for publishing and signing.
How do I convert these declarations to the Kotlin DSL?
Here are the declarations converted to the Kotlin DSL:
Notes
build.gradle.ktsfile which includes all of the declarations above here.