11plugins {
22 kotlin(" multiplatform" )
33 kotlin(" plugin.serialization" ).version(Versions .KOTLIN )
4- id(" org.jetbrains.dokka" ).version(Versions .DOKKA_PLUGIN )
54 id(" com.chromaticnoise.multiplatform-swiftpackage" ).version(Versions .SPM_PLUGIN )
5+ id(" com.vanniktech.maven.publish" )
66 id(" com.android.library" )
7- id(" maven-publish" )
8- id(" signing" )
97 id(" io.gitlab.arturbosch.detekt" )
108 id(" org.jlleitschuh.gradle.ktlint" )
119 id(" org.jetbrains.kotlinx.kover" )
@@ -24,8 +22,8 @@ kover {
2422 }
2523}
2624
27- val iosLibraryName = properties[" library.ios.name " ].toString()
28- version = properties[" library.version " ].toString()
25+ val iosLibraryName = properties[" IOS_NAME " ].toString()
26+ version = properties[" VERSION_NAME " ].toString()
2927
3028multiplatformSwiftPackage {
3129 packageName(iosLibraryName)
@@ -38,7 +36,7 @@ multiplatformSwiftPackage {
3836
3937kotlin {
4038 android()
41-
39+ jvm()
4240 listOf (
4341 iosX64(),
4442 iosArm64(),
@@ -98,6 +96,16 @@ kotlin {
9896 iosArm64Test.dependsOn(this )
9997 iosSimulatorArm64Test.dependsOn(this )
10098 }
99+ val jvmMain by getting {
100+ dependencies {
101+ implementation(Dependencies .Network .KTOR_JAVA )
102+ }
103+ }
104+ val jvmTest by getting {
105+ dependencies {
106+ implementation(Dependencies .Test .MOCKK_JVM )
107+ }
108+ }
101109 }
102110}
103111
@@ -110,84 +118,24 @@ android {
110118 }
111119}
112120
113- val dokkaOutputDir = " $buildDir /dokka"
114-
115- tasks.dokkaHtml {
116- outputDirectory.set(file(dokkaOutputDir))
117- }
118-
119- val deleteDokkaOutputDir by tasks.register<Delete >(" deleteDokkaOutputDirectory" ) {
120- delete(dokkaOutputDir)
121- }
122- val javadocJar = tasks.register<Jar >(" javadocJar" ) {
123- dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
124- archiveClassifier.set(" javadoc" )
125- from(dokkaOutputDir)
126- }
127-
128- publishing {
129- repositories {
130- maven {
131- name = " YChat"
132- setUrl(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" )
133- credentials {
134- username = project.findProperty(" mavenCentralUsername" )?.toString() ? : System .getenv(" MAVEN_USERNAME" )
135- password = project.findProperty(" mavenCentralPassword" )?.toString() ? : System .getenv(" MAVEN_PASSWORD" )
121+ mavenPublishing {
122+ pom {
123+ developers {
124+ developer {
125+ id.set(" osugikoji" )
126+ name.set(" Koji Osugi" )
127+ url.set(" https://github.com/osugikoji" )
136128 }
137- }
138- }
139- publications {
140- register<MavenPublication >(" release" ) {
141- groupId = " co.yml"
142- artifactId = " ychat"
143- version = properties[" library.version" ].toString()
144- afterEvaluate {
145- from(components[" release" ])
129+ developer {
130+ id.set(" renatoarg" )
131+ name.set(" Renato Goncalves" )
132+ url.set(" https://github.com/renatoarg" )
146133 }
147- artifact(javadocJar)
148- pom {
149- name.set(" YChat" )
150- description.set(" YChat SDK is kotlin multiplatform library for chat gpt apis." )
151- url.set(" https://github.com/yml-org/ychat" )
152- licenses {
153- license {
154- name.set(" The Apache License, Version 2.0" )
155- url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
156- distribution.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
157- }
158- }
159- developers {
160- developer {
161- id.set(" osugikoji" )
162- name.set(" Koji Osugi" )
163- url.set(" https://github.com/osugikoji" )
164- }
165- developer {
166- id.set(" renatoarg" )
167- name.set(" Renato Goncalves" )
168- url.set(" https://github.com/renatoarg" )
169- }
170- developer {
171- id.set(" kikoso" )
172- name.set(" Enrique López Mañas" )
173- url.set(" https://github.com/kikoso" )
174- }
175- }
176- scm {
177- url.set(" https://github.com/yml-org/ychat" )
178- connection.set(" scm:git:git://github.com/yml-org/ychat.git" )
179- developerConnection.set(
" scm:git:ssh://[email protected] :yml-org/ychat.git" )
180- }
134+ developer {
135+ id.set(" kikoso" )
136+ name.set(" Enrique López Mañas" )
137+ url.set(" https://github.com/kikoso" )
181138 }
182139 }
183140 }
184141}
185-
186- signing {
187- useInMemoryPgpKeys(
188- project.findProperty(" signing.keyId" )?.toString() ? : System .getenv(" SIGNINGKEY" ),
189- project.findProperty(" signing.InMemoryKey" )?.toString() ? : System .getenv(" MEMORY_KEY" ),
190- project.findProperty(" signing.password" )?.toString() ? : System .getenv(" SIGNINGPASSWORD" )
191- )
192- sign(publishing.publications)
193- }
0 commit comments