1
+ import org.jetbrains.dokka.gradle.DokkaTask
1
2
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
2
3
3
4
plugins {
@@ -172,7 +173,6 @@ signing {
172
173
sign(publishing.publications[" jvm" ])
173
174
}
174
175
175
-
176
176
// get signing confs interactivly if needed
177
177
gradle.taskGraph.whenReady {
178
178
val alreadyConfigured = with (project.extra) {
@@ -184,8 +184,10 @@ gradle.taskGraph.whenReady {
184
184
// a CI environment)
185
185
val console = System .console()
186
186
requireNotNull(console) { " Could not get signing config: please provide yours in the gradle.properties file." }
187
- console.printf(" \n\n We have to sign some things in this build." +
188
- " \n\n Please enter your signing details.\n\n " )
187
+ console.printf(
188
+ " \n\n We have to sign some things in this build." +
189
+ " \n\n Please enter your signing details.\n\n "
190
+ )
189
191
190
192
val id = console.readLine(" PGP Key Id: " )
191
193
val file = console.readLine(" PGP Secret Key Ring File (absolute path): " )
@@ -200,3 +202,36 @@ gradle.taskGraph.whenReady {
200
202
console.printf(" \n Thanks.\n\n " )
201
203
}
202
204
}
205
+
206
+ tasks {
207
+ val dokka by getting(DokkaTask ::class ) {
208
+ outputDirectory = " docs"
209
+ outputFormat = " html"
210
+
211
+ multiplatform {
212
+ val js by creating {}
213
+ val jvm by creating {}
214
+
215
+ register(" common" ) {}
216
+
217
+ register(" global" ) {
218
+ sourceLink {
219
+ path = " ./"
220
+ url = " https://github.com/adamint/spotify-web-api-kotlin/tree/master/"
221
+ lineSuffix = " #L"
222
+ }
223
+
224
+ sourceRoot {
225
+ path = kotlin.sourceSets.getByName(" jvmMain" ).kotlin.srcDirs.first().toString()
226
+ }
227
+ sourceRoot {
228
+ path = kotlin.sourceSets.getByName(" commonMain" ).kotlin.srcDirs.first().toString()
229
+ }
230
+ }
231
+ }
232
+ }
233
+
234
+ " publish" {
235
+ dependsOn(dokka)
236
+ }
237
+ }
0 commit comments