Skip to content

Commit

Permalink
added maven publishing for diktat-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nulls committed Sep 26, 2023
1 parent e265cc1 commit 94fdf3f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion diktat-cli/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.incremental.createDirectory

Expand Down Expand Up @@ -27,7 +28,7 @@ dependencies {
testImplementation(libs.mockito)
}

val addLicenseTask = tasks.register("addLicense") {
val addLicenseTask: TaskProvider<Task> = tasks.register("addLicense") {
val licenseFile = rootProject.file("LICENSE")
val outputDir = layout.buildDirectory
.dir("generated/src")
Expand Down Expand Up @@ -73,4 +74,19 @@ tasks {
build {
dependsOn(shadowJar)
}
test {
dependsOn(shadowJar)
}
}

publishing {
publications {
// it creates a publication for shadowJar
create<MavenPublication>("shadow") {
// https://github.com/johnrengelman/shadow/issues/417#issuecomment-830668442
project.extensions.configure<ShadowExtension> {
component(this@create)
}
}
}
}
2 changes: 1 addition & 1 deletion diktat-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {

tasks.withType<KotlinCompile> {
kotlinOptions {
// kotlin 1.4 api is latest support for kotlin 1.9
// kotlin 1.4 api is the latest support version in kotlin 1.9
// min supported Gradle is 7.0
languageVersion = "1.4"
apiVersion = "1.4"
Expand Down

0 comments on commit 94fdf3f

Please sign in to comment.