diff options
author | Adam <897017+aSemy@users.noreply.github.com> | 2023-10-20 00:39:12 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 13:39:12 +0200 |
commit | 35d15601f2d129a7d3db67dd9e2f4c41c87ef083 (patch) | |
tree | f9098cb5b79fc31b4a393347f5cebcf9d87dd139 /dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests | |
parent | 8016c1face1283952e228aee348487bf0421ab90 (diff) | |
download | dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.gz dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.tar.bz2 dokka-35d15601f2d129a7d3db67dd9e2f4c41c87ef083.zip |
Contribute Dokkatoo (#3188)
Diffstat (limited to 'dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests')
148 files changed, 3728 insertions, 0 deletions
diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/build.gradle.kts new file mode 100644 index 00000000..3af8ad71 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/build.gradle.kts @@ -0,0 +1,281 @@ +@file:Suppress("UnstableApiUsage") // jvm test suites & test report aggregation are incubating + +import buildsrc.tasks.SetupDokkaProjects +import buildsrc.utils.buildDir_ +import buildsrc.utils.skipTestFixturesPublications +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + kotlin("jvm") + kotlin("plugin.serialization") + `java-test-fixtures` + + `jvm-test-suite` + `test-report-aggregation` + + buildsrc.conventions.`java-base` + buildsrc.conventions.`maven-publish-test` + buildsrc.conventions.`dokkatoo-example-projects` + buildsrc.conventions.`android-setup` +} + +description = """ + Integration tests for Dokkatoo Gradle Plugin. + The tests use Gradle TestKit to run the template projects that are committed in the repo. + """.trimIndent() + +dependencies { + testMavenPublication(projects.modules.dokkatooPlugin) + exampleProjects(projects.examples) + + testFixturesApi(testFixtures(projects.modules.dokkatooPlugin)) + + testFixturesImplementation(gradleTestKit()) + + testFixturesImplementation(platform(libs.kotlinxSerialization.bom)) + testFixturesImplementation(libs.kotlinxSerialization.json) + + testFixturesCompileOnly(libs.kotlin.dokkaCore) + + // don't define test dependencies here, instead define them in the testing.suites {} configuration below +} + +kotlin { + target { + compilations.configureEach { + // TODO Dokkatoo uses Gradle 8, while Dokka uses Gradle 7, which has an older version of Kotlin that + // doesn't include these options - so update them or update Gradle. +// compilerOptions.configure { +// freeCompilerArgs.addAll( +// "-opt-in=org.jetbrains.dokka.dokkatoo.internal.DokkatooInternalApi", +// ) +// } + } + } +} + +//region Test suites and task configuration +testing.suites { + withType<JvmTestSuite>().configureEach { + useJUnitJupiter() + + dependencies { + implementation(project.dependencies.gradleTestKit()) + implementation(project.dependencies.testFixtures(project())) + + compileOnly(libs.kotlin.dokkaCore) + + implementation(project.dependencies.platform(libs.kotlinxSerialization.bom)) + implementation(libs.kotlinxSerialization.json) + } + + targets.configureEach { + testTask.configure { + javaLauncher.set(javaToolchains.launcherFor { + // Android test project requires Java 17 + languageVersion.set(JavaLanguageVersion.of(17)) + }) + + val projectTestTempDirPath = "$buildDir_/test-temp-dir" + inputs.property("projectTestTempDir", projectTestTempDirPath) + systemProperty("projectTestTempDir", projectTestTempDirPath) + + // depend on the test-publication configuration, but not the test-maven repo dir + // (otherwise this task will never be up-to-date) + dependsOn(configurations.testMavenPublication) + + // depend on example & integration-test projects setup + dependsOn(configurations.exampleProjects) + dependsOn(tasks.updateDokkatooExamples) + + val dokkatooExamplesDir = configurations.exampleProjects.map { + it.incoming.files.singleFile.absolutePath + } + + systemProperty("integrationTestProjectsDir", "$projectDir/projects") + systemProperty("testMavenRepoDir", file(mavenPublishTest.testMavenRepo).canonicalPath) + doFirst { + // workaround for lazy-properties not working https://github.com/gradle/gradle/issues/12247 + systemProperty("exampleProjectsDir", dokkatooExamplesDir.get()) + } + } + } + } + + /** Examples tests suite */ + val testExamples by registering(JvmTestSuite::class) { + description = "Test the example projects, from the 'examples' directory in the project root" + } + + /** Integration tests suite */ + val testIntegration by registering(JvmTestSuite::class) { + description = + "Test the integration template projects, in the dokkatoo-plugin-integration-tests/projects directory" + } + + tasks.check { dependsOn(testExamples, testIntegration) } +} + + +tasks.withType<Test>().configureEach { + // this seems to help OOM errors in the Worker Daemons + //setForkEvery(1) + jvmArgs( + "-Xmx1g", + "-XX:MaxMetaspaceSize=512m", + ) + + mustRunAfter(tasks.withType<AbstractPublishToMaven>()) + + testLogging { + events = setOf( + TestLogEvent.STARTED, + TestLogEvent.PASSED, + TestLogEvent.SKIPPED, + TestLogEvent.FAILED, + TestLogEvent.STANDARD_OUT, + TestLogEvent.STANDARD_ERROR, + ) + showStandardStreams = true + showExceptions = true + showCauses = true + showStackTraces = true + } +} +//endregion + +//region Example & Template projects setup +dokkatooExampleProjects { + exampleProjects { + projectsItAndroid0Dokkatoo { + gradlePropertiesContent.add("android.useAndroidX=true") + } + } +} + +dokkaTemplateProjects { + + val androidLocalPropertiesFile = tasks.createAndroidLocalPropertiesFile.map { + it.outputs.files + } + + register( + source = "integration-tests/gradle/projects/it-android-0", + destination = "projects/it-android-0/dokka", + ) { + additionalFiles.from(androidLocalPropertiesFile) + } + register( + source = "integration-tests/gradle/projects/it-basic", + destination = "projects/it-basic/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-basic-groovy", + destination = "projects/it-basic-groovy/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-collector-0", + destination = "projects/it-collector-0/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-js-ir-0", + destination = "projects/it-js-ir-0/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-multimodule-0", + destination = "projects/it-multimodule-0/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-multimodule-1", + destination = "projects/it-multimodule-1/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-multimodule-versioning-0", + destination = "projects/it-multimodule-versioning-0/dokka", + ) + register( + source = "integration-tests/gradle/projects/it-multiplatform-0", + destination = "projects/it-multiplatform-0/dokka", + ) + +// register("projects/coroutines/dokka") { } +// register("projects/serialization/dokka") { } +// register("projects/stdlib/dokka") { } + + configureEach { + additionalPaths.addAll( + "integration-tests/gradle/projects/template.root.gradle.kts", + "integration-tests/gradle/projects/template.settings.gradle.kts", + ) + } +} + +tasks.setupDokkaTemplateProjects.configure { + + val kotlinDokkaVersion = libs.versions.kotlin.dokka + inputs.property("kotlinDokkaVersion", kotlinDokkaVersion) + + doLast { + outputs.files.asFileTree.files.forEach { file -> + when (file.name) { + "build.gradle.kts" -> { + file.writeText( + file.readText() + .replace( + """../template.root.gradle.kts""", + """./template.root.gradle.kts""", + ).replace( + """${'$'}{System.getenv("DOKKA_VERSION")}""", + kotlinDokkaVersion.get(), + ) + ) + } + + "settings.gradle.kts" -> { + file.writeText( + file.readText() + .replace( + """../template.settings.gradle.kts""", + """./template.settings.gradle.kts""", + ) + ) + } + + "template.settings.gradle.kts" -> { + file.writeText( + file.readText() + .replace( + """for-integration-tests-SNAPSHOT""", + kotlinDokkaVersion.get(), + ) + ) + } + } + } + } +} + +tasks.withType<Test>().configureEach { + // this seems to help OOM errors in the Worker Daemons + //setForkEvery(1) + jvmArgs( + "-Xmx1g", + "-XX:MaxMetaspaceSize=512m", + "-XX:+AlwaysPreTouch", // https://github.com/gradle/gradle/issues/3093#issuecomment-387259298 + ) +} + +dokkaSourceDownload { + dokkaVersion.set(libs.versions.kotlin.dokka) +} + +tasks.updateAndroidLocalProperties { + mustRunAfter(tasks.withType<SetupDokkaProjects>()) +} + +tasks.updateDokkatooExamples { + dependsOn(tasks.updateAndroidLocalProperties) +} +//endregion + +skipTestFixturesPublications() diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/.gitignore b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/.gitignore new file mode 100644 index 00000000..c0a92be3 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/.gitignore @@ -0,0 +1,15 @@ +# These projects are run using Gradle TestKit, which does not require Gradle or IDE files. +# However, it is convenient to open up the project in an IDEs, which will automatically +# download Gradle files - but since they're not nessessary, don't commit them. +.idea +**/gradle/wrapper/** +gradlew.bat +gradlew + +# gradle.properties will be auto-updated by Gradle tasks +gradle.properties + +ANDROID_SDK/* +**/local.properties +# Don't ignore licenses - they're required by Android to auto-download the SDK +!ANDROID_SDK/licenses/ diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-googletv-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-googletv-license new file mode 100644 index 00000000..c34f9a12 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-googletv-license @@ -0,0 +1,2 @@ + +601085b94cd77f0b54ff86406957099ebe79c4d6 diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-arm-dbt-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-arm-dbt-license new file mode 100644 index 00000000..5cbbb66e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-arm-dbt-license @@ -0,0 +1,2 @@ + +859f317696f67ef3d7f30a50a5560e7834b43903 diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-license new file mode 100644 index 00000000..ee55294f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-license @@ -0,0 +1,2 @@ + +24333f8a63b6825ea9c5514f83c2829b004d1fee diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-preview-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-preview-license new file mode 100644 index 00000000..74069f8f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/android-sdk-preview-license @@ -0,0 +1,2 @@ + +84831b9409646a918e30573bab4c9c91346d8abd diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/google-gdk-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/google-gdk-license new file mode 100644 index 00000000..5c5a0a6f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/google-gdk-license @@ -0,0 +1,2 @@ + +33b6a2b64607f11b759f320ef9dff4ae5c47d97a diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/intel-android-extra-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/intel-android-extra-license new file mode 100644 index 00000000..3ba49310 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/intel-android-extra-license @@ -0,0 +1,2 @@ + +d975f751698a77b662f1254ddbeed3901e976f5a diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/mips-android-sysimage-license b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/mips-android-sysimage-license new file mode 100644 index 00000000..5547e8de --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/ANDROID_SDK/licenses/mips-android-sysimage-license @@ -0,0 +1,2 @@ + +e9acab5b5fbb560a72cfaecce8946896ff6aab9d diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/build.gradle.kts new file mode 100644 index 00000000..860666eb --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("com.android.library") + id("org.jetbrains.dokka") + kotlin("android") +} + +apply(from = "./template.root.gradle.kts") + +android { + defaultConfig { + minSdkVersion(21) + setCompileSdkVersion(29) + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.1.0") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..74641446 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/settings.gradle.kts @@ -0,0 +1,5 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-android-0" + diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/AndroidManifest.xml b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a35f86be --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/AndroidManifest.xml @@ -0,0 +1 @@ +<manifest package="org.jetbrains.dokka.it.android"/> diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/AndroidSpecificClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/AndroidSpecificClass.kt new file mode 100644 index 00000000..cb9046b1 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/AndroidSpecificClass.kt @@ -0,0 +1,16 @@ +@file:Suppress("unused") + +package it.android + +import android.content.Context +import android.util.SparseIntArray +import android.view.View + +/** + * This class is specific to android and uses android classes like: + * [Context], [SparseIntArray] or [View] + */ +class AndroidSpecificClass { + fun sparseIntArray() = SparseIntArray() + fun createView(context: Context): View = View(context) +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/IntegrationTestActivity.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/IntegrationTestActivity.kt new file mode 100644 index 00000000..1792818b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/src/main/java/it/android/IntegrationTestActivity.kt @@ -0,0 +1,22 @@ +package it.android + +import android.annotation.SuppressLint +import android.os.Bundle +import android.widget.TextView +import androidx.appcompat.app.AppCompatActivity + +/** + * Some Activity implementing [AppCompatActivity] from android x + */ +class IntegrationTestActivity : AppCompatActivity() { + /** + * Will show a small happy text + */ + @SuppressLint("SetTextI18n") + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val textView = TextView(this) + textView.text = "I am so happy :)" + setContentView(textView) + } +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/build.gradle.kts new file mode 100644 index 00000000..ebcfc7a4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("com.android.library") version "8.0.2" + kotlin("android") version "1.9.0" + id("org.jetbrains.dokka.dokkatoo") version "2.1.0-SNAPSHOT" +} + +android { + namespace = "org.jetbrains.dokka.it.android" + defaultConfig { + minSdkVersion(21) + setCompileSdkVersion(29) + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.1.0") +} + +tasks.withType<org.jetbrains.dokka.dokkatoo.tasks.DokkatooGenerateTask>().configureEach { + // Dokka and Dokkatoo fetch Source Set information in different ways. This results in the + // 'SourceSetId' for each DokkatooSourceSet being slightly different. + // The SourceSetId is not visible, and just because it's different in Dokka vs Dokkatoo, it + // doesn't have any impact. But for the purposes of automated testing, they need to be the same. + // So, forcibly rename the SourceSetId. + + generator.dokkaSourceSets.configureEach { + // sourceSetScope renaming is fine, I'm not worried about it. The default comes from the + // Gradle Task name, so a name difference doesn't matter. + // We can just manually force the Dokkatoo name to match Dokka. + sourceSetScope.set(":dokkaHtml") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..5bea52c9 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,19 @@ +rootProject.name = "it-android-0" + +pluginManagement { + repositories { + maven(providers.gradleProperty("testMavenRepo")) + mavenCentral() + google() + gradlePluginPortal() + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + maven(providers.gradleProperty("testMavenRepo")) + mavenCentral() + google() + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/AndroidManifest.xml b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a35f86be --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/AndroidManifest.xml @@ -0,0 +1 @@ +<manifest package="org.jetbrains.dokka.it.android"/> diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/AndroidSpecificClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/AndroidSpecificClass.kt new file mode 100644 index 00000000..cb9046b1 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/AndroidSpecificClass.kt @@ -0,0 +1,16 @@ +@file:Suppress("unused") + +package it.android + +import android.content.Context +import android.util.SparseIntArray +import android.view.View + +/** + * This class is specific to android and uses android classes like: + * [Context], [SparseIntArray] or [View] + */ +class AndroidSpecificClass { + fun sparseIntArray() = SparseIntArray() + fun createView(context: Context): View = View(context) +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/IntegrationTestActivity.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/IntegrationTestActivity.kt new file mode 100644 index 00000000..1792818b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-android-0/dokkatoo/src/main/java/it/android/IntegrationTestActivity.kt @@ -0,0 +1,22 @@ +package it.android + +import android.annotation.SuppressLint +import android.os.Bundle +import android.widget.TextView +import androidx.appcompat.app.AppCompatActivity + +/** + * Some Activity implementing [AppCompatActivity] from android x + */ +class IntegrationTestActivity : AppCompatActivity() { + /** + * Will show a small happy text + */ + @SuppressLint("SetTextI18n") + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val textView = TextView(this) + textView.text = "I am so happy :)" + setContentView(textView) + } +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/build.gradle new file mode 100644 index 00000000..f368ed10 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/build.gradle @@ -0,0 +1,54 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' + id("org.jetbrains.dokka") +} + +apply from: '../template.root.gradle.kts' + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib" +} + +dokkaHtml { + outputDirectory = new File(buildDir, "/dokka/customHtml") + failOnWarning = false + dokkaSourceSets { + customSourceSet { + sourceRoot(file("src/main/java")) + sourceRoot(file("src/main/kotlin")) + displayName.set("custom") + reportUndocumented.set(true) + } + + configureEach { + perPackageOption { // testing closures + matchingRegex.set(".*internal.*") + suppress.set(true) + } + + sourceLink { // testing closures + localDirectory.set(file("src/main")) + remoteUrl.set( + new URL( + "https://github.com/Kotlin/dokka/tree/master/" + + "integration-tests/gradle/projects/it-basic-groovy/src/main" + ) + ) + } + } + } + +} + +dokkaJavadoc { + outputDirectory = new File(buildDir, "dokka/customJavadoc") +} + +dokkaGfm { + outputDirectory = new File(buildDir, "dokka/customGfm") +} + +dokkaJekyll { + outputDirectory = new File(buildDir, "dokka/customJekyll") +} + diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/settings.gradle.kts new file mode 100644 index 00000000..87cf173c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/settings.gradle.kts @@ -0,0 +1,5 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-basic-groovy" + diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/java/it/basic/java/SampleJavaClass.java b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..23b0202c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,17 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/kotlin/it/basic/PublicClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..71bc7e63 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,48 @@ +@file:Suppress("unused") + +package it.basic + +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokkatoo/settings.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokkatoo/settings.gradle new file mode 100644 index 00000000..fd5763e1 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic-groovy/dokkatoo/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven { url = providers.gradleProperty("testMavenRepo") } + } +} + +rootProject.name = "it-basic-groovy" + +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { url = providers.gradleProperty("testMavenRepo") } + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/build.gradle.kts new file mode 100644 index 00000000..e81e35fd --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/build.gradle.kts @@ -0,0 +1,63 @@ +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.kotlinSourceSet +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration +import org.jetbrains.dokka.DokkaConfiguration +import java.net.URL + +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +buildscript { + dependencies { + classpath("org.jetbrains.dokka:dokka-base:1.9.0") + } +} + +version = "1.9.0-SNAPSHOT" + +apply(from = "./template.root.gradle.kts") + +dependencies { + testImplementation(kotlin("test-junit")) +} + +tasks.withType<DokkaTask> { + moduleName.set("Basic Project") + dokkaSourceSets { + configureEach { + documentedVisibilities.set( + setOf(DokkaConfiguration.Visibility.PUBLIC, DokkaConfiguration.Visibility.PROTECTED) + ) + suppressedFiles.from(file("src/main/kotlin/it/suppressedByPath")) + perPackageOption { + matchingRegex.set("it.suppressedByPackage.*") + suppress.set(true) + } + perPackageOption { + matchingRegex.set("it.overriddenVisibility.*") + documentedVisibilities.set( + setOf(DokkaConfiguration.Visibility.PRIVATE) + ) + } + sourceLink { + localDirectory.set(file("src/main")) + remoteUrl.set( + URL( + "https://github.com/Kotlin/dokka/tree/master/" + + "integration-tests/gradle/projects/it-basic/src/main" + ) + ) + } + } + + register("myTest") { + kotlinSourceSet(kotlin.sourceSets["test"]) + } + } + suppressObviousFunctions.set(false) + + pluginsMapConfiguration.set(mapOf(DokkaBase::class.qualifiedName to """{ "customStyleSheets": ["${file("../customResources/logo-styles.css").invariantSeparatorsPath}", "${file("../customResources/custom-style-to-add.css").invariantSeparatorsPath}"], "customAssets" : ["${file("../customResources/custom-resource.svg").invariantSeparatorsPath}"] }""")) +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-resource.svg b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-resource.svg new file mode 100644 index 00000000..1865f739 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-resource.svg @@ -0,0 +1,3 @@ +<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M18 9C18 14 14 18 9 18C4 18 0 14 0 9C0 4 4 0 9 0C14 0 18 4 18 9ZM14.2 6.2L12.8 4.8L7.5 10.1L5.3 7.8L3.8 9.2L7.5 13L14.2 6.2Z" fill="#4DBB5F"/> +</svg>
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-style-to-add.css b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-style-to-add.css new file mode 100644 index 00000000..408c210e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/custom-style-to-add.css @@ -0,0 +1 @@ +/* custom stylesheet */
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/logo-styles.css b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/logo-styles.css new file mode 100644 index 00000000..2ac57218 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/customResources/logo-styles.css @@ -0,0 +1,3 @@ +#logo { + background-image: url('https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg'); +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/settings.gradle.kts new file mode 100644 index 00000000..d563ebcf --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/settings.gradle.kts @@ -0,0 +1,5 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-basic" + diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/java/it/basic/java/SampleJavaClass.java b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..23b0202c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,17 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/RootPackageClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/RootPackageClass.kt new file mode 100644 index 00000000..8ff6c750 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/RootPackageClass.kt @@ -0,0 +1,8 @@ +@file:Suppress("unused") + +/** + * A class that lives inside the root package + */ +class RootPackageClass { + val description = "I do live in the root package!" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/basic/PublicClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..2958948c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,69 @@ +@file:Suppress("unused") + +package it.basic + +import RootPackageClass + +/** + * This class, unlike [RootPackageClass] is located in a sub-package + * + * §PUBLIC§ (marker for asserts) + */ +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is protected and documented + */ + protected fun protectedDocumentedFunction(): String = "" + + protected fun protectedUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property is protected and documented + */ + val protectedDocumentedProperty: Int = 0 + + val protectedUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/internal/InternalClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/internal/InternalClass.kt new file mode 100644 index 00000000..6173d239 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/internal/InternalClass.kt @@ -0,0 +1,7 @@ +package it.internal + +/** + * §INTERNAL§ (marker for asserts) + * This class is internal and should not be rendered + */ +internal class InternalClass diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt new file mode 100644 index 00000000..230f5e0b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt @@ -0,0 +1,12 @@ +package it.overriddenVisibility + +/** + * Private classes and methods generally should not be visible, but [documentedVisibilities] + * are overriden for this specific package to include private code + * + * §PRIVATE§ (marker for asserts) + */ +private class VisiblePrivateClass { + private val privateVal: Int = 0 + private fun privateMethod() {} +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/protected/ProtectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/protected/ProtectedClass.kt new file mode 100644 index 00000000..ad19f1a1 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/protected/ProtectedClass.kt @@ -0,0 +1,10 @@ +package it.protected + +/** + * Protected class should be visible because it's included in documentedVisibilities + * + * §PROTECTED§ (marker for asserts) + */ +protected class ProtectedClass { + protected fun protectedFun(): String = "protected" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt new file mode 100644 index 00000000..d8dc9cff --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt @@ -0,0 +1,7 @@ +package it.suppressedByPackage + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPackage diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt new file mode 100644 index 00000000..4dda9da4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt @@ -0,0 +1,7 @@ +package it.suppressedByPath + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPath diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/test/kotlin/it/basic/TestClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/test/kotlin/it/basic/TestClass.kt new file mode 100644 index 00000000..3584bdef --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/src/test/kotlin/it/basic/TestClass.kt @@ -0,0 +1,17 @@ +package it.basic + +import kotlin.test.Test +import kotlin.test.assertTrue + +annotation class OurAnnotation + +class TestClass { + /** + * Asserts something. [PublicClass] + */ + @Test + @OurAnnotation + fun test() { + assertTrue(1 == 1) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/build.gradle.kts new file mode 100644 index 00000000..a6b70f6c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/build.gradle.kts @@ -0,0 +1,64 @@ +import org.jetbrains.dokka.dokkatoo.dokka.parameters.VisibilityModifier +import org.jetbrains.dokka.dokkatoo.dokka.plugins.DokkaHtmlPluginParameters + +plugins { + kotlin("jvm") version "1.9.0" + id("org.jetbrains.dokka.dokkatoo") version "2.1.0-SNAPSHOT" +} + +version = "1.9.0-SNAPSHOT" + +dependencies { + testImplementation(kotlin("test-junit")) +} + +kotlin { + jvmToolchain(8) +} + +dokkatoo { + moduleName.set("Basic Project") + dokkatooSourceSets.configureEach { + documentedVisibilities( + VisibilityModifier.PUBLIC, + VisibilityModifier.PROTECTED, + ) + suppressedFiles.from(file("src/main/kotlin/it/suppressedByPath")) + perPackageOption { + matchingRegex.set("it.suppressedByPackage.*") + suppress.set(true) + } + perPackageOption { + matchingRegex.set("it.overriddenVisibility.*") + documentedVisibilities( + VisibilityModifier.PRIVATE, + ) + } + sourceLink { + localDirectory.set(file("src/main")) + remoteUrl( + "https://github.com/Kotlin/dokka/tree/master/integration-tests/gradle/projects/it-basic/src/main" + ) + } + } + + pluginsConfiguration.named<DokkaHtmlPluginParameters>("html") { + customStyleSheets.from( + "./customResources/logo-styles.css", + "./customResources/custom-style-to-add.css", + ) + customAssets.from( + "./customResources/custom-resource.svg", + ) + } + + dokkatooPublications.configureEach { + suppressObviousFunctions.set(false) + } +} + +tasks.withType<org.jetbrains.dokka.dokkatoo.tasks.DokkatooGenerateTask>().configureEach { + generator.dokkaSourceSets.configureEach { + sourceSetScope.set(":dokkaHtml") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-resource.svg b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-resource.svg new file mode 100644 index 00000000..1865f739 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-resource.svg @@ -0,0 +1,3 @@ +<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M18 9C18 14 14 18 9 18C4 18 0 14 0 9C0 4 4 0 9 0C14 0 18 4 18 9ZM14.2 6.2L12.8 4.8L7.5 10.1L5.3 7.8L3.8 9.2L7.5 13L14.2 6.2Z" fill="#4DBB5F"/> +</svg>
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-style-to-add.css b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-style-to-add.css new file mode 100644 index 00000000..408c210e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/custom-style-to-add.css @@ -0,0 +1 @@ +/* custom stylesheet */
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/logo-styles.css b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/logo-styles.css new file mode 100644 index 00000000..2ac57218 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/customResources/logo-styles.css @@ -0,0 +1,3 @@ +#logo { + background-image: url('https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg'); +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..a2872f47 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-basic" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/java/it/basic/java/SampleJavaClass.java b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..23b0202c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,17 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/RootPackageClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/RootPackageClass.kt new file mode 100644 index 00000000..8ff6c750 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/RootPackageClass.kt @@ -0,0 +1,8 @@ +@file:Suppress("unused") + +/** + * A class that lives inside the root package + */ +class RootPackageClass { + val description = "I do live in the root package!" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/basic/PublicClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..2958948c --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,69 @@ +@file:Suppress("unused") + +package it.basic + +import RootPackageClass + +/** + * This class, unlike [RootPackageClass] is located in a sub-package + * + * §PUBLIC§ (marker for asserts) + */ +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is protected and documented + */ + protected fun protectedDocumentedFunction(): String = "" + + protected fun protectedUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property is protected and documented + */ + val protectedDocumentedProperty: Int = 0 + + val protectedUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/internal/InternalClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/internal/InternalClass.kt new file mode 100644 index 00000000..6173d239 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/internal/InternalClass.kt @@ -0,0 +1,7 @@ +package it.internal + +/** + * §INTERNAL§ (marker for asserts) + * This class is internal and should not be rendered + */ +internal class InternalClass diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt new file mode 100644 index 00000000..230f5e0b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/overriddenVisibility/VisiblePrivateClass.kt @@ -0,0 +1,12 @@ +package it.overriddenVisibility + +/** + * Private classes and methods generally should not be visible, but [documentedVisibilities] + * are overriden for this specific package to include private code + * + * §PRIVATE§ (marker for asserts) + */ +private class VisiblePrivateClass { + private val privateVal: Int = 0 + private fun privateMethod() {} +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/protected/ProtectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/protected/ProtectedClass.kt new file mode 100644 index 00000000..ad19f1a1 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/protected/ProtectedClass.kt @@ -0,0 +1,10 @@ +package it.protected + +/** + * Protected class should be visible because it's included in documentedVisibilities + * + * §PROTECTED§ (marker for asserts) + */ +protected class ProtectedClass { + protected fun protectedFun(): String = "protected" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt new file mode 100644 index 00000000..d8dc9cff --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt @@ -0,0 +1,7 @@ +package it.suppressedByPackage + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPackage diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt new file mode 100644 index 00000000..4dda9da4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt @@ -0,0 +1,7 @@ +package it.suppressedByPath + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPath diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/test/kotlin/it/basic/TestClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/test/kotlin/it/basic/TestClass.kt new file mode 100644 index 00000000..3584bdef --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-basic/dokkatoo/src/test/kotlin/it/basic/TestClass.kt @@ -0,0 +1,17 @@ +package it.basic + +import kotlin.test.Test +import kotlin.test.assertTrue + +annotation class OurAnnotation + +class TestClass { + /** + * Asserts something. [PublicClass] + */ + @Test + @OurAnnotation + fun test() { + assertTrue(1 == 1) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/build.gradle.kts new file mode 100644 index 00000000..062f1eb7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/build.gradle.kts @@ -0,0 +1 @@ +apply(from = "./template.root.gradle.kts") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/build.gradle.kts new file mode 100644 index 00000000..ab86c333 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + // TODO: File bug report for gradle: :moduleA:moduleB:dokkaHtml is missing kotlin gradle plugin from + // the runtime classpath during execution without this plugin in the parent project + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/README.md b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/README.md new file mode 100644 index 00000000..f8c52880 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/README.md @@ -0,0 +1,2 @@ +# Module moduleB +Here is some description for module B diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/build.gradle.kts new file mode 100644 index 00000000..9f7e98de --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt new file mode 100644 index 00000000..430e2234 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleB + +@Suppress("unused") +class ModuleB { + fun undocumentedPublicFunction() {} +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/README.md b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/README.md new file mode 100644 index 00000000..4ead5671 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/README.md @@ -0,0 +1,2 @@ +# Module moduleC +Here is some description for module C diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/build.gradle.kts new file mode 100644 index 00000000..9f7e98de --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt new file mode 100644 index 00000000..e14d68e0 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleC + +@Suppress("unused") +class ModuleC { + fun undocumentedPublicFunction() {} +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..a1b4baa6 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/settings.gradle.kts @@ -0,0 +1,5 @@ +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-multimodule-0" +include(":moduleA") +include(":moduleA:moduleB") +include(":moduleA:moduleC") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..13811d9a --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-collector-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-collector-0" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/build.gradle.kts new file mode 100644 index 00000000..fc353172 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("org.jetbrains.dokka") + kotlin("js") +} + +apply(from = "./template.root.gradle.kts") + +kotlin { + js(IR) { + browser() + nodejs() + } +} + +dependencies { + implementation(npm("is-sorted", "1.0.5")) + + val reactVersion = properties["react_version"] + implementation("org.jetbrains.kotlin-wrappers:kotlin-react:$reactVersion") + implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:$reactVersion") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..431c0715 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/settings.gradle.kts @@ -0,0 +1,5 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-js-ir-0" + diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/RootPackageClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/RootPackageClass.kt new file mode 100644 index 00000000..cbe6240e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/RootPackageClass.kt @@ -0,0 +1,26 @@ +@file:Suppress("unused") + +import org.w3c.dom.url.URLSearchParams +import org.w3c.dom.HTMLAnchorElement +import react.dom.html.AnchorHTMLAttributes +import react.Props +import react.State + +/** + * A class that lives inside the root package + */ +class RootPackageClass { + val description = "I do live in the root package!" +} + +// sample method that uses classes from dom and react, should compile +fun URLSearchParams.react(props: Props, state: State) {} + +fun test(list: MutableList<Int>) = "list" + +@JsModule("is-sorted") +@JsNonModule +external fun <T> sorted(a: Array<T>): Boolean + +// this declaration can be used to check deserialization of dynamic type +external interface TextLinkProps: AnchorHTMLAttributes<HTMLAnchorElement>
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/basic/PublicClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..fc4b36bd --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,53 @@ +@file:Suppress("unused") + +package it.basic + +import RootPackageClass + +/** + * This class, unlike [RootPackageClass] is located in a sub-package + */ +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/internal/InternalClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/internal/InternalClass.kt new file mode 100644 index 00000000..7d42b978 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/internal/InternalClass.kt @@ -0,0 +1,7 @@ +package it.internal + +/** + * §INTERNAL§ + * This class is internal and should not be rendered + */ +internal class InternalClass diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt new file mode 100644 index 00000000..d8dc9cff --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPackage/SuppressedByPackage.kt @@ -0,0 +1,7 @@ +package it.suppressedByPackage + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPackage diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt new file mode 100644 index 00000000..4dda9da4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/src/main/kotlin/it/suppressedByPath/SuppressedByPath.kt @@ -0,0 +1,7 @@ +package it.suppressedByPath + +/** + * §SUPPRESSED§ + * This should not be rendered. + */ +class SuppressedByPath diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..85b71839 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-js-ir-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-js-ir-0" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/build.gradle.kts new file mode 100644 index 00000000..062f1eb7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/build.gradle.kts @@ -0,0 +1 @@ +apply(from = "./template.root.gradle.kts") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/build.gradle.kts new file mode 100644 index 00000000..ab86c333 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + // TODO: File bug report for gradle: :moduleA:moduleB:dokkaHtml is missing kotlin gradle plugin from + // the runtime classpath during execution without this plugin in the parent project + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/Module.md b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/Module.md new file mode 100644 index 00000000..0570f467 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/Module.md @@ -0,0 +1,6 @@ +# Module !Module B! +Here is some description for Module B + +Module B: Second paragraph +# Module moduleB +§IGNORED$This documentation shall be ignored, because wrong module name§IGNORED$ diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/build.gradle.kts new file mode 100644 index 00000000..1981701f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/build.gradle.kts @@ -0,0 +1,13 @@ +import org.jetbrains.dokka.gradle.DokkaTask + +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +tasks.withType<DokkaTask>().configureEach { + moduleName.set("!Module B!") + dokkaSourceSets.configureEach { + includes.from("Module.md") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt new file mode 100644 index 00000000..430e2234 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleB + +@Suppress("unused") +class ModuleB { + fun undocumentedPublicFunction() {} +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/Module.md b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/Module.md new file mode 100644 index 00000000..4ead5671 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/Module.md @@ -0,0 +1,2 @@ +# Module moduleC +Here is some description for module C diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/build.gradle.kts new file mode 100644 index 00000000..728e764d --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/build.gradle.kts @@ -0,0 +1,12 @@ +import org.jetbrains.dokka.gradle.DokkaTask + +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +tasks.withType<DokkaTask>().configureEach { + dokkaSourceSets.configureEach { + includes.from("Module.md") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt new file mode 100644 index 00000000..e14d68e0 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleC + +@Suppress("unused") +class ModuleC { + fun undocumentedPublicFunction() {} +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/build.gradle.kts new file mode 100644 index 00000000..e5edf940 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/build.gradle.kts @@ -0,0 +1,6 @@ +import org.jetbrains.dokka.gradle.DokkaTask + +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt new file mode 100644 index 00000000..88174d53 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleD + +@Suppress("unused") +class ModuleD { + fun undocumentedPublicFunction() {} +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..20cde260 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/settings.gradle.kts @@ -0,0 +1,6 @@ +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-multimodule-0" +include(":moduleA") +include(":moduleA:moduleB") +include(":moduleA:moduleC") +include(":moduleA:moduleD") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..97712ae9 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-multimodule-0" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/build.gradle new file mode 100644 index 00000000..57d22b79 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' + id("org.jetbrains.dokka") +} + +apply from: '../template.root.gradle.kts' + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib" + implementation project(':first') + implementation project(':second') +} + + +subprojects { + apply plugin: 'org.jetbrains.kotlin.jvm' + apply plugin: 'org.jetbrains.dokka' +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/build.gradle new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/build.gradle diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstClass.kt new file mode 100644 index 00000000..93f73bf4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstClass.kt @@ -0,0 +1,11 @@ +package foo + +/** + * First class description + */ +open class FirstClass{ + /** + * PropertyOne description + */ + val propertyOne: Int = 5 +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstSubclass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstSubclass.kt new file mode 100644 index 00000000..0deb65c0 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/FirstSubclass.kt @@ -0,0 +1,12 @@ +package foo + +/** + * Subclass description + * @property surname Surname description + */ +class FirstSubclass(var surname: String) : FirstClass() { + /** + * printNewLine description + */ + fun printNewline() = print("\r\n") +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/Main.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/Main.kt new file mode 100644 index 00000000..8c7f58a7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/foo/Main.kt @@ -0,0 +1,8 @@ +package foo + +/** + * Main function + */ +fun main(args : Array<String>) { + println("Hello, world!") +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/noPackage.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/noPackage.kt new file mode 100644 index 00000000..c41e218f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/first/src/main/kotlin/noPackage.kt @@ -0,0 +1,3 @@ +fun noPackage(): String = "Hello there" + +open class NoPackage diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/build.gradle new file mode 100644 index 00000000..2b62f963 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/build.gradle @@ -0,0 +1,14 @@ +dependencies { + implementation project(":first") +} +dokkaHtml { + dependsOn(":first:dokkaHtml") + dokkaSourceSets { + "main" { + externalDocumentationLink { + url.set(new URL("file://" + rootProject.rootDir.toPath().toAbsolutePath().resolve("first/build/dokka/html/"))) + packageListUrl.set(new URL("file://" + rootProject.rootDir.toPath().toAbsolutePath().resolve("first/build/dokka/html/first/package-list"))) + } + } + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/NoPackageClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/NoPackageClass.kt new file mode 100644 index 00000000..d2f30ef7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/NoPackageClass.kt @@ -0,0 +1 @@ +class NoPackageClass : NoPackage() diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/bar/SecondClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/bar/SecondClass.kt new file mode 100644 index 00000000..6a0c935e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/bar/SecondClass.kt @@ -0,0 +1,21 @@ +package bar +/** + * Second class in second module description [foo.FirstClass] + * @author John Doe + * @version 0.1.3 + * @param name Name description text text text. +*/ +class SecondClass(val name: String) { + val firstProperty = "propertystring" + /** + * Second property in second module description [foo.FirstSubclass] + */ + var secondProperty: String = "" + set(value) { + println("Second property not set") + } + + init { + println("InitializerBlock") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/foo/ThirdClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/foo/ThirdClass.kt new file mode 100644 index 00000000..cc24a6b7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/second/src/main/kotlin/foo/ThirdClass.kt @@ -0,0 +1,11 @@ +package foo + +/** + * Third class description + */ +open class ThirdClass{ + /** + * PropertyOne description + */ + val propertyOne: Int = 5 +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/settings.gradle.kts new file mode 100644 index 00000000..753b6ec2 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/settings.gradle.kts @@ -0,0 +1,4 @@ +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-multimodule-1" +include(":first") +include(":second") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..6ce1808e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-1/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-multimodule-1" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/build.gradle new file mode 100644 index 00000000..e04e412b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/build.gradle @@ -0,0 +1,43 @@ +import org.jetbrains.dokka.gradle.DokkaMultiModuleTask + +plugins { + id 'org.jetbrains.kotlin.jvm' + id("org.jetbrains.dokka") +} + +apply from: '../template.root.gradle.kts' + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib" + dokkaPlugin "org.jetbrains.dokka:versioning-plugin:${System.getenv("DOKKA_VERSION")}" +} + + +subprojects { + apply plugin: 'org.jetbrains.kotlin.jvm' + apply plugin: 'org.jetbrains.dokka' +} + +dokkaHtmlMultiModule { + pluginsMapConfiguration.set(["org.jetbrains.dokka.versioning.VersioningPlugin": """{ "version": "1.2", "olderVersionsDir": "$projectDir/dokkas" }"""]) +} + +tasks.register('dokkaHtmlMultiModuleBaseVersion', DokkaMultiModuleTask){ + dependencies { + dokkaPlugin("org.jetbrains.dokka:all-modules-page-plugin:${System.getenv("DOKKA_VERSION")}") + dokkaPlugin("org.jetbrains.dokka:versioning-plugin:${System.getenv("DOKKA_VERSION")}") + } + outputDirectory.set(file(projectDir.toPath().resolve("dokkas").resolve("1.0"))) + pluginsMapConfiguration.set(["org.jetbrains.dokka.versioning.VersioningPlugin": """{ "version": "1.0" }"""]) + addChildTasks([project(":first"), project(":second")], "dokkaHtmlPartial") +} + +tasks.register('dokkaHtmlMultiModuleNextVersion', DokkaMultiModuleTask){ + dependencies { + dokkaPlugin("org.jetbrains.dokka:all-modules-page-plugin:${System.getenv("DOKKA_VERSION")}") + dokkaPlugin("org.jetbrains.dokka:versioning-plugin:${System.getenv("DOKKA_VERSION")}") + } + outputDirectory.set(file(projectDir.toPath().resolve("dokkas").resolve("1.1"))) + pluginsMapConfiguration.set(["org.jetbrains.dokka.versioning.VersioningPlugin": """{ "version": "1.1", "olderVersionsDir": "$projectDir/dokkas" }"""]) + addChildTasks([project(":first"), project(":second")], "dokkaHtmlPartial") +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/build.gradle new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/build.gradle diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/src/main/kotlin/foo/FirstClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/src/main/kotlin/foo/FirstClass.kt new file mode 100644 index 00000000..93f73bf4 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/first/src/main/kotlin/foo/FirstClass.kt @@ -0,0 +1,11 @@ +package foo + +/** + * First class description + */ +open class FirstClass{ + /** + * PropertyOne description + */ + val propertyOne: Int = 5 +}
\ No newline at end of file diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/build.gradle b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/build.gradle new file mode 100644 index 00000000..cf1d1f21 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/build.gradle @@ -0,0 +1,3 @@ +dependencies { + implementation project(":first") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/src/main/kotlin/bar/SecondClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/src/main/kotlin/bar/SecondClass.kt new file mode 100644 index 00000000..6a0c935e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/second/src/main/kotlin/bar/SecondClass.kt @@ -0,0 +1,21 @@ +package bar +/** + * Second class in second module description [foo.FirstClass] + * @author John Doe + * @version 0.1.3 + * @param name Name description text text text. +*/ +class SecondClass(val name: String) { + val firstProperty = "propertystring" + /** + * Second property in second module description [foo.FirstSubclass] + */ + var secondProperty: String = "" + set(value) { + println("Second property not set") + } + + init { + println("InitializerBlock") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..da027565 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/settings.gradle.kts @@ -0,0 +1,4 @@ +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-multimodule-versioning-0" +include(":first") +include(":second") diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..dbd0ee03 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multimodule-versioning-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-multimodule-versioning-0" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/build.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/build.gradle.kts new file mode 100644 index 00000000..d7d47bd5 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/build.gradle.kts @@ -0,0 +1,48 @@ +import org.jetbrains.dokka.gradle.DokkaTask +import java.net.URL + +plugins { + kotlin("multiplatform") + id("org.jetbrains.dokka") +} + +apply(from = "./template.root.gradle.kts") + +kotlin { + jvm() + linuxX64("linux") + macosX64("macos") + js(BOTH) + //TODO Add wasm when kx.coroutines will be supported and published into the main repo + sourceSets { + val commonMain by sourceSets.getting + val linuxMain by sourceSets.getting + val macosMain by sourceSets.getting + val desktopMain by sourceSets.creating { + dependsOn(commonMain) + linuxMain.dependsOn(this) + macosMain.dependsOn(this) + } + named("commonMain") { + dependencies { + if (properties["dokka_it_kotlin_version"] in listOf("1.4.32", "1.5.31")) + // otherwise for a modern versin of coroutines: + // Failed to resolve Kotlin library: project/build/kotlinSourceSetMetadata/commonMain/org.jetbrains.kotlinx-kotlinx-coroutines-core/org.jetbrains.kotlinx-kotlinx-coroutines-core-commonMain.klib + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9") + else + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + } + } + } +} + +tasks.withType<DokkaTask>().configureEach { + dokkaSourceSets { + configureEach { + externalDocumentationLink { + url.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/")) + //packageListUrl.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/package-list")) + } + } + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/settings.gradle.kts new file mode 100644 index 00000000..1d4f1681 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/settings.gradle.kts @@ -0,0 +1,2 @@ +apply(from = "./template.settings.gradle.kts") +rootProject.name = "it-multiplatform-0" diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/CommonMainClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/CommonMainClass.kt new file mode 100644 index 00000000..499a4f1e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/CommonMainClass.kt @@ -0,0 +1,8 @@ +package it.mpp0 + +/** + * This class is defined in commonMain + */ +class CommonMainClass { + fun publicFunction(): String = "public" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..e610b09a --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +expect class ExpectedClass { + val platform: String +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/coroutines.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/coroutines.kt new file mode 100644 index 00000000..8eee326f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/commonMain/kotlin/it/mpp0/coroutines.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +import kotlinx.coroutines.CoroutineScope + +expect fun <T> CoroutineScope.runBlocking(block: suspend () -> T) : T diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt new file mode 100644 index 00000000..342a749e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt @@ -0,0 +1,11 @@ +package it.mpp0 + +import kotlinx.cinterop.CPointed +import kotlinx.cinterop.CPointer + +/** + * Will print the raw value + */ +fun CPointer<CPointed>.customExtension() { + println(this.rawValue) +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..19070a96 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +actual class ExpectedClass { + actual val platform: String = "linux" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..1e4a6d22 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +actual class ExpectedClass { + actual val platform: String = "js" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/runBlocking.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/runBlocking.kt new file mode 100644 index 00000000..03b3b0ea --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jsMain/kotlin/it/mpp0/runBlocking.kt @@ -0,0 +1,7 @@ +package it.mpp0 + +import kotlinx.coroutines.CoroutineScope + +actual fun <T> CoroutineScope.runBlocking(block: suspend () -> T): T { + TODO("Not yet implemented") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..6de30de6 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,11 @@ +package it.mpp0 + +actual class ExpectedClass { + actual val platform: String = "jvm" + + /** + * This function can only be used by JVM consumers + */ + fun jvmOnlyFunction() = Unit + +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt new file mode 100644 index 00000000..21101a89 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt @@ -0,0 +1,13 @@ +@file:Suppress("unused") + +package it.mpp0 + +/** + * This class can only be used by JVM consumers + */ +class JvmOnlyClass { + /** + * This function can only be used by JVM consumers + */ + fun myJvm() = println("HI") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/runBlocking.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/runBlocking.kt new file mode 100644 index 00000000..03b3b0ea --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/jvmMain/kotlin/it/mpp0/runBlocking.kt @@ -0,0 +1,7 @@ +package it.mpp0 + +import kotlinx.coroutines.CoroutineScope + +actual fun <T> CoroutineScope.runBlocking(block: suspend () -> T): T { + TODO("Not yet implemented") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/CPointerExtension.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/CPointerExtension.kt new file mode 100644 index 00000000..342a749e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/CPointerExtension.kt @@ -0,0 +1,11 @@ +package it.mpp0 + +import kotlinx.cinterop.CPointed +import kotlinx.cinterop.CPointer + +/** + * Will print the raw value + */ +fun CPointer<CPointed>.customExtension() { + println(this.rawValue) +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..19070a96 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +actual class ExpectedClass { + actual val platform: String = "linux" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/runBlocking.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/runBlocking.kt new file mode 100644 index 00000000..b56fb80a --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/linuxMain/kotlin/it/mpp0/runBlocking.kt @@ -0,0 +1,13 @@ +package it.mpp0 + +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Deferred +import kotlinx.coroutines.async + +actual fun <T> CoroutineScope.runBlocking(block: suspend () -> T): T { + TODO("Not yet implemented") +} + +fun <T> CoroutineScope.customAsync(block: suspend () -> T): Deferred<T> { + return async { block() } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/ExpectedClass.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/ExpectedClass.kt new file mode 100644 index 00000000..7a4a8f75 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/ExpectedClass.kt @@ -0,0 +1,5 @@ +package it.mpp0 + +actual class ExpectedClass { + actual val platform: String = "macos" +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/runBlocking.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/runBlocking.kt new file mode 100644 index 00000000..03b3b0ea --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/src/macosMain/kotlin/it/mpp0/runBlocking.kt @@ -0,0 +1,7 @@ +package it.mpp0 + +import kotlinx.coroutines.CoroutineScope + +actual fun <T> CoroutineScope.runBlocking(block: suspend () -> T): T { + TODO("Not yet implemented") +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.root.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.root.gradle.kts new file mode 100644 index 00000000..f63c28e7 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.root.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenLocal() + mavenCentral() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +afterEvaluate { + logger.quiet("Gradle version: ${gradle.gradleVersion}") + logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}") + properties["dokka_it_android_gradle_plugin_version"]?.let { androidVersion -> + logger.quiet("Android version: $androidVersion") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.settings.gradle.kts new file mode 100644 index 00000000..b7e3195e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokka/template.settings.gradle.kts @@ -0,0 +1,38 @@ +@file:Suppress("LocalVariableName", "UnstableApiUsage") + +pluginManagement { + val dokka_it_kotlin_version: String by settings + val dokka_it_android_gradle_plugin_version: String? by settings + + plugins { + id("org.jetbrains.kotlin.js") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.android") version dokka_it_kotlin_version + id("org.jetbrains.kotlin.multiplatform") version dokka_it_kotlin_version + } + + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.jetbrains.dokka") { + useModule("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0") + } + + if (requested.id.id == "com.android.library") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + + if (requested.id.id == "com.android.application") { + useModule("com.android.tools.build:gradle:$dokka_it_android_gradle_plugin_version") + } + } + } + repositories { + mavenLocal() + maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com") + mavenCentral() + gradlePluginPortal() + google() + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap") + maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokkatoo/settings.gradle.kts b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokkatoo/settings.gradle.kts new file mode 100644 index 00000000..3e4d074a --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/projects/it-multiplatform-0/dokkatoo/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "it-multiplatform-0" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + maven(providers.gradleProperty("testMavenRepo")) + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/CustomFormatExampleTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/CustomFormatExampleTest.kt new file mode 100644 index 00000000..b2dbdb1e --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/CustomFormatExampleTest.kt @@ -0,0 +1,197 @@ +package org.jetbrains.dokka.dokkatoo.tests.examples + +import org.jetbrains.dokka.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION +import org.jetbrains.dokka.dokkatoo.utils.* +import io.kotest.assertions.withClue +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.nulls.shouldNotBeNull +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File + +class CustomFormatExampleTest : FunSpec({ + + val dokkaProject = initDokkaProject( + GradleProjectTest.projectTestTempDir.resolve("it/examples/custom-format-dokka").toFile() + ) + + val dokkatooProject = initDokkatooProject( + GradleProjectTest.projectTestTempDir.resolve("it/examples/custom-format-dokkatoo").toFile() + ) + + context("compare dokka and dokkatoo HTML generators") { + test("expect dokka can generate HTML") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Generation completed successfully" + } + } + + test("expect dokkatoo can generate HTML") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldNotBeNull().shouldBeAFile() + dokkaWorkerLog.readText() shouldContain "Generation completed successfully" + } + } + } + + context("expect dokka and dokkatoo HTML is the same") { + val dokkaHtmlDir = dokkaProject.projectDir.resolve("build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("build/dokka/html") + + test("expect file trees are the same") { + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + // drop the first line from each, since the directory name is different + expectedFileTree.substringAfter("\n") shouldBe actualFileTree.substringAfter("\n") + } + + test("expect directories are the same") { + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + } + } + + + context("Gradle caching") { + test("expect Dokkatoo is compatible with Gradle Build Cache") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldNotBeNull().shouldBeAFile() + dokkaWorkerLog.readText() shouldContain "Generation completed successfully" + } + } + + dokkatooProject.runner + .addArguments( + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--build-cache", + "--info", + ) + .forwardOutput() + .build { + output shouldContainAll listOf( + "> Task :dokkatooGeneratePublicationHtml UP-TO-DATE", + "BUILD SUCCESSFUL", + "1 actionable task: 1 up-to-date", + ) + withClue("Dokka Generator should not be triggered, so check it doesn't log anything") { + output shouldNotContain "Generation completed successfully" + } + } + } + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("custom-format-example/dokka") + + buildGradleKts = buildGradleKts + .replace( + Regex("""id\("org\.jetbrains\.dokka"\) version \("[\d.]+"\)"""), + Regex.escapeReplacement("""id("org.jetbrains.dokka") version "$DOKKA_VERSION""""), + ) + .replace( + "org.jetbrains.dokka:dokka-base:1.7.10", + "org.jetbrains.dokka:dokka-base:1.7.20", + ) + + settingsGradleKts = settingsGradleKts + .replace( + """rootProject.name = "dokka-customFormat-example"""", + """rootProject.name = "customFormat-example"""", + ) + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("custom-format-example/dokkatoo") + + buildGradleKts += """ + | + |tasks.withType<org.jetbrains.dokka.dokkatoo.tasks.DokkatooGenerateTask>().configureEach { + | generator.dokkaSourceSets.configureEach { + | sourceSetScope.set(":dokkaHtml") // only necessary for testing + | } + |} + | + """.trimMargin() + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/GradleExampleTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/GradleExampleTest.kt new file mode 100644 index 00000000..371ac938 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/GradleExampleTest.kt @@ -0,0 +1,190 @@ +package org.jetbrains.dokka.dokkatoo.tests.examples + +import org.jetbrains.dokka.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION +import org.jetbrains.dokka.dokkatoo.utils.* +import org.jetbrains.dokka.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir +import io.kotest.assertions.withClue +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.nulls.shouldNotBeNull +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File +import kotlin.text.Regex.Companion.escapeReplacement + +class GradleExampleTest : FunSpec({ + + val dokkaProject = initDokkaProject( + projectTestTempDir.resolve("it/examples/gradle-example/dokka").toFile() + ) + + val dokkatooProject = initDokkatooProject( + projectTestTempDir.resolve("it/examples/gradle-example/dokkatoo").toFile() + ) + + context("compare dokka and dokkatoo HTML generators") { + test("expect dokka can generate HTML") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Generation completed successfully" + } + } + + test("expect dokkatoo can generate HTML") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldNotBeNull().shouldBeAFile() + dokkaWorkerLog.readText() shouldContain "Generation completed successfully" + } + } + } + + context("expect dokka and dokkatoo HTML is the same") { + val dokkaHtmlDir = dokkaProject.projectDir.resolve("build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("build/dokka/html") + + test("expect file trees are the same") { + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + expectedFileTree shouldBe actualFileTree + } + + test("expect directories are the same") { + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + } + } + + + context("Gradle caching") { + test("expect Dokkatoo is compatible with Gradle Build Cache") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + + + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldNotBeNull().shouldBeAFile() + dokkaWorkerLog.readText() shouldContain "Generation completed successfully" + } + } + + dokkatooProject.runner + .addArguments( + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + "--build-cache", + ) + .forwardOutput() + .build { + output shouldContainAll listOf( + "> Task :dokkatooGeneratePublicationHtml UP-TO-DATE", + "BUILD SUCCESSFUL", + "1 actionable task: 1 up-to-date", + ) + withClue("Dokka Generator should not be triggered, so check it doesn't log anything") { + output shouldNotContain "Generation completed successfully" + } + } + } + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("gradle-example/dokka") + + buildGradleKts = buildGradleKts + .replace( + Regex("""id\("org\.jetbrains\.dokka"\) version \("[\d.]+"\)"""), + escapeReplacement("""id("org.jetbrains.dokka") version "$DOKKA_VERSION""""), + ) + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("gradle-example/dokkatoo") + + buildGradleKts += """ + | + |tasks.withType<org.jetbrains.dokka.dokkatoo.tasks.DokkatooGenerateTask>().configureEach { + | generator.dokkaSourceSets.configureEach { + | sourceSetScope.set(":dokkaHtml") // only necessary for testing + | } + |} + | + """.trimMargin() + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/KotlinMultiplatformExampleTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/KotlinMultiplatformExampleTest.kt new file mode 100644 index 00000000..4a9efaac --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/KotlinMultiplatformExampleTest.kt @@ -0,0 +1,226 @@ +package org.jetbrains.dokka.dokkatoo.tests.examples + +import org.jetbrains.dokka.dokkatoo.utils.* +import org.jetbrains.dokka.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir +import io.kotest.assertions.withClue +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File + +class KotlinMultiplatformExampleTest : FunSpec({ + + val dokkaProject = initDokkaProject( + projectTestTempDir.resolve("it/examples/multiplatform-example/dokka").toFile() + ) + + val dokkatooProject = initDokkatooProject( + projectTestTempDir.resolve("it/examples/multiplatform-example/dokkatoo").toFile() + ) + + context("compare dokka and dokkatoo HTML generators") { + test("expect dokka can generate HTML") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Generation completed successfully" + } + } + + context("when Dokkatoo generates HTML") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + test("expect build is successful") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + } + + context("expect dokka and dokkatoo HTML is the same") { + val dokkaHtmlDir = + dokkaProject.projectDir.resolve("build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("build/dokka/html") + + test("expect file trees are the same") { + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + expectedFileTree shouldBe actualFileTree + } + + test("expect directories are the same") { + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + } + } + + + context("Gradle caching") { + + context("expect Dokkatoo is compatible with Gradle Build Cache") { + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + test("expect build is successful") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + + test("expect tasks are UP-TO-DATE") { + dokkatooProject.runner + .addArguments( + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + "--build-cache", + ) + .forwardOutput() + .build { + + output shouldContainAll listOf( + "> Task :dokkatooGeneratePublicationHtml UP-TO-DATE", + "BUILD SUCCESSFUL", + "2 actionable tasks: 2 up-to-date", + ) + withClue("Dokka Generator should not be triggered, so check it doesn't log anything") { + output shouldNotContain "Generation completed successfully" + } + } + } + } + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + ":dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("multiplatform-example/dokka") + + settingsGradleKts = settingsGradleKts + .replace( + """pluginManagement {""", + """ + | + |pluginManagement { + | repositories { + | gradlePluginPortal() + | mavenCentral() + | mavenLocal() + | } + | + """.trimMargin() + ) + """ + | + |dependencyResolutionManagement { + | repositories { + | mavenCentral() + | mavenLocal() + | } + |} + | + """.trimMargin() + + buildGradleKts += """ + | + |val hackDokkaHtmlDir by tasks.registering(Sync::class) { + | // sync directories so the dirs in both dokka and dokkatoo are the same + | from(layout.buildDirectory.dir("dokka/htmlMultiModule")) + | into(layout.buildDirectory.dir("dokka/html")) + |} + | + |tasks.matching { "dokka" in it.name.toLowerCase() && it.name != hackDokkaHtmlDir.name }.configureEach { + | finalizedBy(hackDokkaHtmlDir) + |} + | + """.trimMargin() + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("multiplatform-example/dokkatoo") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/MultimoduleExampleTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/MultimoduleExampleTest.kt new file mode 100644 index 00000000..8e2215c2 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testExamples/kotlin/MultimoduleExampleTest.kt @@ -0,0 +1,244 @@ +package org.jetbrains.dokka.dokkatoo.tests.examples + +import org.jetbrains.dokka.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION +import org.jetbrains.dokka.dokkatoo.utils.* +import org.jetbrains.dokka.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir +import io.kotest.core.spec.style.FunSpec +import io.kotest.inspectors.shouldForAll +import io.kotest.matchers.collections.shouldHaveSize +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File +import org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE + +class MultimoduleExampleTest : FunSpec({ + + val dokkaProject = initDokkaProject( + projectTestTempDir.resolve("it/examples/multimodule-example/dokka").toFile() + ) + + val dokkatooProject = initDokkatooProject( + projectTestTempDir.resolve("it/examples/multimodule-example/dokkatoo").toFile() + ) + + context("compare dokka and dokkatoo HTML generators") { + test("expect dokka can generate HTML") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtmlMultiModule", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Generation completed successfully" + } + } + + context("when Dokkatoo generates HTML") { + dokkatooProject.runner + .addArguments( + "clean", + ":parentProject:dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + ) + .forwardOutput() + .build { + test("expect build is successful") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldForAll { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + } + + context("expect dokka and dokkatoo HTML is the same") { + val dokkaHtmlDir = + dokkaProject.projectDir.resolve("parentProject/build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("parentProject/build/dokka/html") + + test("expect file trees are the same") { + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + expectedFileTree shouldBe actualFileTree + } + + test("expect directories are the same") { + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + } + } + + + context("Gradle caching") { + + context("expect Dokkatoo is compatible with Gradle Build Cache") { + dokkatooProject.runner + .addArguments( + "clean", + ":parentProject:dokkatooGeneratePublicationHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + test("expect build is successful") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldForAll { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + + dokkatooProject.runner + .addArguments( + ":parentProject:dokkatooGeneratePublicationHtml", + "--stacktrace", + "--info", + "--build-cache", + ) + .forwardOutput() + .build { + test("expect build is successful") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all tasks are UP-TO-DATE") { + val nonLoggingTasks = + tasks.filter { it.name != "logLinkDokkatooGeneratePublicationHtml" } + nonLoggingTasks.shouldForAll { + it shouldHaveOutcome UP_TO_DATE + } + tasks.shouldHaveSize(6) + } + + test("expect Dokka Generator is not triggered") { + // Dokka Generator shouldn't run, so check it doesn't log anything + output shouldNotContain "Generation completed successfully" + } + } + } + + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + ":parentProject:dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("multimodule-example/dokka") + + gradleProperties = gradleProperties.lines().joinToString("\n") { line -> + when { + line.startsWith("dokkaVersion=") -> "dokkaVersion=$DOKKA_VERSION" + else -> line + } + } + + settingsGradleKts = settingsGradleKts + .replace( + """pluginManagement {""", + """ + | + |pluginManagement { + | repositories { + | mavenCentral() + | gradlePluginPortal() + | } + | + """.trimMargin() + ) + """ + | + |dependencyResolutionManagement { + | repositories { + | mavenCentral() + | } + |} + | + """.trimMargin() + + dir("parentProject") { + + buildGradleKts += """ + | + |val hackDokkaHtmlDir by tasks.registering(Sync::class) { + | // sync directories so the dirs in both dokka and dokkatoo are the same + | from(layout.buildDirectory.dir("dokka/htmlMultiModule")) + | into(layout.buildDirectory.dir("dokka/html")) + |} + | + |tasks.matching { it.name.contains("dokka", ignoreCase = true) && it.name != hackDokkaHtmlDir.name }.configureEach { + | finalizedBy(hackDokkaHtmlDir) + |} + | + """.trimMargin() + } + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyExampleProject("multimodule-example/dokkatoo") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testFixtures/kotlin/templateProjectUtils.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testFixtures/kotlin/templateProjectUtils.kt new file mode 100644 index 00000000..93a52564 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testFixtures/kotlin/templateProjectUtils.kt @@ -0,0 +1,17 @@ +package org.jetbrains.dokka.dokkatoo.utils + + +fun GradleProjectTest.copyExampleProject(path: String) { + GradleProjectTest.exampleProjectsDir + .resolve(path) + .toFile() + .copyRecursively(projectDir.toFile(), overwrite = true) { _, _ -> OnErrorAction.SKIP } +} + + +fun GradleProjectTest.copyIntegrationTestProject(path: String) { + GradleProjectTest.integrationTestProjectsDir + .resolve(path) + .toFile() + .copyRecursively(projectDir.toFile(), overwrite = true) { _, _ -> OnErrorAction.SKIP } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/AndroidProjectIntegrationTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/AndroidProjectIntegrationTest.kt new file mode 100644 index 00000000..9389a798 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/AndroidProjectIntegrationTest.kt @@ -0,0 +1,166 @@ +package org.jetbrains.dokka.dokkatoo.tests.integration + +import org.jetbrains.dokka.dokkatoo.utils.* +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File +import kotlin.io.path.deleteIfExists + +/** + * Integration test for the `it-android-0` project in Dokka + * + * Runs Dokka & Dokkatoo, and compares the resulting HTML site. + */ +class AndroidProjectIntegrationTest : FunSpec({ + + val tempDir = GradleProjectTest.projectTestTempDir.resolve("it/it-android-0").toFile() + + val dokkatooProject = initDokkatooProject(tempDir.resolve("dokkatoo")) + val dokkaProject = initDokkaProject(tempDir.resolve("dokka")) + + context("when generating HTML") { + context("with Dokka") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + test("expect project builds successfully") { + output shouldContain "BUILD SUCCESSFUL" + } + } + } + + context("with Dokkatoo") { + dokkatooProject.runner + .addArguments( + "clean", + "dokkatooGeneratePublicationHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + test("expect project builds successfully") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + } + + test("expect the same HTML is generated") { + + val dokkaHtmlDir = dokkaProject.projectDir.resolve("build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("build/dokka/html") + + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + expectedFileTree shouldBe actualFileTree + + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + + test("Dokkatoo tasks should be cacheable") { + dokkatooProject.runner + .addArguments( + "dokkatooGeneratePublicationHtml", + "--stacktrace", + "--build-cache", + ) + .forwardOutput() + .build { + output shouldContainAll listOf( + "Task :dokkatooGeneratePublicationHtml UP-TO-DATE", + ) + } + } + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + "dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyIntegrationTestProject("it-android-0/dokka") + + gradleProperties = gradleProperties + .replace( + "dokka_it_android_gradle_plugin_version=4.2.2", + "dokka_it_android_gradle_plugin_version=8.0.2", + ) + + file("src/main/AndroidManifest.xml").deleteIfExists() + + buildGradleKts += """ + + android { + namespace = "org.jetbrains.dokka.it.android" + } + + java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } + } + """.trimIndent() + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyIntegrationTestProject("it-android-0/dokkatoo") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/BasicProjectIntegrationTest.kt b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/BasicProjectIntegrationTest.kt new file mode 100644 index 00000000..265e7c18 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/kotlin/BasicProjectIntegrationTest.kt @@ -0,0 +1,153 @@ +package org.jetbrains.dokka.dokkatoo.tests.integration + +import org.jetbrains.dokka.dokkatoo.utils.* +import org.jetbrains.dokka.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.file.shouldBeAFile +import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs +import io.kotest.matchers.file.shouldHaveSameStructureAs +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.kotest.matchers.string.shouldNotContain +import java.io.File + +/** + * Integration test for the `it-basic` project in Dokka + * + * Runs Dokka & Dokkatoo, and compares the resulting HTML site. + */ +class BasicProjectIntegrationTest : FunSpec({ + + val tempDir = projectTestTempDir.resolve("it/it-basic").toFile() + + val dokkatooProject = initDokkatooProject(tempDir.resolve("dokkatoo")) + val dokkaProject = initDokkaProject(tempDir.resolve("dokka")) + + context("when generating HTML") { + dokkaProject.runner + .addArguments( + "clean", + "dokkaHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + context("with Dokka") { + test("expect project builds successfully") { + output shouldContain "BUILD SUCCESSFUL" + } + } + } + + dokkatooProject.runner + .addArguments( + "clean", + "dokkatooGeneratePublicationHtml", + "--stacktrace", + ) + .forwardOutput() + .build { + context("with Dokkatoo") { + test("expect project builds successfully") { + output shouldContain "BUILD SUCCESSFUL" + } + + test("expect all dokka workers are successful") { + dokkatooProject + .findFiles { it.name == "dokka-worker.log" } + .shouldBeSingleton { dokkaWorkerLog -> + dokkaWorkerLog.shouldBeAFile() + dokkaWorkerLog.readText().shouldNotContainAnyOf( + "[ERROR]", + "[WARN]", + ) + } + } + } + } + + test("expect the same HTML is generated") { + + val dokkaHtmlDir = dokkaProject.projectDir.resolve("build/dokka/html") + val dokkatooHtmlDir = dokkatooProject.projectDir.resolve("build/dokka/html") + + val expectedFileTree = dokkaHtmlDir.toTreeString() + val actualFileTree = dokkatooHtmlDir.toTreeString() + println((actualFileTree to expectedFileTree).sideBySide()) + expectedFileTree shouldBe actualFileTree + + dokkatooHtmlDir.toFile().shouldHaveSameStructureAs(dokkaHtmlDir.toFile()) + dokkatooHtmlDir.toFile().shouldHaveSameStructureAndContentAs(dokkaHtmlDir.toFile()) + } + + test("Dokkatoo tasks should be cacheable") { + dokkatooProject.runner + .addArguments( + "dokkatooGeneratePublicationHtml", + "--stacktrace", + "--build-cache", + ) + .forwardOutput() + .build { + output shouldContainAll listOf( + "Task :dokkatooGeneratePublicationHtml UP-TO-DATE", + ) + } + } + + context("expect Dokkatoo is compatible with Gradle Configuration Cache") { + dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively() + dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively() + + val configCacheRunner = + dokkatooProject.runner + .addArguments( + "clean", + "dokkatooGeneratePublicationHtml", + "--stacktrace", + "--no-build-cache", + "--configuration-cache", + ) + .forwardOutput() + + test("first build should store the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry stored" + output shouldNotContain "problems were found storing the configuration cache" + } + } + + test("second build should reuse the configuration cache") { + configCacheRunner.build { + output shouldContain "BUILD SUCCESSFUL" + output shouldContain "Configuration cache entry reused" + } + } + } + } +}) + + +private fun initDokkaProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyIntegrationTestProject("it-basic/dokka") + + buildGradleKts = buildGradleKts + .replace( + // no idea why this needs to be changed + """file("../customResources/""", + """file("./customResources/""", + ) + } +} + +private fun initDokkatooProject( + destinationDir: File, +): GradleProjectTest { + return GradleProjectTest(destinationDir.toPath()).apply { + copyIntegrationTestProject("it-basic/dokkatoo") + } +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectA.json b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectA.json new file mode 100644 index 00000000..21b8498f --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectA.json @@ -0,0 +1,83 @@ +{ + "moduleName": "childProjectA", + "moduleVersion": "unspecified", + "outputDir": ".../dokka-multimodule-example/parentProject/childProjectA/build/dokka/htmlPartial", + "cacheRoot": null, + "offlineMode": false, + "sourceSets": [ + { + "displayName": "jvm", + "sourceSetID": { + "scopeId": ":parentProject:childProjectA:dokkaHtmlPartial", + "sourceSetName": "main" + }, + "classpath": [ + ".../kotlin-stdlib-1.7.20.jar", + ".../kotlin-stdlib-common-1.7.20.jar", + ".../annotations-13.0.jar" + ], + "sourceRoots": [ + ".../dokka-multimodule-example/parentProject/childProjectA/src/main/kotlin" + ], + "dependentSourceSets": [], + "samples": [], + "includes": [ + ".../dokka-multimodule-example/parentProject/childProjectA/Module.md" + ], + "includeNonPublic": false, + "reportUndocumented": false, + "skipEmptyPackages": true, + "skipDeprecated": false, + "jdkVersion": 8, + "sourceLinks": [], + "perPackageOptions": [], + "externalDocumentationLinks": [ + { + "url": "https://kotlinlang.org/api/latest/jvm/stdlib/", + "packageListUrl": "https://kotlinlang.org/api/latest/jvm/stdlib/package-list" + }, + { + "url": "https://docs.oracle.com/javase/8/docs/api/", + "packageListUrl": "https://docs.oracle.com/javase/8/docs/api/package-list" + } + ], + "languageVersion": null, + "apiVersion": null, + "noStdlibLink": false, + "noJdkLink": false, + "suppressedFiles": [], + "analysisPlatform": "jvm", + "documentedVisibilities": [ + "PUBLIC" + ] + } + ], + "pluginsClasspath": [ + ".../dokka-analysis-for-integration-tests-SNAPSHOT.jar", + ".../dokka-base-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-intellij-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-compiler-for-integration-tests-SNAPSHOT.jar", + ".../kotlinx-html-jvm-0.7.5.jar", + ".../kotlinx-coroutines-core-jvm-1.6.3.jar", + ".../kotlin-stdlib-jdk8-1.7.20.jar", + ".../jackson-databind-2.12.7.jar", + ".../jackson-annotations-2.12.7.jar", + ".../jackson-core-2.12.7.jar", + ".../jackson-module-kotlin-2.12.7.jar", + ".../kotlin-reflect-1.7.20.jar", + ".../kotlin-stdlib-jdk7-1.7.20.jar", + ".../kotlin-stdlib-1.7.20.jar", + ".../jsoup-1.14.3.jar", + ".../freemarker-2.3.31.jar", + ".../kotlin-stdlib-common-1.7.20.jar", + ".../annotations-13.0.jar" + ], + "pluginsConfiguration": [], + "modules": [], + "failOnWarning": false, + "delayTemplateSubstitution": true, + "suppressObviousFunctions": true, + "includes": [], + "suppressInheritedMembers": false, + "finalizeCoroutines": true +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectB.json b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectB.json new file mode 100644 index 00000000..98d218d3 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/childProjectB.json @@ -0,0 +1,83 @@ +{ + "moduleName": "childProjectB", + "moduleVersion": "unspecified", + "outputDir": ".../dokka-multimodule-example/parentProject/childProjectB/build/dokka/htmlPartial", + "cacheRoot": null, + "offlineMode": false, + "sourceSets": [ + { + "displayName": "jvm", + "sourceSetID": { + "scopeId": ":parentProject:childProjectB:dokkaHtmlPartial", + "sourceSetName": "main" + }, + "classpath": [ + ".../kotlin-stdlib-1.7.20.jar", + ".../kotlin-stdlib-common-1.7.20.jar", + ".../annotations-13.0.jar" + ], + "sourceRoots": [ + ".../dokka-multimodule-example/parentProject/childProjectB/src/main/kotlin" + ], + "dependentSourceSets": [], + "samples": [], + "includes": [ + ".../dokka-multimodule-example/parentProject/childProjectB/Module.md" + ], + "includeNonPublic": false, + "reportUndocumented": false, + "skipEmptyPackages": true, + "skipDeprecated": false, + "jdkVersion": 8, + "sourceLinks": [], + "perPackageOptions": [], + "externalDocumentationLinks": [ + { + "url": "https://kotlinlang.org/api/latest/jvm/stdlib/", + "packageListUrl": "https://kotlinlang.org/api/latest/jvm/stdlib/package-list" + }, + { + "url": "https://docs.oracle.com/javase/8/docs/api/", + "packageListUrl": "https://docs.oracle.com/javase/8/docs/api/package-list" + } + ], + "languageVersion": null, + "apiVersion": null, + "noStdlibLink": false, + "noJdkLink": false, + "suppressedFiles": [], + "analysisPlatform": "jvm", + "documentedVisibilities": [ + "PUBLIC" + ] + } + ], + "pluginsClasspath": [ + ".../dokka-analysis-for-integration-tests-SNAPSHOT.jar", + ".../dokka-base-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-intellij-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-compiler-for-integration-tests-SNAPSHOT.jar", + ".../kotlinx-html-jvm-0.7.5.jar", + ".../kotlinx-coroutines-core-jvm-1.6.3.jar", + ".../kotlin-stdlib-jdk8-1.7.20.jar", + ".../jackson-databind-2.12.7.jar", + ".../jackson-annotations-2.12.7.jar", + ".../jackson-core-2.12.7.jar", + ".../jackson-module-kotlin-2.12.7.jar", + ".../kotlin-reflect-1.7.20.jar", + ".../kotlin-stdlib-jdk7-1.7.20.jar", + ".../kotlin-stdlib-1.7.20.jar", + ".../jsoup-1.14.3.jar", + ".../freemarker-2.3.31.jar", + ".../kotlin-stdlib-common-1.7.20.jar", + ".../annotations-13.0.jar" + ], + "pluginsConfiguration": [], + "modules": [], + "failOnWarning": false, + "delayTemplateSubstitution": true, + "suppressObviousFunctions": true, + "includes": [], + "suppressInheritedMembers": false, + "finalizeCoroutines": true +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/parentProject.json b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/parentProject.json new file mode 100644 index 00000000..fb300e37 --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/parentProject.json @@ -0,0 +1,55 @@ +{ + "moduleName": "parentProject", + "moduleVersion": null, + "outputDir": ".../dokka-multimodule-example/parentProject/build/dokka/htmlMultiModule", + "cacheRoot": null, + "offlineMode": false, + "sourceSets": [], + "pluginsClasspath": [ + ".../dokka-analysis-for-integration-tests-SNAPSHOT.jar", + ".../all-modules-page-plugin-for-integration-tests-SNAPSHOT.jar", + ".../templating-plugin-for-integration-tests-SNAPSHOT.jar", + ".../dokka-base-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-intellij-for-integration-tests-SNAPSHOT.jar", + ".../kotlin-analysis-compiler-for-integration-tests-SNAPSHOT.jar", + "../kotlinx-html-jvm-0.7.5.jar", + "../kotlinx-coroutines-core-jvm-1.6.3.jar", + "../kotlin-stdlib-jdk8-1.7.20.jar", + "../jackson-databind-2.12.7.jar", + "../jackson-annotations-2.12.7.jar", + "../jackson-core-2.12.7.jar", + "../jackson-module-kotlin-2.12.7.jar", + "../kotlin-reflect-1.7.20.jar", + "../kotlin-stdlib-jdk7-1.7.20.jar", + "../kotlin-stdlib-1.7.20.jar", + "../jsoup-1.14.3.jar", + "../freemarker-2.3.31.jar", + "../kotlin-stdlib-common-1.7.20.jar", + "../annotations-13.0.jar" + ], + "pluginsConfiguration": [], + "modules": [ + { + "name": "childProjectA", + "relativePathToOutputDirectory": "childProjectA", + "includes": [ + ".../dokka-multimodule-example/parentProject/childProjectA/Module.md" + ], + "sourceOutputDirectory": ".../dokka-multimodule-example/parentProject/childProjectA/build/dokka/htmlPartial" + }, + { + "name": "childProjectB", + "relativePathToOutputDirectory": "childProjectB", + "includes": [ + ".../dokka-multimodule-example/parentProject/childProjectB/Module.md" + ], + "sourceOutputDirectory": ".../dokka-multimodule-example/parentProject/childProjectB/build/dokka/htmlPartial" + } + ], + "failOnWarning": false, + "delayTemplateSubstitution": false, + "suppressObviousFunctions": true, + "includes": [], + "suppressInheritedMembers": false, + "finalizeCoroutines": true +} diff --git a/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/readme.md b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/readme.md new file mode 100644 index 00000000..cffaf26b --- /dev/null +++ b/dokka-runners/dokkatoo/modules/dokkatoo-plugin-integration-tests/src/testIntegration/resources/it/example/dokka-multi-module/readme.md @@ -0,0 +1,5 @@ +This directory contains example JSON that the current Dokka plugin generates +for the dokka-multi-module example. + +It is committed here for development so that I can manually compare and contrast. +In time, these files can be removed. |