1
- import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1
+ import com.vanniktech.maven.publish.SonatypeHost
2
2
3
3
plugins {
4
- kotlin(" jvm " ) version " 2.0.21"
5
- ` maven- publish`
4
+ kotlin(" multiplatform " ) version " 2.0.21"
5
+ id( " com.vanniktech. maven. publish" ) version " 0.30.0 "
6
6
signing
7
7
id(" org.jetbrains.dokka" ) version " 1.9.20"
8
8
id(" io.gitlab.arturbosch.detekt" ) version " 1.23.7"
@@ -15,90 +15,70 @@ repositories {
15
15
mavenCentral()
16
16
}
17
17
18
- dependencies {
19
- val kotestVersion = " 5.9.1"
20
- testImplementation(" io.kotest:kotest-runner-junit5:$kotestVersion " )
21
- testImplementation(" io.kotest:kotest-property:$kotestVersion " )
22
- }
18
+ kotlin {
19
+ applyDefaultHierarchyTemplate()
23
20
24
- tasks.withType<KotlinCompile > {
25
- kotlinOptions.jvmTarget = " 1.8"
26
- }
21
+ jvm()
22
+ js {
23
+ browser()
24
+ nodejs()
25
+ }
27
26
28
- kotlin {
29
- jvmToolchain(8 )
27
+ iosX64()
28
+ iosArm64()
29
+ iosSimulatorArm64()
30
+
31
+ macosX64()
32
+ macosArm64()
33
+
34
+ linuxX64()
35
+ linuxArm64()
36
+
37
+ sourceSets {
38
+ val jvmTest by getting {
39
+ dependencies {
40
+ val kotestVersion = " 5.9.1"
41
+
42
+ implementation(" io.kotest:kotest-runner-junit5:$kotestVersion " )
43
+ implementation(" io.kotest:kotest-property:$kotestVersion " )
44
+ }
45
+ }
46
+ }
30
47
}
31
48
32
49
tasks.withType<Test > {
33
50
useJUnitPlatform()
34
51
}
35
52
36
- val sourcesJar by tasks.registering(Jar ::class ) {
37
- archiveClassifier.set(" sources" )
38
- from(sourceSets.getByName(" main" ).allSource)
39
- }
53
+ mavenPublishing {
54
+ publishToMavenCentral(SonatypeHost .DEFAULT )
55
+ signAllPublications()
40
56
41
- val javadocJar by tasks.registering(Jar ::class ) {
42
- dependsOn(" dokkaHtml" )
43
- archiveClassifier.set(" javadoc" )
44
- from(" $buildDir /dokka" )
45
- }
57
+ pom {
58
+ name.set(" SimpleCpfValidator" )
59
+ description.set(" Simple CPF Validator" )
60
+ url.set(" https://www.github.com/LeoColman/SimpleCpfValidator" )
46
61
47
- publishing {
48
- repositories {
49
- maven(" https://oss.sonatype.org/service/local/staging/deploy/maven2" ) {
50
- credentials {
51
- username = System .getenv(" OSSRH_USERNAME" )
52
- password = System .getenv(" OSSRH_PASSWORD" )
53
- }
62
+
63
+ scm {
64
+ connection.set(" scm:git:http://www.github.com/LeoColman/SimpleCpfValidator/" )
65
+ developerConnection.set(" scm:git:http://github.com/LeoColman/" )
66
+ url.set(" https://www.github.com/LeoColman/SimpleCpfValidator" )
54
67
}
55
- }
56
68
57
- publications {
58
- register(" mavenJava" , MavenPublication ::class ) {
59
- from(components[" java" ])
60
- artifact(sourcesJar.get())
61
- artifact(javadocJar.get())
62
-
63
- pom {
64
- name.set(" SimpleCpfValidator" )
65
- description.set(" Simple CPF Validator" )
66
- url.set(" https://www.github.com/LeoColman/SimpleCpfValidator" )
67
-
68
-
69
- scm {
70
- connection.set(" scm:git:http://www.github.com/LeoColman/SimpleCpfValidator/" )
71
- developerConnection.set(" scm:git:http://github.com/LeoColman/" )
72
- url.set(" https://www.github.com/LeoColman/SimpleCpfValidator" )
73
- }
74
-
75
- licenses {
76
- license {
77
- name.set(" The Apache 2.0 License" )
78
- url.set(" https://opensource.org/licenses/Apache-2.0" )
79
- }
80
- }
81
-
82
- developers {
83
- developer {
84
- id.set(" LeoColman" )
85
- name.set(" Leonardo Colman Lopes" )
86
-
87
- }
88
- }
69
+ licenses {
70
+ license {
71
+ name.set(" The Apache 2.0 License" )
72
+ url.set(" https://opensource.org/licenses/Apache-2.0" )
89
73
}
90
74
}
91
- }
92
- }
93
-
94
- val signingKey: String? by project
95
- val signingPassword: String? by project
96
75
97
- signing {
98
- useGpgCmd()
99
- if (signingKey != null && signingPassword != null ) {
100
- useInMemoryPgpKeys(signingKey, signingPassword)
76
+ developers {
77
+ developer {
78
+ id.set(" LeoColman" )
79
+ name.set(" Leonardo Colman Lopes" )
80
+
81
+ }
82
+ }
101
83
}
102
-
103
- sign(publishing.publications[" mavenJava" ])
104
84
}
0 commit comments