Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Make the publishing valid for Maven Central (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico authored Feb 1, 2023
1 parent 0145827 commit a1c21c0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 46 deletions.
57 changes: 25 additions & 32 deletions detekt-compiler-plugin-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,9 @@ tasks {
}
}

val sourcesJar by tasks.registering(Jar::class) {
dependsOn(tasks.classes)
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val javadocJar by tasks.registering(Jar::class) {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
}

artifacts {
archives(sourcesJar)
archives(javadocJar)
java {
withSourcesJar()
withJavadocJar()
}

gradlePlugin {
Expand Down Expand Up @@ -128,26 +117,30 @@ publishing {
groupId = project.group.toString()
artifactId = project.name
version = detektPluginVersion
pom {
description.set("Gradle plugin to support the compiler plugin for Detekt, the Static code analyzer for Kotlin")
name.set("detekt")
url.set("https://detekt.dev")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
afterEvaluate {
publications.withType<MavenPublication>().configureEach {
pom {
description.set("Gradle plugin to support the compiler plugin for Detekt, the Static code analyzer for Kotlin")
name.set("detekt")
url.set("https://detekt.dev")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
}
developers {
developer {
id.set("Detekt Developers")
name.set("Detekt Developers")
email.set("[email protected]")
developers {
developer {
id.set("Detekt Developers")
name.set("Detekt Developers")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/detekt/detekt")
}
}
scm {
url.set("https://github.com/detekt/detekt")
}
}
}
Expand Down
17 changes: 3 additions & 14 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,9 @@ tasks {
}
}

val sourcesJar by tasks.registering(Jar::class) {
dependsOn(tasks.classes)
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val javadocJar by tasks.registering(Jar::class) {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
}

artifacts {
archives(sourcesJar)
archives(javadocJar)
java {
withSourcesJar()
withJavadocJar()
}

publishing {
Expand Down

0 comments on commit a1c21c0

Please sign in to comment.