Permalink
Browse files

Use new container methods in Kotlin DSL for maven-publish plugin

  • Loading branch information...
ingokegel committed Aug 30, 2018
1 parent 902f8fc commit ce1a4ebd460579d19baea7fbdb47004df1a18460
Showing with 24 additions and 22 deletions.
  1. +19 −18 buildSrc/src/main/kotlin/BuildUtil.kt
  2. +5 −4 modules/data/data.gradle.kts
@@ -15,7 +15,6 @@ fun Project.configurePublishing() {
val bintrayUser: String? by extra
val bintrayApiKey: String? by extra
val publications = the<PublishingExtension>().publications
tasks {
"bintrayUpload"(BintrayUploadTask::class) {
doFirst {
@@ -34,24 +33,26 @@ fun Project.configurePublishing() {
dependsOn("publishModulePublicationToMavenLocal", "jar")
}
publications {
create("Module", MavenPublication::class) {
from(project.components["java"])
artifactId = "jclasslib-${project.name}"
artifact(sourcesJar)
pom {
licenses {
license {
name.set("GPL Version 2.0")
url.set("https://www.gnu.org/licenses/gpl-2.0.html")
configure<PublishingExtension> {
publications {
create<MavenPublication>("Module") {
from(project.components["java"])
artifactId = "jclasslib-${project.name}"
artifact(sourcesJar)
pom {
licenses {
license {
name.set("GPL Version 2.0")
url.set("https://www.gnu.org/licenses/gpl-2.0.html")
}
}
}
developers {
developer {
name.set("Ingo Kegel")
url.set("https://github.com/ingokegel/jclasslib")
organization.set("ej-technologies GmbH")
organizationUrl.set("https://www.ej-technologies.com")
developers {
developer {
name.set("Ingo Kegel")
url.set("https://github.com/ingokegel/jclasslib")
organization.set("ej-technologies GmbH")
organizationUrl.set("https://www.ej-technologies.com")
}
}
}
}
@@ -13,7 +13,6 @@ dependencies {
compile(kotlin("stdlib"))
}
val publications: PublicationContainer = the<PublishingExtension>().publications
var externalLibsDir: File by rootProject.extra
tasks {
@@ -48,9 +47,11 @@ tasks {
from(dokkaJavadoc.outputDirectory)
}
publications {
"Module"(MavenPublication::class) {
artifact(mapOf("source" to javadocJar, "classifier" to "javadoc"))
publishing {
publications {
named<MavenPublication>("Module") {
artifact(mapOf("source" to javadocJar, "classifier" to "javadoc"))
}
}
}

0 comments on commit ce1a4eb

Please sign in to comment.