diff --git a/build.gradle b/build.gradle index 6f45fce8..6b86b515 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ repositories { mavenCentral() } -task buildMainReadme { +tasks.register('buildMainReadme') { doFirst { def subProjects = project.subprojects //.findAll { !it.name.contains("kinect-common") && !it.name.contains @@ -37,7 +37,7 @@ task buildMainReadme { // Skip the hash character from the headline, then start // on the next line and continue until the next empty line. // Don't fall into Windows line breaks. - def descriptionRx = ~/(?s)\#.*?\n(.+?)\n\r?\n/ + def descriptionRx = ~/(?s)#.*?\n(.+?)\n\r?\n/ // Note: the readme needs an empty line after the description def orxMultiplatform = [] @@ -93,8 +93,8 @@ group = "org.openrndr.extra" nexusPublishing { repositories { sonatype { - username.set(findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")) - password.set(findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")) + username.set(findProperty("ossrhUsername")?.toString() ?: System.getenv("OSSRH_USERNAME")) + password.set(findProperty("ossrhPassword")?.toString() ?: System.getenv("OSSRH_PASSWORD")) nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots")) } @@ -109,6 +109,14 @@ subprojects { } } +dependencies { + subprojects.findAll { + it.name.startsWith("orx-") + }.each { subproject -> + dokka(project(subproject.path)) + } +} + gradle.buildFinished { println("\n") println("orx = \"${version}\"") diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts index 9bce7196..b0692cc4 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts @@ -1,8 +1,5 @@ package org.openrndr.extra.convention -import org.jetbrains.dokka.gradle.DokkaTaskPartial -import java.net.URL - plugins { id("org.jetbrains.dokka") } @@ -11,27 +8,31 @@ repositories { mavenCentral() } -tasks.withType() { - dokkaSourceSets { - configureEach { - skipDeprecated.set(true) - val sourcesDirectory = try { - file("src/$name/kotlin", PathValidation.EXISTS) - } catch (_: InvalidUserDataException) { - return@configureEach - } - // Specifies the location of the project source code on the Web. - // If provided, Dokka generates "source" links for each declaration. - sourceLink { - // Unix based directory relative path to the root of the project (where you execute gradle respectively). - localDirectory.set(sourcesDirectory) - // URL showing where the source code can be accessed through the web browser - remoteUrl.set( - URL("https://github.com/openrndr/orx/blob/master/${moduleName.get()}/src/$name/kotlin") - ) - // Suffix which is used to append the line number to the URL. Use #L for GitHub - remoteLineSuffix.set("#L") - } +dokka { + pluginsConfiguration.html { + customStyleSheets.from(rootProject.file("dokka/styles/extra.css")) + customAssets.from(rootProject.file("dokka/images/logo-icon.svg")) + } + dokkaSourceSets.configureEach { + skipDeprecated.set(false) + + val sourcesDirectory = try { + file("src/$name/kotlin", PathValidation.EXISTS) + } catch (_: InvalidUserDataException) { + return@configureEach + } + + // Specifies the location of the project source code on the Web. + // If provided, Dokka generates "source" links for each declaration. + sourceLink { + // Unix based directory relative path to the root of the project (where you execute gradle respectively). + localDirectory = sourcesDirectory + + // URL showing where the source code can be accessed through the web browser + remoteUrl("https://github.com/openrndr/orx/blob/master/${moduleName.get()}/src/$name/kotlin") + + // Suffix which is used to append the line number to the URL. Use #L for GitHub + remoteLineSuffix.set("#L") } } -} \ No newline at end of file +} diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts index 38156852..ca9057e0 100644 --- a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -116,7 +116,7 @@ val isReleaseVersion = !(version.toString()).endsWith("SNAPSHOT") if (shouldPublish) { publishing { publications { - val fjdj = tasks.create("fakeJavaDocJar", Jar::class) { + val fjdj = tasks.register("fakeJavaDocJar", Jar::class) { archiveClassifier.set("javadoc") } named("js") { @@ -190,4 +190,4 @@ kotlin { } } -tasks.withType().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir } \ No newline at end of file +tasks.withType().matching { it.name == "jvmRun" }.configureEach { workingDir = rootDir } diff --git a/dokka/images/logo-icon.svg b/dokka/images/logo-icon.svg new file mode 100644 index 00000000..57694fb7 --- /dev/null +++ b/dokka/images/logo-icon.svg @@ -0,0 +1,2 @@ + + diff --git a/dokka/styles/extra.css b/dokka/styles/extra.css new file mode 100644 index 00000000..ea6338ee --- /dev/null +++ b/dokka/styles/extra.css @@ -0,0 +1,4 @@ + +.library-name--link { text-transform: uppercase; } +.library-version { top: 0px; margin-left: 10px; } + diff --git a/gradle.properties b/gradle.properties index 3432648a..402d2e42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ # suppress inspection "UnusedProperty" for whole file kotlin.code.style=official + # For optimal compilation performance org.gradle.jvmargs=-Xmx2G -XX:+UseParallelGC kotlin.incremental.multiplatform=true @@ -8,7 +9,15 @@ kotlin.incremental.multiplatform=true kotlin.jvm.target.validation.mode=error org.gradle.parallel=true org.gradle.caching=true + +#org.gradle.configuration-cache=true +#org.gradle.configuration-cache.parallel=true +#org.gradle.configuration-cache.problems=warn + # Whether to automatically bundle the Kotlin standard library (true by default) # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=true -kotlin.mpp.import.legacyTestSourceSetDetection=true \ No newline at end of file +kotlin.mpp.import.legacyTestSourceSetDetection=true + +# Enable Dokka 2.0.0 +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d46b3d62..14548487 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ kotlinxCoroutines = "1.10.2" kotlinLogging = "7.0.7" kotlinxSerialization = "1.9.0" kotest = "5.9.1" -dokka = "1.7.10" +dokka = "2.0.0" nebulaRelease = "18.0.7" gradleNexusPublish = "2.0.0" boofcv = "1.2.3" diff --git a/orx-expression-evaluator/build.gradle.kts b/orx-expression-evaluator/build.gradle.kts index e8cdc020..c5cdda40 100644 --- a/orx-expression-evaluator/build.gradle.kts +++ b/orx-expression-evaluator/build.gradle.kts @@ -50,10 +50,7 @@ kotlin { } } -tasks.withType> { - dependsOn(generateKotlinGrammarSource) -} - -tasks.withType { - dependsOn(generateKotlinGrammarSource) -} \ No newline at end of file +tasks.withType> { dependsOn(generateKotlinGrammarSource) } +tasks.withType { dependsOn(generateKotlinGrammarSource) } +tasks.named("dokkaGeneratePublicationHtml") { dependsOn(generateKotlinGrammarSource) } +tasks.named("dokkaGenerateModuleHtml") { dependsOn(generateKotlinGrammarSource) } diff --git a/orx-jvm/orx-kotlin-parser/build.gradle.kts b/orx-jvm/orx-kotlin-parser/build.gradle.kts index 6011bd6c..a657a3b6 100644 --- a/orx-jvm/orx-kotlin-parser/build.gradle.kts +++ b/orx-jvm/orx-kotlin-parser/build.gradle.kts @@ -23,3 +23,5 @@ dependencies { tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") tasks.getByName("sourcesJar").dependsOn("generateGrammarSource") +tasks.named("dokkaGeneratePublicationHtml") { dependsOn("generateGrammarSource") } +tasks.named("dokkaGenerateModuleHtml") { dependsOn("generateGrammarSource") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 5a2bc79f..f1fa48d6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -72,7 +72,6 @@ include( "orx-shade-styles", "orx-shapes", "orx-svg", - "orx-jvm:orx-syphon", "orx-temporal-blur", "orx-timer",