Skip to content

Commit 77f30d4

Browse files
committed
Make Dokka work
Fix deprecations
1 parent b4d2719 commit 77f30d4

10 files changed

Lines changed: 63 additions & 41 deletions

File tree

build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88
mavenCentral()
99
}
1010

11-
task buildMainReadme {
11+
tasks.register('buildMainReadme') {
1212
doFirst {
1313
def subProjects = project.subprojects
1414
//.findAll { !it.name.contains("kinect-common") && !it.name.contains
@@ -37,7 +37,7 @@ task buildMainReadme {
3737
// Skip the hash character from the headline, then start
3838
// on the next line and continue until the next empty line.
3939
// Don't fall into Windows line breaks.
40-
def descriptionRx = ~/(?s)\#.*?\n(.+?)\n\r?\n/
40+
def descriptionRx = ~/(?s)#.*?\n(.+?)\n\r?\n/
4141
// Note: the readme needs an empty line after the description
4242

4343
def orxMultiplatform = []
@@ -93,8 +93,8 @@ group = "org.openrndr.extra"
9393
nexusPublishing {
9494
repositories {
9595
sonatype {
96-
username.set(findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME"))
97-
password.set(findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD"))
96+
username.set(findProperty("ossrhUsername")?.toString() ?: System.getenv("OSSRH_USERNAME"))
97+
password.set(findProperty("ossrhPassword")?.toString() ?: System.getenv("OSSRH_PASSWORD"))
9898
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
9999
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots"))
100100
}
@@ -109,6 +109,14 @@ subprojects {
109109
}
110110
}
111111

112+
dependencies {
113+
subprojects.findAll {
114+
it.name.startsWith("orx-")
115+
}.each { subproject ->
116+
dokka(project(subproject.path))
117+
}
118+
}
119+
112120
gradle.buildFinished {
113121
println("\n")
114122
println("orx = \"${version}\"")
Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package org.openrndr.extra.convention
22

3-
import org.jetbrains.dokka.gradle.DokkaTaskPartial
4-
import java.net.URL
5-
63
plugins {
74
id("org.jetbrains.dokka")
85
}
@@ -11,27 +8,31 @@ repositories {
118
mavenCentral()
129
}
1310

14-
tasks.withType<DokkaTaskPartial>() {
15-
dokkaSourceSets {
16-
configureEach {
17-
skipDeprecated.set(true)
18-
val sourcesDirectory = try {
19-
file("src/$name/kotlin", PathValidation.EXISTS)
20-
} catch (_: InvalidUserDataException) {
21-
return@configureEach
22-
}
23-
// Specifies the location of the project source code on the Web.
24-
// If provided, Dokka generates "source" links for each declaration.
25-
sourceLink {
26-
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
27-
localDirectory.set(sourcesDirectory)
28-
// URL showing where the source code can be accessed through the web browser
29-
remoteUrl.set(
30-
URL("https://github.com/openrndr/orx/blob/master/${moduleName.get()}/src/$name/kotlin")
31-
)
32-
// Suffix which is used to append the line number to the URL. Use #L for GitHub
33-
remoteLineSuffix.set("#L")
34-
}
11+
dokka {
12+
pluginsConfiguration.html {
13+
customStyleSheets.from(rootProject.file("dokka/styles/extra.css"))
14+
customAssets.from(rootProject.file("dokka/images/logo-icon.svg"))
15+
}
16+
dokkaSourceSets.configureEach {
17+
skipDeprecated.set(false)
18+
19+
val sourcesDirectory = try {
20+
file("src/$name/kotlin", PathValidation.EXISTS)
21+
} catch (_: InvalidUserDataException) {
22+
return@configureEach
23+
}
24+
25+
// Specifies the location of the project source code on the Web.
26+
// If provided, Dokka generates "source" links for each declaration.
27+
sourceLink {
28+
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
29+
localDirectory = sourcesDirectory
30+
31+
// URL showing where the source code can be accessed through the web browser
32+
remoteUrl("https://github.com/openrndr/orx/blob/master/${moduleName.get()}/src/$name/kotlin")
33+
34+
// Suffix which is used to append the line number to the URL. Use #L for GitHub
35+
remoteLineSuffix.set("#L")
3536
}
3637
}
37-
}
38+
}

buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ val isReleaseVersion = !(version.toString()).endsWith("SNAPSHOT")
116116
if (shouldPublish) {
117117
publishing {
118118
publications {
119-
val fjdj = tasks.create("fakeJavaDocJar", Jar::class) {
119+
val fjdj = tasks.register("fakeJavaDocJar", Jar::class) {
120120
archiveClassifier.set("javadoc")
121121
}
122122
named("js") {
@@ -190,4 +190,4 @@ kotlin {
190190
}
191191
}
192192

193-
tasks.withType<JavaExec>().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir }
193+
tasks.withType<JavaExec>().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir }

dokka/images/logo-icon.svg

Lines changed: 2 additions & 0 deletions
Loading

dokka/styles/extra.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
.library-name--link { text-transform: uppercase; }
3+
.library-version { top: 0px; margin-left: 10px; }
4+

gradle.properties

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# suppress inspection "UnusedProperty" for whole file
22

33
kotlin.code.style=official
4+
45
# For optimal compilation performance
56
org.gradle.jvmargs=-Xmx2G -XX:+UseParallelGC
67
kotlin.incremental.multiplatform=true
78
# https://kotlinlang.org/docs/gradle.html#check-for-jvm-target-compatibility-of-related-compile-tasks
89
kotlin.jvm.target.validation.mode=error
910
org.gradle.parallel=true
1011
org.gradle.caching=true
12+
13+
#org.gradle.configuration-cache=true
14+
#org.gradle.configuration-cache.parallel=true
15+
#org.gradle.configuration-cache.problems=warn
16+
1117
# Whether to automatically bundle the Kotlin standard library (true by default)
1218
# https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library
1319
kotlin.stdlib.default.dependency=true
14-
kotlin.mpp.import.legacyTestSourceSetDetection=true
20+
kotlin.mpp.import.legacyTestSourceSetDetection=true
21+
22+
# Enable Dokka 2.0.0
23+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kotlinxCoroutines = "1.10.2"
88
kotlinLogging = "7.0.7"
99
kotlinxSerialization = "1.9.0"
1010
kotest = "5.9.1"
11-
dokka = "1.7.10"
11+
dokka = "2.0.0"
1212
nebulaRelease = "18.0.7"
1313
gradleNexusPublish = "2.0.0"
1414
boofcv = "1.2.3"

orx-expression-evaluator/build.gradle.kts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ kotlin {
5050
}
5151
}
5252

53-
tasks.withType<KotlinCompilationTask<*>> {
54-
dependsOn(generateKotlinGrammarSource)
55-
}
56-
57-
tasks.withType<org.gradle.jvm.tasks.Jar> {
58-
dependsOn(generateKotlinGrammarSource)
59-
}
53+
tasks.withType<KotlinCompilationTask<*>> { dependsOn(generateKotlinGrammarSource) }
54+
tasks.withType<org.gradle.jvm.tasks.Jar> { dependsOn(generateKotlinGrammarSource) }
55+
tasks.named("dokkaGeneratePublicationHtml") { dependsOn(generateKotlinGrammarSource) }
56+
tasks.named("dokkaGenerateModuleHtml") { dependsOn(generateKotlinGrammarSource) }

orx-jvm/orx-kotlin-parser/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ dependencies {
2323

2424
tasks.getByName("compileKotlin").dependsOn("generateGrammarSource")
2525
tasks.getByName("sourcesJar").dependsOn("generateGrammarSource")
26+
tasks.named("dokkaGeneratePublicationHtml") { dependsOn("generateGrammarSource") }
27+
tasks.named("dokkaGenerateModuleHtml") { dependsOn("generateGrammarSource") }

settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ include(
7272
"orx-shade-styles",
7373
"orx-shapes",
7474
"orx-svg",
75-
7675
"orx-jvm:orx-syphon",
7776
"orx-temporal-blur",
7877
"orx-timer",

0 commit comments

Comments
 (0)