1
1
plugins {
2
2
kotlin(" multiplatform" )
3
3
kotlin(" plugin.serialization" ).version(Versions .KOTLIN )
4
- id(" org.jetbrains.dokka" ).version(Versions .DOKKA_PLUGIN )
5
4
id(" com.chromaticnoise.multiplatform-swiftpackage" ).version(Versions .SPM_PLUGIN )
5
+ id(" com.vanniktech.maven.publish" )
6
6
id(" com.android.library" )
7
- id(" maven-publish" )
8
- id(" signing" )
9
7
id(" io.gitlab.arturbosch.detekt" )
10
8
id(" org.jlleitschuh.gradle.ktlint" )
11
9
id(" org.jetbrains.kotlinx.kover" )
@@ -24,8 +22,8 @@ kover {
24
22
}
25
23
}
26
24
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()
29
27
30
28
multiplatformSwiftPackage {
31
29
packageName(iosLibraryName)
@@ -38,7 +36,7 @@ multiplatformSwiftPackage {
38
36
39
37
kotlin {
40
38
android()
41
-
39
+ jvm()
42
40
listOf (
43
41
iosX64(),
44
42
iosArm64(),
@@ -98,6 +96,16 @@ kotlin {
98
96
iosArm64Test.dependsOn(this )
99
97
iosSimulatorArm64Test.dependsOn(this )
100
98
}
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
+ }
101
109
}
102
110
}
103
111
@@ -110,84 +118,24 @@ android {
110
118
}
111
119
}
112
120
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" )
136
128
}
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" )
146
133
}
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" )
181
138
}
182
139
}
183
140
}
184
141
}
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