1- import org.jetbrains.dokka.gradle.DokkaTask
21import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32
43plugins {
5- kotlin(" jvm" ) version " 1.4.0 "
4+ kotlin(" jvm" ) version " 1.9.20 "
65 `maven- publish`
76 signing
8- id(" org.jetbrains.dokka" ) version " 0.10.1 "
9- id(" io.gitlab.arturbosch.detekt" ).version(" 1.11.0 " )
10-
7+ id(" org.jetbrains.dokka" ) version " 1.9.10 "
8+ id(" io.gitlab.arturbosch.detekt" ).version(" 1.23.4 " )
9+
1110}
1211
1312group = " br.com.colman.simplecnpjvalidator"
1413version = System .getenv(" RELEASE_VERSION" ) ? : " local"
1514
1615repositories {
1716 mavenCentral()
18- jcenter()
1917}
2018
2119dependencies {
22- testImplementation(" io.kotest:kotest-runner-junit5-jvm:4.2.4" )
23- testImplementation(" io.kotest:kotest-property-jvm:4.2.4" )
20+ testImplementation(" io.kotest:kotest-runner-junit5:5.8.0" )
21+ testImplementation(" io.kotest:kotest-property:5.8.0" )
22+ }
23+
24+ kotlin {
25+ jvmToolchain(8 )
2426}
2527
2628tasks.withType<KotlinCompile > {
@@ -37,56 +39,53 @@ val sourcesJar by tasks.registering(Jar::class) {
3739}
3840
3941val javadocJar by tasks.registering(Jar ::class ) {
40- val javadoc = tasks[" dokka" ] as DokkaTask
41- javadoc.outputFormat = " javadoc"
42- javadoc.outputDirectory = " $buildDir /javadoc"
43- dependsOn(javadoc)
42+ dependsOn(" dokkaHtml" )
4443 archiveClassifier.set(" javadoc" )
45- from(javadoc.outputDirectory )
44+ from(" ${layout.buildDirectory} /dokka " )
4645}
4746
4847publishing {
4948 repositories {
50-
49+
5150 maven(" https://oss.sonatype.org/service/local/staging/deploy/maven2" ) {
5251 credentials {
5352 username = System .getenv(" OSSRH_USERNAME" )
5453 password = System .getenv(" OSSRH_PASSWORD" )
5554 }
5655 }
5756 }
58-
57+
5958 publications {
60-
59+
6160 register(" mavenJava" , MavenPublication ::class ) {
6261 from(components[" java" ])
6362 artifact(sourcesJar.get())
6463 artifact(javadocJar.get())
65-
64+
6665 pom {
6766 name.set(" SimpleCnpjValidator" )
6867 description.set(" Simple CNPJ Validator" )
6968 url.set(" https://www.github.com/LeoColman/SimpleCnpjValidator" )
70-
71-
69+
70+
7271 scm {
7372 connection.set(" scm:git:http://www.github.com/LeoColman/SimpleCnpjValidator/" )
7473 developerConnection.set(" scm:git:http://github.com/LeoColman/" )
7574 url.set(" https://www.github.com/LeoColman/SimpleCnpjValidator" )
7675 }
77-
76+
7877 licenses {
7978 license {
8079 name.set(" The Apache 2.0 License" )
8180 url.set(" https://opensource.org/licenses/Apache-2.0" )
8281 }
8382 }
84-
83+
8584 developers {
8685 developer {
8786 id.set(" LeoColman" )
8887 name.set(" Leonardo Colman Lopes" )
89- email.set(" leonardo. dev@colman.com.br" )
88+ email.set(" dev@leonardo. colman.com.br" )
9089 }
9190 }
9291 }
@@ -104,4 +103,9 @@ signing {
104103 }
105104
106105 sign(publishing.publications[" mavenJava" ])
106+ }
107+
108+ detekt {
109+ autoCorrect = true
110+ buildUponDefaultConfig = true
107111}
0 commit comments