Android Single Variant Library
data class AndroidSingleVariantLibrary @JvmOverloads constructor(val variant: String = "release", val sourcesJar: Boolean = true, val publishJavadocJar: Boolean = true) : Platform
To be used for com.android.library projects. Applying this creates a publication for the component of the given variant. Depending on the passed parameters for javadocJar and sourcesJar, -javadoc and -sources jars will be added to the publication.
Equivalent Gradle set up:
android {
publishing {
singleVariant("variant") {
withSourcesJar()
withJavadocJar()
}
}
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>("variant") {
from(components["variant"])
}
}
}
}Content copied to clipboard