From e99be615ce7c2c2b5c3ee5e3f8941c41c1e7a944 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 31 Jan 2020 00:37:29 +0100 Subject: Bump Gradle version, migrate to Kotlin DSL, refactor publishing --- runners/gradle-plugin/build.gradle.kts | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 runners/gradle-plugin/build.gradle.kts (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts new file mode 100644 index 00000000..0d68a525 --- /dev/null +++ b/runners/gradle-plugin/build.gradle.kts @@ -0,0 +1,74 @@ +import org.jetbrains.configureBintrayPublication + +plugins { + id("com.gradle.plugin-publish") +} + +repositories { + google() +} + +dependencies { + implementation(project(":core")) + compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin") + compileOnly("com.android.tools.build:gradle:3.0.0") + compileOnly("com.android.tools.build:gradle-core:3.0.0") + compileOnly("com.android.tools.build:builder-model:3.0.0") + compileOnly(gradleApi()) + constraints { + val kotlin_version: String by project + compileOnly("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}") { + because("kotlin-gradle-plugin and :core both depend on this") + } + } +} + +tasks { + processResources { + val dokka_version: String by project + eachFile { + if (name == "org.jetbrains.dokka.properties") { + filter { line -> + line.replace("", dokka_version) + } + } + } + } +} + +val sourceJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + +publishing { + publications { + register("dokkaGradlePlugin") { + artifactId = "dokka-gradle-plugin" + from(components["java"]) + artifact(sourceJar.get()) + } + } +} + +configureBintrayPublication("dokkaGradlePlugin") // TODO check if this publishes correctly + +pluginBundle { + // TODO check if this publishes correctly + website = "https://www.kotlinlang.org/" + vcsUrl = "https://github.com/kotlin/dokka.git" + description = "Dokka, the Kotlin documentation tool" + tags = listOf("dokka", "kotlin", "kdoc", "android") + + plugins { + create("dokkaGradlePlugin") { + id = "org.jetbrains.dokka" + displayName = "Dokka plugin" + } + } + + mavenCoordinates { + groupId = "org.jetbrains.dokka" + artifactId = "dokka-gradle-plugin" + } +} \ No newline at end of file -- cgit From c09bde34ff729ef9b1f3bea602fb53cd4e6dca42 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Fri, 13 Mar 2020 10:46:33 +0100 Subject: Gradle Task supporting multimodular projects --- core/src/main/kotlin/DokkaBootstrapImpl.kt | 32 ++- core/src/main/kotlin/defaultConfiguration.kt | 2 +- plugins/base/src/main/kotlin/DokkaBase.kt | 15 +- .../src/main/kotlin/renderers/DefaultRenderer.kt | 2 +- .../kotlin/resolvers/DefaultLocationProvider.kt | 116 ----------- .../resolvers/DefaultLocationProviderFactory.kt | 9 - .../kotlin/resolvers/ExternalLocationProvider.kt | 99 --------- .../src/main/kotlin/resolvers/LocationProvider.kt | 19 -- .../DokkaExternalLocationProviderFactory.kt | 35 ++++ .../external/ExternalLocationProviderFactory.kt | 23 +++ .../JavadocExternalLocationProviderFactory.kt | 37 ++++ .../resolvers/local/DefaultLocationProvider.kt | 222 +++++++++++++++++++++ .../local/DefaultLocationProviderFactory.kt | 10 + .../kotlin/resolvers/local/LocationProvider.kt | 18 ++ .../documentables/DefaultDocumentableMerger.kt | 12 +- .../documentables/DocumentableVisibilityFilter.kt | 1 + .../pages/comments/DocTagToContentConverter.kt | 7 +- .../test/kotlin/renderers/RenderingOnlyTestBase.kt | 12 +- plugins/gfm/build.gradle.kts | 8 + plugins/gfm/src/main/kotlin/GfmPlugin.kt | 196 ++++++++++++++++++ .../org.jetbrains.dokka.plugability.DokkaPlugin | 1 + plugins/jekyll/build.gradle.kts | 8 + plugins/jekyll/src/main/kotlin/JekyllPlugin.kt | 182 +++++++++++++++++ .../org.jetbrains.dokka.plugability.DokkaPlugin | 1 + runners/cli/src/main/kotlin/cli/main.kt | 16 +- runners/gradle-plugin/build.gradle.kts | 1 + .../jetbrains/dokka/gradle/DokkaCollectorTask.kt | 56 ++++++ .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 37 ++-- .../main/kotlin/org/jetbrains/dokka/gradle/main.kt | 36 +++- runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 9 +- .../main/kotlin/testApi/testRunner/TestRunner.kt | 6 +- 31 files changed, 922 insertions(+), 306 deletions(-) delete mode 100644 plugins/base/src/main/kotlin/resolvers/DefaultLocationProvider.kt delete mode 100644 plugins/base/src/main/kotlin/resolvers/DefaultLocationProviderFactory.kt delete mode 100644 plugins/base/src/main/kotlin/resolvers/ExternalLocationProvider.kt delete mode 100644 plugins/base/src/main/kotlin/resolvers/LocationProvider.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/external/DokkaExternalLocationProviderFactory.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/external/JavadocExternalLocationProviderFactory.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt create mode 100644 plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt create mode 100644 plugins/gfm/build.gradle.kts create mode 100644 plugins/gfm/src/main/kotlin/GfmPlugin.kt create mode 100644 plugins/gfm/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin create mode 100644 plugins/jekyll/build.gradle.kts create mode 100644 plugins/jekyll/src/main/kotlin/JekyllPlugin.kt create mode 100644 plugins/jekyll/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin create mode 100644 runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index fc1b6926..f164a3c1 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -20,7 +20,13 @@ fun parsePerPackageOptions(arg: String): List { val reportUndocumented = args.find { it.endsWith("warnUndocumented") }?.startsWith("+") ?: true val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") ?: false - PackageOptionsImpl(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated, suppress = suppress) + PackageOptionsImpl( + prefix, + includeNonPublic = privateApi, + reportUndocumented = reportUndocumented, + skipDeprecated = !deprecated, + suppress = suppress + ) } } @@ -52,10 +58,11 @@ class DokkaBootstrapImpl : DokkaBootstrap { override fun report() { if (warningsCount > 0 || errorsCount > 0) { - println("Generation completed with $warningsCount warning" + - (if(DokkaConsoleLogger.warningsCount == 1) "" else "s") + - " and $errorsCount error" + - if(DokkaConsoleLogger.errorsCount == 1) "" else "s" + println( + "Generation completed with $warningsCount warning" + + (if (DokkaConsoleLogger.warningsCount == 1) "" else "s") + + " and $errorsCount error" + + if (DokkaConsoleLogger.errorsCount == 1) "" else "s" ) } else { println("generation completed successfully") @@ -83,10 +90,11 @@ class DokkaBootstrapImpl : DokkaBootstrap { } val configurationWithLinks = - configuration.copy(passesConfigurations = - passesConfigurations - .map { - val links: List = it.externalDocumentationLinks + defaultLinks(it) + configuration.copy( + passesConfigurations = + passesConfigurations.map { + val links: List = + it.externalDocumentationLinks + defaultLinks(it) it.copy(externalDocumentationLinks = links) } ) @@ -94,8 +102,10 @@ class DokkaBootstrapImpl : DokkaBootstrap { generator = DokkaGenerator(configurationWithLinks, logger) } - override fun configure(logger: BiConsumer, serializedConfigurationJSON: String) - = configure(DokkaProxyLogger(logger), gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java)) + override fun configure(logger: BiConsumer, serializedConfigurationJSON: String) = configure( + DokkaProxyLogger(logger), + gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java) + ) override fun generate() = generator.generate() } diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index 148bf830..b0c12015 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -10,7 +10,7 @@ data class DokkaConfigurationImpl( override val cacheRoot: String?, override val impliedPlatforms: List, override val passesConfigurations: List, - override val pluginsClasspath: List + override var pluginsClasspath: List ) : DokkaConfiguration data class PassConfigurationImpl ( diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index 448373ea..548bcb93 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -4,10 +4,12 @@ import org.jetbrains.dokka.CoreExtensions import org.jetbrains.dokka.base.renderers.FileWriter import org.jetbrains.dokka.base.renderers.OutputWriter import org.jetbrains.dokka.base.renderers.html.* -import org.jetbrains.dokka.base.resolvers.DefaultLocationProviderFactory -import org.jetbrains.dokka.base.resolvers.LocationProviderFactory +import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.signatures.SignatureProvider +import org.jetbrains.dokka.base.resolvers.external.* +import org.jetbrains.dokka.base.resolvers.local.DefaultLocationProviderFactory +import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory import org.jetbrains.dokka.base.transformers.documentables.DefaultDocumentableMerger import org.jetbrains.dokka.base.transformers.documentables.InheritorsExtractorTransformer import org.jetbrains.dokka.base.transformers.pages.annotations.DeprecatedStrikethroughTransformer @@ -29,6 +31,7 @@ class DokkaBase : DokkaPlugin() { val commentsToContentConverter by extensionPoint() val signatureProvider by extensionPoint() val locationProviderFactory by extensionPoint() + val externalLocationProviderFactory by extensionPoint() val outputWriter by extensionPoint() val htmlPreprocessors by extensionPoint() @@ -98,6 +101,14 @@ class DokkaBase : DokkaPlugin() { locationProviderFactory providing ::DefaultLocationProviderFactory } + val javadocLocationProvider by extending { + externalLocationProviderFactory with JavadocExternalLocationProviderFactory() + } + + val dokkaLocationProvider by extending { + externalLocationProviderFactory with DokkaExternalLocationProviderFactory() + } + val fileWriter by extending(isFallback = true) { outputWriter providing ::FileWriter } diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 0e0001b9..0ff0511a 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.base.renderers import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.resolvers.LocationProvider +import org.jetbrains.dokka.base.resolvers.local.LocationProvider import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin diff --git a/plugins/base/src/main/kotlin/resolvers/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/DefaultLocationProvider.kt deleted file mode 100644 index 2238b0c3..00000000 --- a/plugins/base/src/main/kotlin/resolvers/DefaultLocationProvider.kt +++ /dev/null @@ -1,116 +0,0 @@ -package org.jetbrains.dokka.base.resolvers - -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.* -import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.utilities.htmlEscape -import java.util.* - -private const val PAGE_WITH_CHILDREN_SUFFIX = "index" - -open class DefaultLocationProvider( - protected val pageGraphRoot: RootPageNode, - protected val dokkaContext: DokkaContext -) : LocationProvider { - protected val extension = ".html" - - protected val pagesIndex: Map = pageGraphRoot.asSequence().filterIsInstance() - .map { it.dri.map { dri -> dri to it } }.flatten() - .groupingBy { it.first } - .aggregate { dri, _, (_, page), first -> - if (first) page else throw AssertionError("Multiple pages associated with dri: $dri") - } - - protected val pathsIndex: Map> = IdentityHashMap>().apply { - fun registerPath(page: PageNode, prefix: List) { - val newPrefix = prefix + page.pathName - put(page, newPrefix) - page.children.forEach { registerPath(it, newPrefix) } - } - put(pageGraphRoot, emptyList()) - pageGraphRoot.children.forEach { registerPath(it, emptyList()) } - } - - override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = - pathTo(node, context) + if (!skipExtension) extension else "" - - override fun resolve(dri: DRI, platforms: List, context: PageNode?): String = - pagesIndex[dri]?.let { resolve(it, context) } ?: - // Not found in PageGraph, that means it's an external link - ExternalLocationProvider.getLocation(dri, - this.dokkaContext.configuration.passesConfigurations - .filter { passConfig -> - platforms.toSet() - .contains(PlatformData(passConfig.moduleName, passConfig.analysisPlatform, passConfig.targets)) - } // TODO: change targets to something better? - .flatMap { it.externalDocumentationLinks }.distinct() - ) - - override fun resolveRoot(node: PageNode): String = - pathTo(pageGraphRoot, node).removeSuffix(PAGE_WITH_CHILDREN_SUFFIX) - - override fun ancestors(node: PageNode): List = - generateSequence(node) { it.parent() }.toList() - - protected open fun pathTo(node: PageNode, context: PageNode?): String { - fun pathFor(page: PageNode) = pathsIndex[page] ?: throw AssertionError( - "${page::class.simpleName}(${page.name}) does not belong to current page graph so it is impossible to compute its path" - ) - - val contextNode = - if (context?.children?.isEmpty() == true && context.parent() != null) context.parent() else context - val nodePath = pathFor(node) - val contextPath = contextNode?.let { pathFor(it) }.orEmpty() - - val commonPathElements = nodePath.asSequence().zip(contextPath.asSequence()) - .takeWhile { (a, b) -> a == b }.count() - - return (List(contextPath.size - commonPathElements) { ".." } + nodePath.drop(commonPathElements) + - if (node.children.isNotEmpty()) listOf(PAGE_WITH_CHILDREN_SUFFIX) else emptyList()).joinToString("/") - } - - private fun PageNode.parent() = pageGraphRoot.parentMap[this] -} - -fun DRI.toJavadocLocation(jdkVersion: Int): String { // TODO: classes without packages? - val packageLink = packageName?.replace(".", "/") - if (classNames == null) { - return "$packageLink/package-summary.html".htmlEscape() - } - val classLink = if (packageLink == null) "$classNames.html" else "$packageLink/$classNames.html" - val callableChecked = callable ?: return classLink.htmlEscape() - - val callableLink = "$classLink#${callableChecked.name}" + when { - jdkVersion < 8 -> "(${callableChecked.params.joinToString(", ")})" - jdkVersion < 10 -> "-${callableChecked.params.joinToString("-")}-" - else -> "(${callableChecked.params.joinToString(",")})" - } - - return callableLink.htmlEscape() -} - -fun DRI.toDokkaLocation(extension: String): String { // TODO: classes without packages? - val classNamesChecked = classNames ?: return "$packageName/index$extension" - - val classLink = if (packageName == null) { - "" - } else { - "$packageName/" - } + classNamesChecked.split('.').joinToString("/", transform = ::identifierToFilename) - - val callableChecked = callable ?: return "$classLink/index$extension" - - return "$classLink/${identifierToFilename(callableChecked.name)}$extension" -} - -private val reservedFilenames = setOf("index", "con", "aux", "lst", "prn", "nul", "eof", "inp", "out") - -private fun identifierToFilename(name: String): String { - if (name.isEmpty()) return "--root--" - val escaped = name.replace('<', '-').replace('>', '-') - val lowercase = escaped.replace("[A-Z]".toRegex()) { matchResult -> "-" + matchResult.value.toLowerCase() } - return if (lowercase in reservedFilenames) "--$lowercase--" else lowercase -} - -private val PageNode.pathName: String - get() = if (this is PackagePageNode) name else identifierToFilename(name) diff --git a/plugins/base/src/main/kotlin/resolvers/DefaultLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/DefaultLocationProviderFactory.kt deleted file mode 100644 index c649e22b..00000000 --- a/plugins/base/src/main/kotlin/resolvers/DefaultLocationProviderFactory.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.jetbrains.dokka.base.resolvers - -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.plugability.DokkaContext - -class DefaultLocationProviderFactory(private val context: DokkaContext) : LocationProviderFactory { - - override fun getLocationProvider(pageNode: RootPageNode) = DefaultLocationProvider(pageNode, context) -} \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/resolvers/ExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/ExternalLocationProvider.kt deleted file mode 100644 index 7c0e9952..00000000 --- a/plugins/base/src/main/kotlin/resolvers/ExternalLocationProvider.kt +++ /dev/null @@ -1,99 +0,0 @@ -package org.jetbrains.dokka.base.resolvers - -import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink -import org.jetbrains.dokka.links.DRI -import java.net.HttpURLConnection -import java.net.URL -import java.net.URLConnection - -object ExternalLocationProvider { // TODO: Refactor this!!! - private const val DOKKA_PARAM_PREFIX = "\$dokka." - - private val cache: MutableMap = mutableMapOf() - - fun getLocation(dri: DRI, externalDocumentationLinks: List): String { - val toResolve: MutableList = mutableListOf() - for(link in externalDocumentationLinks){ - val info = cache[link.packageListUrl] - if(info == null) { - toResolve.add(link) - } else if(info.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink(dri, info) - } - } - // Not in cache, resolve packageLists - while (toResolve.isNotEmpty()){ - val link = toResolve.first().also { toResolve.remove(it) } - val locationInfo = loadPackageList(link.packageListUrl) - if(locationInfo.packages.contains(dri.packageName)) { - return link.url.toExternalForm() + getLink(dri, locationInfo) - } - } - return "" - } - - private fun getLink(dri: DRI, locationInfo: LocationInfo): String = when(locationInfo.format) { - "javadoc" -> dri.toJavadocLocation(8) - "kotlin-website-html", "html" -> locationInfo.locations[dri.packageName + "." + dri.classNames] ?: dri.toDokkaLocation(".html") - "markdown" -> locationInfo.locations[dri.packageName + "." + dri.classNames] ?: dri.toDokkaLocation(".md") - // TODO: rework this - else -> throw RuntimeException("Unrecognized format") - } - - - private fun loadPackageList(url: URL): LocationInfo { - val packageListStream = url.doOpenConnectionToReadContent().getInputStream() - val (params, packages) = - packageListStream - .bufferedReader() - .useLines { lines -> lines.partition { it.startsWith(DOKKA_PARAM_PREFIX) } } - - val paramsMap = params.asSequence() - .map { it.removePrefix(DOKKA_PARAM_PREFIX).split(":", limit = 2) } - .groupBy({ (key, _) -> key }, { (_, value) -> value }) - - val format = paramsMap["format"]?.singleOrNull() ?: "javadoc" - - val locations = paramsMap["location"].orEmpty() - .map { it.split("\u001f", limit = 2) } - .map { (key, value) -> key to value } - .toMap() - - val info = LocationInfo(format, packages.toSet(), locations) - cache[url] = info - return info - } - - private fun URL.doOpenConnectionToReadContent(timeout: Int = 10000, redirectsAllowed: Int = 16): URLConnection { - val connection = this.openConnection().apply { - connectTimeout = timeout - readTimeout = timeout - } - - when (connection) { - is HttpURLConnection -> { - return when (connection.responseCode) { - in 200..299 -> { - connection - } - HttpURLConnection.HTTP_MOVED_PERM, - HttpURLConnection.HTTP_MOVED_TEMP, - HttpURLConnection.HTTP_SEE_OTHER -> { - if (redirectsAllowed > 0) { - val newUrl = connection.getHeaderField("Location") - URL(newUrl).doOpenConnectionToReadContent(timeout, redirectsAllowed - 1) - } else { - throw RuntimeException("Too many redirects") - } - } - else -> { - throw RuntimeException("Unhandled http code: ${connection.responseCode}") - } - } - } - else -> return connection - } - } - data class LocationInfo(val format: String, val packages: Set, val locations: Map) - -} diff --git a/plugins/base/src/main/kotlin/resolvers/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/LocationProvider.kt deleted file mode 100644 index 13f4563c..00000000 --- a/plugins/base/src/main/kotlin/resolvers/LocationProvider.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.jetbrains.dokka.base.resolvers - -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.ContentPage -import org.jetbrains.dokka.pages.PageNode -import org.jetbrains.dokka.pages.PlatformData -import org.jetbrains.dokka.pages.RootPageNode - -interface LocationProvider { - fun resolve(dri: DRI, platforms: List, context: PageNode? = null): String - fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String - fun resolveRoot(node: PageNode): String - fun ancestors(node: PageNode): List -} - -interface LocationProviderFactory { - fun getLocationProvider(pageNode: RootPageNode): LocationProvider -} - diff --git a/plugins/base/src/main/kotlin/resolvers/external/DokkaExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/DokkaExternalLocationProviderFactory.kt new file mode 100644 index 00000000..ff9186f7 --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/external/DokkaExternalLocationProviderFactory.kt @@ -0,0 +1,35 @@ +package org.jetbrains.dokka.base.resolvers.external + +import org.jetbrains.dokka.base.resolvers.local.identifierToFilename +import org.jetbrains.dokka.links.DRI + + +class DokkaExternalLocationProviderFactory : ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache( + object : ExternalLocationProviderFactory { + override fun getExternalLocationProvider(param: String): ExternalLocationProvider? = + when (param) { + "kotlin-website-html", "html" -> DokkaExternalLocationProvider(param, ".html") + "markdown" -> DokkaExternalLocationProvider(param, ".md") + else -> null + } + } +) + +class DokkaExternalLocationProvider(override val param: String, val extension: String) : ExternalLocationProvider { + + override fun DRI.toLocation(): String { // TODO: classes without packages? + + val classNamesChecked = classNames ?: return "${packageName ?: ""}/index$extension" + + val classLink = (listOfNotNull(packageName) + classNamesChecked.split('.')).joinToString( + "/", + transform = ::identifierToFilename + ) + + val callableChecked = callable ?: return "$classLink/index$extension" + + return "$classLink/${identifierToFilename( + callableChecked.name + )}$extension" + } +} diff --git a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt new file mode 100644 index 00000000..6fb05024 --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt @@ -0,0 +1,23 @@ +package org.jetbrains.dokka.base.resolvers.external + +import org.jetbrains.dokka.links.DRI + + +interface ExternalLocationProvider { + + val param: String + fun DRI.toLocation(): String +} + +interface ExternalLocationProviderFactory { + + fun getExternalLocationProvider(param: String): ExternalLocationProvider? +} + +class ExternalLocationProviderFactoryWithCache(val ext: ExternalLocationProviderFactory) : ExternalLocationProviderFactory { + + private val locationProviders: MutableList = mutableListOf() + + override fun getExternalLocationProvider(param: String): ExternalLocationProvider? = + locationProviders.find { it.param == param } ?: ext.getExternalLocationProvider(param)?.also { locationProviders.add(it) } +} \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/resolvers/external/JavadocExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/JavadocExternalLocationProviderFactory.kt new file mode 100644 index 00000000..c52c9bbb --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/external/JavadocExternalLocationProviderFactory.kt @@ -0,0 +1,37 @@ +package org.jetbrains.dokka.base.resolvers.external + +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.utilities.htmlEscape + +class JavadocExternalLocationProviderFactory : ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache( + object : ExternalLocationProviderFactory { + override fun getExternalLocationProvider(param: String): ExternalLocationProvider? = + when(param) { + "javadoc1" -> JavadocExternalLocationProvider(param, "()", ", ") // Covers JDK 1 - 7 + "javadoc8" -> JavadocExternalLocationProvider(param, "--", "-") // Covers JDK 8 - 9 + "javadoc10" -> JavadocExternalLocationProvider(param, "()", ",") // Covers JDK 10 + else -> null + } + } +) + +class JavadocExternalLocationProvider(override val param: String, val brackets: String, val separator: String) : ExternalLocationProvider { + + override fun DRI.toLocation(): String { + + val packageLink = packageName?.replace(".", "/") + if (classNames == null) { + return "$packageLink/package-summary.html".htmlEscape() + } + val classLink = if (packageLink == null) "$classNames.html" else "$packageLink/$classNames.html" + val callableChecked = callable ?: return classLink.htmlEscape() + + val callableLink = "$classLink#" + + callableChecked.name + + "${brackets.first()}" + + callableChecked.params.joinToString(separator) + + "${brackets.last()}" + + return callableLink.htmlEscape() + } +} \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt new file mode 100644 index 00000000..736367a9 --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -0,0 +1,222 @@ +package org.jetbrains.dokka.base.resolvers.local + +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.pages.* +import org.jetbrains.dokka.plugability.DokkaContext +import org.jetbrains.dokka.plugability.plugin +import org.jetbrains.dokka.plugability.query +import java.lang.IllegalStateException +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLConnection +import java.util.* + +private const val PAGE_WITH_CHILDREN_SUFFIX = "index" +private const val DOKKA_PARAM_PREFIX = "\$dokka." + +open class DefaultLocationProvider( + protected val pageGraphRoot: RootPageNode, + protected val dokkaContext: DokkaContext +) : LocationProvider { + protected val extension = ".html" + + protected val externalLocationProviderFactories = + dokkaContext.plugin().query { externalLocationProviderFactory } + + protected val pagesIndex: Map = pageGraphRoot.asSequence().filterIsInstance() + .map { it.dri.map { dri -> dri to it } }.flatten() + .groupingBy { it.first } + .aggregate { dri, _, (_, page), first -> + if (first) page else throw AssertionError("Multiple pages associated with dri: $dri") + } + + protected val pathsIndex: Map> = IdentityHashMap>().apply { + fun registerPath(page: PageNode, prefix: List) { + val newPrefix = prefix + page.pathName + put(page, newPrefix) + page.children.forEach { registerPath(it, newPrefix) } + } + put(pageGraphRoot, emptyList()) + pageGraphRoot.children.forEach { registerPath(it, emptyList()) } + } + + override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = + pathTo(node, context) + if (!skipExtension) extension else "" + + override fun resolve(dri: DRI, platforms: List, context: PageNode?): String = + pagesIndex[dri]?.let { resolve(it, context) } ?: + // Not found in PageGraph, that means it's an external link + getLocation(dri, + this.dokkaContext.configuration.passesConfigurations + .filter { passConfig -> + platforms.toSet() + .contains(PlatformData(passConfig.moduleName, passConfig.analysisPlatform, passConfig.targets)) + } // TODO: change targets to something better? + .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) + .map { it.key to it.value.flatten().distinct() }.toMap() + ) + + override fun resolveRoot(node: PageNode): String = + pathTo(pageGraphRoot, node).removeSuffix(PAGE_WITH_CHILDREN_SUFFIX) + + override fun ancestors(node: PageNode): List = + generateSequence(node) { it.parent() }.toList() + + protected open fun pathTo(node: PageNode, context: PageNode?): String { + fun pathFor(page: PageNode) = pathsIndex[page] ?: throw AssertionError( + "${page::class.simpleName}(${page.name}) does not belong to current page graph so it is impossible to compute its path" + ) + + val contextNode = + if (context?.children?.isEmpty() == true && context.parent() != null) context.parent() else context + val nodePath = pathFor(node) + val contextPath = contextNode?.let { pathFor(it) }.orEmpty() + + val commonPathElements = nodePath.asSequence().zip(contextPath.asSequence()) + .takeWhile { (a, b) -> a == b }.count() + + return (List(contextPath.size - commonPathElements) { ".." } + nodePath.drop(commonPathElements) + + if (node.children.isNotEmpty()) listOf(PAGE_WITH_CHILDREN_SUFFIX) else emptyList()).joinToString("/") + } + + private fun PageNode.parent() = pageGraphRoot.parentMap[this] + + private val cache: MutableMap = mutableMapOf() + + private fun getLocation( + dri: DRI, + jdkToExternalDocumentationLinks: Map> + ): String { + val toResolve: MutableMap> = mutableMapOf() + for ((jdk, links) in jdkToExternalDocumentationLinks) { + for (link in links) { + val info = cache[link.packageListUrl] + if (info == null) { + toResolve.getOrPut(jdk) { mutableListOf() }.add(link) + } else if (info.packages.contains(dri.packageName)) { + return link.url.toExternalForm() + getLink( + dri, + info + ) + } + } + } + // Not in cache, resolve packageLists + for ((jdk, links) in toResolve) { + for (link in links) { + val locationInfo = + loadPackageList( + jdk, + link.packageListUrl + ) + if (locationInfo.packages.contains(dri.packageName)) { + return link.url.toExternalForm() + getLink( + dri, + locationInfo + ) + } + } + toResolve.remove(jdk) + } + return "" + } + + private fun getLink(dri: DRI, locationInfo: LocationInfo): String = + locationInfo.locations[dri.packageName + "." + dri.classNames] + ?: // Not sure if it can be here, previously it shadowed only kotlin/dokka related sources, here it shadows both dokka/javadoc, cause I cannot distinguish what LocationProvider has been hypothetically chosen + if (locationInfo.externalLocationProvider != null) + with(locationInfo.externalLocationProvider) { + dri.toLocation() + } + else + throw IllegalStateException("Have not found any convenient ExternalLocationProvider for $dri DRI!") + + private fun loadPackageList(jdk: Int, url: URL): LocationInfo { + val packageListStream = url.doOpenConnectionToReadContent().getInputStream() + val (params, packages) = + packageListStream + .bufferedReader() + .useLines { lines -> lines.partition { it.startsWith(DOKKA_PARAM_PREFIX) } } + + val paramsMap = params.asSequence() + .map { it.removePrefix(DOKKA_PARAM_PREFIX).split(":", limit = 2) } + .groupBy({ (key, _) -> key }, { (_, value) -> value }) + + val format = paramsMap["format"]?.singleOrNull() ?: when { + jdk < 8 -> "javadoc1" // Covers JDK 1 - 7 + jdk < 10 -> "javadoc8" // Covers JDK 8 - 9 + else -> "javadoc10" // Covers JDK 10+ + } + + val locations = paramsMap["location"].orEmpty() + .map { it.split("\u001f", limit = 2) } + .map { (key, value) -> key to value } + .toMap() + + val externalLocationProvider = + externalLocationProviderFactories.asSequence().map { it.getExternalLocationProvider(format) } + .filterNotNull().take(1).firstOrNull() + + val info = LocationInfo( + externalLocationProvider, + packages.toSet(), + locations + ) + cache[url] = info + return info + } + + private fun URL.doOpenConnectionToReadContent(timeout: Int = 10000, redirectsAllowed: Int = 16): URLConnection { + val connection = this.openConnection().apply { + connectTimeout = timeout + readTimeout = timeout + } + + when (connection) { + is HttpURLConnection -> { + return when (connection.responseCode) { + in 200..299 -> { + connection + } + HttpURLConnection.HTTP_MOVED_PERM, + HttpURLConnection.HTTP_MOVED_TEMP, + HttpURLConnection.HTTP_SEE_OTHER -> { + if (redirectsAllowed > 0) { + val newUrl = connection.getHeaderField("Location") + URL(newUrl).doOpenConnectionToReadContent(timeout, redirectsAllowed - 1) + } else { + throw RuntimeException("Too many redirects") + } + } + else -> { + throw RuntimeException("Unhandled http code: ${connection.responseCode}") + } + } + } + else -> return connection + } + } + + data class LocationInfo( + val externalLocationProvider: ExternalLocationProvider?, + val packages: Set, + val locations: Map + ) +} + +private val reservedFilenames = setOf("index", "con", "aux", "lst", "prn", "nul", "eof", "inp", "out") + +internal fun identifierToFilename(name: String): String { + if (name.isEmpty()) return "--root--" + val escaped = name.replace("<|>".toRegex(), "-") + val lowercase = escaped.replace("[A-Z]".toRegex()) { matchResult -> "-" + matchResult.value.toLowerCase() } + return if (lowercase in reservedFilenames) "--$lowercase--" else lowercase +} + +private val PageNode.pathName: String + get() = if (this is PackagePageNode) name else identifierToFilename( + name + ) diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt new file mode 100644 index 00000000..57f53ba6 --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt @@ -0,0 +1,10 @@ +package org.jetbrains.dokka.base.resolvers.local + +import org.jetbrains.dokka.pages.RootPageNode +import org.jetbrains.dokka.plugability.DokkaContext + +class DefaultLocationProviderFactory(private val context: DokkaContext) : LocationProviderFactory { + + override fun getLocationProvider(pageNode: RootPageNode) = + DefaultLocationProvider(pageNode, context) +} \ No newline at end of file diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt new file mode 100644 index 00000000..0814cb3e --- /dev/null +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -0,0 +1,18 @@ +package org.jetbrains.dokka.base.resolvers.local + +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.pages.PageNode +import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.pages.RootPageNode + +interface LocationProvider { + fun resolve(dri: DRI, platforms: List, context: PageNode? = null): String + fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String + fun resolveRoot(node: PageNode): String + fun ancestors(node: PageNode): List +} + +interface LocationProviderFactory { + fun getLocationProvider(pageNode: RootPageNode): LocationProvider +} + diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index bb7dbaaf..48be8ae7 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -12,17 +12,17 @@ import org.jetbrains.dokka.transformers.documentation.DocumentableMerger import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult internal object DefaultDocumentableMerger : DocumentableMerger { + override fun invoke(modules: Collection, context: DokkaContext): DModule { - val name = modules.map { it.name }.distinct().singleOrNull() ?: run { - context.logger.error("All module names need to be the same") - modules.first().name - } + + val projectName = + modules.fold(modules.first().name) { acc, module -> acc.commonPrefixWith(module.name) }.takeIf { it.isNotEmpty() } + ?: "project" return modules.reduce { left, right -> val list = listOf(left, right) - DModule( - name = name, + name = projectName, packages = merge( list.flatMap { it.packages }, DPackage::mergeWith diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt index 150df302..9f86c82a 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt @@ -15,6 +15,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { val packageOptions = context.configuration.passesConfigurations.first { original.platformData.contains(it.platformData) } .perPackageOptions + DocumentableFilter(packageOptions).processModule(original) } diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt index 885fbfee..2eb63504 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -30,14 +30,15 @@ object DocTagToContentConverter : CommentsToContentConverter { ) ) - fun buildList(ordered: Boolean) = + fun buildList(ordered: Boolean, start: Int = 1) = listOf( ContentList( buildChildren(docTag), ordered, dci, platforms, - styles + styles, + ((PropertyContainer.empty()) + SimpleAttr("start", start.toString())) ) ) @@ -53,7 +54,7 @@ object DocTagToContentConverter : CommentsToContentConverter { is H5 -> buildHeader(5) is H6 -> buildHeader(6) is Ul -> buildList(false) - is Ol -> buildList(true) + is Ol -> buildList(true, docTag.params["start"]?.toInt() ?: 1) is Li -> buildChildren(docTag) is Br -> buildNewLine() is B -> buildChildren(docTag, setOf(TextStyle.Strong)) diff --git a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt index f77ec086..852ac735 100644 --- a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt @@ -2,9 +2,11 @@ package renderers import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.html.RootCreator -import org.jetbrains.dokka.base.resolvers.DefaultLocationProviderFactory -import org.jetbrains.dokka.base.resolvers.LocationProvider -import org.jetbrains.dokka.base.resolvers.LocationProviderFactory +import org.jetbrains.dokka.base.resolvers.external.DokkaExternalLocationProviderFactory +import org.jetbrains.dokka.base.resolvers.external.JavadocExternalLocationProviderFactory +import org.jetbrains.dokka.base.resolvers.local.DefaultLocationProviderFactory +import org.jetbrains.dokka.base.resolvers.local.LocationProvider +import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder @@ -26,7 +28,9 @@ abstract class RenderingOnlyTestBase { val context = MockContext( DokkaBase().outputWriter to { _ -> files }, DokkaBase().locationProviderFactory to ::DefaultLocationProviderFactory, - DokkaBase().htmlPreprocessors to { _ -> RootCreator } + DokkaBase().htmlPreprocessors to { _ -> RootCreator }, + DokkaBase().externalLocationProviderFactory to { _ -> ::JavadocExternalLocationProviderFactory }, + DokkaBase().externalLocationProviderFactory to { _ -> ::DokkaExternalLocationProviderFactory } ) protected val renderedContent: Element by lazy { diff --git a/plugins/gfm/build.gradle.kts b/plugins/gfm/build.gradle.kts new file mode 100644 index 00000000..c327b96c --- /dev/null +++ b/plugins/gfm/build.gradle.kts @@ -0,0 +1,8 @@ +publishing { + publications { + register("gfm-plugin") { + artifactId = "gfm-plugin" + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt new file mode 100644 index 00000000..64a2cdfc --- /dev/null +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -0,0 +1,196 @@ +package org.jetbrains.dokka.commonmarkrenderer + +import org.jetbrains.dokka.CoreExtensions +import org.jetbrains.dokka.pages.* +import org.jetbrains.dokka.plugability.DokkaContext +import org.jetbrains.dokka.plugability.DokkaPlugin +import java.lang.StringBuilder + + +class CommonmarkRendererPlugin : DokkaPlugin() { + + val locationProviderFactory by extensionPoint() + val outputWriter by extensionPoint() + + val renderer by extending { + CoreExtensions.renderer providing { CommonmarkRenderer(it.single(outputWriter), it) } + } + + val locationProvider by extending { + locationProviderFactory providing { MarkdownLocationProviderFactory(it) } order { + before(renderer) + } + } +} + +class CommonmarkRenderer( + outputWriter: OutputWriter, + context: DokkaContext +) : DefaultRenderer(outputWriter, context) { + override fun StringBuilder.buildHeader(level: Int, content: StringBuilder.() -> Unit) { + buildParagraph() + append("#".repeat(level) + " ") + content() + buildNewLine() + } + + override fun StringBuilder.buildLink(address: String, content: StringBuilder.() -> Unit) { + append("[") + content() + append("]($address)") + } + + override fun StringBuilder.buildList(node: ContentList, pageContext: ContentPage, platformRestriction: PlatformData?) { + buildParagraph() + buildListLevel(node, pageContext) + buildParagraph() + } + + private val indent = " ".repeat(4) + + private fun StringBuilder.buildListItem(items: List, pageContext: ContentPage, bullet: String = "*") { + items.forEach { + if (it is ContentList) { + val builder = StringBuilder() + builder.append(indent) + builder.buildListLevel(it, pageContext) + append(builder.toString().replace(Regex(" \n(?!$)"), " \n$indent")) + } else { + append("$bullet ") + it.build(this, pageContext) + buildNewLine() + } + } + } + + private fun StringBuilder.buildListLevel(node: ContentList, pageContext: ContentPage) { + if (node.ordered) { + buildListItem( + node.children, + pageContext, + "${node.extra.allOfType().find { it.extraKey == "start" }?.extraValue + ?: 1.also { context.logger.error("No starting number specified for ordered list in node ${pageContext.dri.first()}!")}}." + ) + } else { + buildListItem(node.children, pageContext, "*") + } + } + + override fun StringBuilder.buildNewLine() { + append(" \n") + } + + private fun StringBuilder.buildParagraph() { + append("\n\n") + } + + override fun StringBuilder.buildResource(node: ContentEmbeddedResource, pageContext: ContentPage) { + append("Resource") + } + + override fun StringBuilder.buildTable(node: ContentTable, pageContext: ContentPage, platformRestriction: PlatformData?) { + + val size = node.children.firstOrNull()?.children?.size ?: 0 + buildParagraph() + + if (node.header.size > 0) { + node.header.forEach { + it.children.forEach { + append("| ") + it.build(this, pageContext) + } + append("|\n") + } + } else { + append("| ".repeat(size)) + if (size > 0) append("|\n") + } + + append("|---".repeat(size)) + if (size > 0) append("|\n") + + node.children.forEach { + it.children.forEach { + append("| ") + it.build(this, pageContext) + } + append("|\n") + } + } + + override fun StringBuilder.buildText(textNode: ContentText) { + val decorators = decorators(textNode.style) + append(decorators) + append(textNode.text.escapeIllegalCharacters()) + append(decorators.reversed()) + } + + override fun StringBuilder.buildNavigation(page: PageNode) { + locationProvider.ancestors(page).asReversed().forEach { node -> + append("/") + if (node.isNavigable) buildLink(node, page) + else append(node.name) + } + buildParagraph() + } + + override fun buildPage(page: ContentPage, content: (StringBuilder, ContentPage) -> Unit): String = + StringBuilder().apply { + content(this, page) + }.toString() + + override fun buildError(node: ContentNode) { + context.logger.warn("Markdown renderer has encountered problem. The unmatched node is $node") + } + + private fun decorators(styles: Set - - - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/build.gradle b/runners/gradle-integration-tests/testData/androidApp/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "com.android.tools.build:gradle:$abt_plugin_version" - } -} - -allprojects { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} diff --git a/runners/gradle-integration-tests/testData/androidApp/fileTree.txt b/runners/gradle-integration-tests/testData/androidApp/fileTree.txt deleted file mode 100644 index f66c79e3..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/fileTree.txt +++ /dev/null @@ -1,20 +0,0 @@ -/ - app/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidApp/settings.gradle b/runners/gradle-integration-tests/testData/androidApp/settings.gradle deleted file mode 100644 index 1feb2867..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidApp" - -include ':app' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle deleted file mode 100644 index 66421f52..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion Integer.parseInt(sdk_version) - buildToolsVersion abt_version - - defaultConfig { - applicationId "org.example.kotlin.mixed" - minSdkVersion 14 - targetSdkVersion Integer.parseInt(sdk_version) - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" - dokkaRuntime files(dokka_fatjar) -} - - -dokka { - outputFormat = "javadoc" -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml deleted file mode 100644 index b4e1a892..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java deleted file mode 100644 index 3668c594..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.example.kotlin.mixed; - -import android.content.Intent; -import android.os.Bundle; -import android.app.Activity; -import android.view.Menu; -import android.view.View; -import android.widget.Button; - -public class JavaActivity extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Button next = (Button) findViewById(R.id.Button01); - next.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), KotlinActivity.class); - startActivityForResult(myIntent, 0); - } - }); - } - - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - -} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt deleted file mode 100644 index ca2f27b0..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt +++ /dev/null @@ -1,28 +0,0 @@ -package org.example.kotlin.mixed - -import android.content.Intent -import android.os.Bundle -import android.app.Activity -import android.view.Menu -import android.widget.Button - -class KotlinActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main2) - - val next = findViewById(R.id.Button02) as Button - next.setOnClickListener { - val intent: Intent = Intent() - setResult(RESULT_OK, intent) - finish() - } - } - - override fun onCreateOptionsMenu(menu: Menu?): Boolean { - // Inflate the menu; this adds items to the action bar if it is present. - menuInflater.inflate(R.menu.main_activity2, menu) - return true - } -} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e5..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047df..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d760..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index ede57c39..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml deleted file mode 100644 index d707536a..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml deleted file mode 100644 index 47c82246..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 16dp - 16dp - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml deleted file mode 100644 index d8f08bc2..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - AndroidSample - Settings - Hello world! - JavaActivity - KotlinActivity - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml deleted file mode 100644 index 6ce89c7b..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "com.android.tools.build:gradle:$abt_plugin_version" - } -} - -allprojects { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt b/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt deleted file mode 100644 index c5e79eba..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt +++ /dev/null @@ -1,21 +0,0 @@ -/ - allclasses-frame.html - allclasses-noframe.html - constant-values.html - deprecated-list.html - help-doc.html - index-all.html - index.html - org/ - example/ - kotlin/ - mixed/ - JavaActivity.html - KotlinActivity.html - package-frame.html - package-summary.html - package-tree.html - overview-tree.html - package-list - script.js - stylesheet.css diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle deleted file mode 100644 index a4e67fea..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidAppJavadoc" - -include ':app' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle deleted file mode 100644 index 736668ab..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -subprojects { - buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - - } - - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt deleted file mode 100644 index 6c96a01c..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt +++ /dev/null @@ -1,14 +0,0 @@ -/ - lib/ - alltypes/ - index.html - example/ - -lib-clz-use/ - -init-.html - f.html - index.html - index.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle deleted file mode 100644 index bbfeb03c..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle +++ /dev/null @@ -1 +0,0 @@ -apply plugin: 'java' diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java deleted file mode 100644 index 1d9a6fb2..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java +++ /dev/null @@ -1,5 +0,0 @@ -package example.jlib; - -public class LibClz { - -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle deleted file mode 100644 index b1ee52ab..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -buildscript { - dependencies { - classpath "com.android.tools.build:gradle:$abt_plugin_version" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - - -android { - compileSdkVersion Integer.parseInt(sdk_version) - buildToolsVersion abt_version - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } -} - -dependencies { - api(project(":jlib")) - dokkaRuntime files(dokka_fatjar) -} - -dokka { - configuration { - externalDocumentationLink { - url = new URL("https://example.com") - packageListUrl = file("$rootDir/package-list").toURI().toURL() - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml deleted file mode 100644 index 267f6efd..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt deleted file mode 100644 index d034a3a9..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package example - -import example.jlib.LibClz - -/** - * Uses jlib - */ -class LibClzUse { - /** - * Returns LibClz - */ - fun f(): LibClz = LibClz() -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list deleted file mode 100644 index bf76058e..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list +++ /dev/null @@ -1 +0,0 @@ -example.jlib \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle deleted file mode 100644 index 5b4250a0..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = "androidLibDependsOnJavaLib" - - -include(":lib") -include(":jlib") \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle deleted file mode 100644 index 660257ab..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - -android { - compileSdkVersion Integer.parseInt(sdk_version) - buildToolsVersion abt_version - - defaultConfig { - applicationId "org.example.kotlin.mixed" - minSdkVersion 14 - targetSdkVersion Integer.parseInt(sdk_version) - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt') - } - } - - flavorDimensions "mode" - productFlavors { - free { - dimension "mode" - applicationIdSuffix ".free" - versionNameSuffix "-free" - } - full { - dimension "mode" - applicationIdSuffix ".full" - versionNameSuffix "-full" - } - } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - free.java.srcDirs += 'src/free/kotlin' - } -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" - dokkaRuntime files(dokka_fatjar) -} - - -dokka { - outputDirectory = "$buildDir/dokka/all" -} - -task dokkaFullFlavourOnly(type: org.jetbrains.dokka.gradle.DokkaTask) { - outputDirectory = "$buildDir/dokka/fullOnly" - configuration { - moduleName = "full" - kotlinTasks { - ["compileFullReleaseKotlin"] - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml deleted file mode 100644 index 3ecbcd3a..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt deleted file mode 100644 index b0b980fd..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.example.kotlin.mixed.free - -import android.os.Bundle -import android.app.Activity -import org.example.kotlin.mixed.R - -class AdActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_ad) - } - -} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml deleted file mode 100644 index e6443d05..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml deleted file mode 100644 index bbdf2d06..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AdActivity - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml deleted file mode 100644 index b4e1a892..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java deleted file mode 100644 index 3668c594..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.example.kotlin.mixed; - -import android.content.Intent; -import android.os.Bundle; -import android.app.Activity; -import android.view.Menu; -import android.view.View; -import android.widget.Button; - -public class JavaActivity extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Button next = (Button) findViewById(R.id.Button01); - next.setOnClickListener(new View.OnClickListener() { - public void onClick(View view) { - Intent myIntent = new Intent(view.getContext(), KotlinActivity.class); - startActivityForResult(myIntent, 0); - } - }); - } - - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - -} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt deleted file mode 100644 index ca2f27b0..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt +++ /dev/null @@ -1,28 +0,0 @@ -package org.example.kotlin.mixed - -import android.content.Intent -import android.os.Bundle -import android.app.Activity -import android.view.Menu -import android.widget.Button - -class KotlinActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main2) - - val next = findViewById(R.id.Button02) as Button - next.setOnClickListener { - val intent: Intent = Intent() - setResult(RESULT_OK, intent) - finish() - } - } - - override fun onCreateOptionsMenu(menu: Menu?): Boolean { - // Inflate the menu; this adds items to the action bar if it is present. - menuInflater.inflate(R.menu.main_activity2, menu) - return true - } -} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e5..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047df..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d760..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index ede57c39..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml deleted file mode 100644 index d707536a..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml deleted file mode 100644 index 47c82246..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 16dp - 16dp - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml deleted file mode 100644 index d8f08bc2..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - AndroidSample - Settings - Hello world! - JavaActivity - KotlinActivity - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml deleted file mode 100644 index 6ce89c7b..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "com.android.tools.build:gradle:$abt_plugin_version" - } -} - -allprojects { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt deleted file mode 100644 index 77b563b2..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt +++ /dev/null @@ -1,47 +0,0 @@ -/ - all/ - app/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - org.example.kotlin.mixed.free/ - -ad-activity/ - -init-.html - index.html - on-create.html - index.html - package-list - style.css - fullOnly/ - full/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle deleted file mode 100644 index 1feb2867..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidApp" - -include ':app' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/build.gradle b/runners/gradle-integration-tests/testData/basic/build.gradle deleted file mode 100644 index 79645204..00000000 --- a/runners/gradle-integration-tests/testData/basic/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - -apply plugin: 'kotlin' -apply plugin: 'org.jetbrains.dokka' - -repositories { - mavenCentral() - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" - } - maven { - url "https://dl.bintray.com/kotlin/kotlin-dev" - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version -} - - -dokka { - configuration { - classpath += "$projectDir/classDir" - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/fileTree.txt b/runners/gradle-integration-tests/testData/basic/fileTree.txt deleted file mode 100644 index 2ceae371..00000000 --- a/runners/gradle-integration-tests/testData/basic/fileTree.txt +++ /dev/null @@ -1,33 +0,0 @@ -/ - basic/ - alltypes/ - index.html - demo/ - -a/ - -init-.html - index.html - p.html - -greeter/ - -init-.html - greet.html - index.html - name.html - -some-interface.html - -some-sub-type/ - -init-.html - index.html - -some-type/ - -init-.html - index.html - constructor.html - index.html - main.html - p1.-my-binary-class/ - index.html - test.html - str.html - x.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/basic/settings.gradle b/runners/gradle-integration-tests/testData/basic/settings.gradle deleted file mode 100644 index c36a146c..00000000 --- a/runners/gradle-integration-tests/testData/basic/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "basic" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt deleted file mode 100644 index 3d7bcb51..00000000 --- a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,45 +0,0 @@ -package demo - -import p1.MyBinaryClass - -/** - * This class supports greeting people by name. - * - * @property name The name of the person to be greeted. - */ -class Greeter(val name: String) { - - /** - * Prints the greeting to the standard output. - */ - fun greet() { - println("Hello $name!") - } -} - -fun main(args: Array) { - Greeter(args[0]).greet() -} - -val str = "Hello! ".repeat(4) -val x: (a: String, b: Int) -> Int = { a, b -> 0 } - -interface SomeInterface -private class SomeImpl : SomeInterface - -fun SomeInterface.constructor(): SomeInterface { - return SomeImpl() -} - -open class SomeType -class SomeSubType : SomeType() - -fun SomeType.constructor(): SomeType { - return SomeSubType() -} - - -annotation class A(val p: String) - -val MyBinaryClass.test get() = s() - diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle deleted file mode 100644 index 0ea86d4c..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'org.jetbrains.dokka' -} - -subprojects { - buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } - } - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) -} - -apply plugin: 'org.jetbrains.dokka' - -dokka { - configuration { - kotlinTasks { - [":subA:compileKotlin", ":subB:compileKotlin"] - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt deleted file mode 100644 index 5624fca6..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt +++ /dev/null @@ -1,33 +0,0 @@ -/ - multi-project-root/ - alltypes/ - index.html - index-outline.html - index.html - package-list - s1/ - -my-class/ - -init-.html - index.html - otherworks.html - -super/ - -init-.html - bar.html - foo.html - index.html - index.html - some-cool-thing.html - s2/ - -cooler/ - -init-.html - a.html - coolest.html - index.html - my-class.html - -superful/ - -init-.html - bar.html - index.html - index.html - main.html - style.css diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle deleted file mode 100644 index 283cc526..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "multiProjectRoot" - -include 'subA', 'subB' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle deleted file mode 100644 index 0600411e..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -apply plugin: 'kotlin' - -dependencies { - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version -} diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt deleted file mode 100644 index 126d7f3e..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt +++ /dev/null @@ -1,31 +0,0 @@ -package s1 - -/** - * Coolest one - */ -fun someCoolThing(s: String) = s.repeat(2) - -/** - * Just a class - */ -class MyClass { - /** - * Ultimate answer to all questions - */ - fun otherworks(): Int = 42 -} - -/** - * Just a SUPER class - */ -open class Super { - /** - * Same as [MyClass.otherworks] - */ - fun foo(i: Int = 21) = i * 2 - - /** - * magic - */ - open fun bar() = foo() -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle deleted file mode 100644 index 7b8ff9f3..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -apply plugin: 'kotlin' - -dependencies { - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version - compile project(":subA") -} diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt deleted file mode 100644 index 8a87590a..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt +++ /dev/null @@ -1,31 +0,0 @@ -package s2 - -import s1.Super -import s1.MyClass -import s1.someCoolThing - -/** - * Just an entry-point - */ -fun main(args: Array) { - -} - -/** - * Take a glass of hot water - */ -class Cooler { - val myClass = MyClass() - val a = myClass.otherworks() - val coolest = someCoolThing() -} - -/** - * Powerful - */ -class Superful : Super() { - /** - * Overriden magic - */ - override fun bar() = foo(20) * 2 -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle b/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle deleted file mode 100644 index b5454c55..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - -repositories { - jcenter() - mavenLocal() -} - -group 'org.test' -version '1.0-SNAPSHOT' - -apply plugin: "org.jetbrains.kotlin.multiplatform" - -kotlin { - jvm() // Create a JVM target with the default name 'jvm' - js() - sourceSets { - jsMain { - dependencies{ - implementation "org.jetbrains.kotlin:kotlin-stdlib-js" - } - } - jvmMain { - dependencies { - implementation kotlin('stdlib-jdk8') - } - } - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) -} - -apply plugin: 'org.jetbrains.dokka' - -dokka { - - multiplatform { - javascript { - targets = ["js"] - platform = "js" - kotlinTasks { [tasks.getByPath(":compileKotlinJs")] } - } - jvm {} - } -} diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt b/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt deleted file mode 100644 index e9cc847c..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt +++ /dev/null @@ -1,18 +0,0 @@ -/ - multiplatform-project-root/ - alltypes/ - index.html - index-outline.html - index.html - org.kotlintestmpp/ - get-current-date.html - index.html - js.html - jvm.html - kotlin.-string/ - index.html - my-extension.html - main.html - shared.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle b/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle deleted file mode 100644 index 0bb1e91b..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "multiplatformProjectRoot" diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt b/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt deleted file mode 100644 index a77b50f9..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.kotlintestmpp - -fun main(args : Array) { - console.log("Hello, world!") -} - -fun js(){} -fun shared(){} - -fun getCurrentDate(): String { - return "test" -} - -fun String.myExtension() = println("test") \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt b/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt deleted file mode 100644 index 96d725fc..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.kotlintestmpp - - -fun main(args : Array) { - println("Hello, world!") -} - -/** - * comment for this class - */ -fun jvm(){} -fun shared(){} - -fun getCurrentDate(): String { - return "test" -} - -fun String.myExtension() = println("test2") - - diff --git a/runners/gradle-integration-tests/testData/sourcesChange/build.gradle b/runners/gradle-integration-tests/testData/sourcesChange/build.gradle deleted file mode 100644 index a6270e23..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - -apply plugin: 'kotlin' -apply plugin: 'org.jetbrains.dokka' - -repositories { - mavenCentral() - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" - } - maven { - url "https://dl.bintray.com/kotlin/kotlin-dev" - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt b/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt deleted file mode 100644 index 09f3724b..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt +++ /dev/null @@ -1,10 +0,0 @@ -/ - sources-change/ - alltypes.html - demo/ - hello.html - index.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt b/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt deleted file mode 100644 index eeb377f7..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt +++ /dev/null @@ -1,11 +0,0 @@ -/ - sources-change/ - alltypes.html - demo/ - hello.html - index.html - world.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle b/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle deleted file mode 100644 index 3fb032bf..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "sourcesChange" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt deleted file mode 100644 index c54dea50..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,6 +0,0 @@ -package demo - -/** - * @return Hello - */ -fun hello(): String = "Hello" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt deleted file mode 100644 index 53f22ff5..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,11 +0,0 @@ -package demo - -/** - * @return Hello - */ -fun hello(): String = "Hello" - -/** - * @return World - */ -fun world(): String = "World" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle b/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle deleted file mode 100644 index 8688ae41..00000000 --- a/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle +++ /dev/null @@ -1,73 +0,0 @@ -import org.jetbrains.dokka.* -import org.jetbrains.dokka.gradle.* -import org.jetbrains.kotlin.gradle.tasks.* - -import groovy.transform.CompileStatic -import java.util.concurrent.Callable - -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - -apply plugin: 'kotlin' - -@CompileStatic -def configureDokkaTypeSafely(DokkaTask dokka) { - dokka.with { - outputFormat = "some String" - outputDirectory = "some String" - cacheRoot = null as String - impliedPlatforms = new ArrayList() - } - dokka.configuration.with { - moduleName = "some String" - classpath = Arrays.asList("someClassDir") - includes = Collections. emptyList() - samples = Collections. emptyList() - jdkVersion = 6 - sourceRoots = new ArrayList() as List - - includeNonPublic = false - skipDeprecated = false - skipEmptyPackages = true - reportUndocumented = true - perPackageOptions = new ArrayList() as List - externalDocumentationLinks = new ArrayList() - noStdlibLink = false - languageVersion = null as String - apiVersion = null as String - sourceRoot(new Action() { - @Override - void execute(GradleSourceRootImpl sourceRoot) { - sourceRoot.path = "some String" - } - }) - externalDocumentationLink(new Action() { - @Override - void execute(GradleExternalDocumentationLinkImpl link) { - link.url = uri("some URI").toURL() - link.packageListUrl = uri("some URI").toURL() - } - }) - kotlinTasks(new Callable>() { - @Override - List call() { - return defaultKotlinTasks() - } - }) - } -} - -project.tasks.withType(DokkaTask) { dokka -> - configureDokkaTypeSafely(dokka) -} diff --git a/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle b/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle deleted file mode 100644 index be82e328..00000000 --- a/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "type-safe-configuration" \ No newline at end of file diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 917c7d7e..71d7e72f 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -32,12 +32,11 @@ val sourceJar by tasks.registering(Jar::class) { from(sourceSets["main"].allSource) } -configureBintrayPublication("dokkaGradlePlugin") // TODO check if this publishes correctly +// TODO: https://github.com/Kotlin/dokka/issues/1052 +tasks.getByName("validatePlugins").enabled = false val gradlePluginImplementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin" -val gradlePluginId = "org.jetbrains.dokka" - publishing { publications { register("dokkaGradlePlugin") { @@ -55,6 +54,8 @@ publishing { } } +configureBintrayPublication("dokkaGradlePlugin") + gradlePlugin { plugins { create("dokkaGradlePlugin") { @@ -64,9 +65,7 @@ gradlePlugin { } } - pluginBundle { - // TODO check if this publishes correctly website = "https://www.kotlinlang.org/" vcsUrl = "https://github.com/kotlin/dokka.git" description = "Dokka, the Kotlin documentation tool" -- cgit From b0e8622f374f6499058b0f083367b4a54512b702 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 30 Jun 2020 23:06:03 +0200 Subject: Enforce workspace unique SourceSetID --- build.gradle.kts | 4 +- core/src/main/kotlin/DokkaBootstrapImpl.kt | 5 +- core/src/main/kotlin/DokkaGenerator.kt | 2 +- .../main/kotlin/DokkaMultimoduleBootstrapImpl.kt | 5 +- core/src/main/kotlin/configuration.kt | 27 ++- core/src/main/kotlin/defaultConfiguration.kt | 22 ++- core/src/main/kotlin/plugability/DokkaPlugin.kt | 2 +- .../org/jetbrains/dokka/analysis/KotlinAnalysis.kt | 5 +- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 22 +-- .../main/kotlin/signatures/JvmSignatureUtils.kt | 3 +- .../DocumentableVisibilityFilterTransformer.kt | 12 +- .../EmptyPackagesFilterTransformer.kt | 6 +- .../ModuleAndPackageDocumentationTransformer.kt | 4 +- .../pages/samples/SamplesTransformer.kt | 4 +- .../DefaultDescriptorToDocumentableTranslator.kt | 4 +- .../psi/DefaultPsiToDocumentableTranslator.kt | 2 +- plugins/base/src/test/kotlin/basic/DRITest.kt | 40 ++-- .../base/src/test/kotlin/basic/DokkaBasicTests.kt | 6 +- .../src/test/kotlin/basic/FailOnWarningTest.kt | 18 +- .../annotations/ContentForAnnotationsTest.kt | 6 +- .../annotations/DepredatedAndSinceKotlinTest.kt | 8 +- .../kotlin/content/params/ContentForParamsTest.kt | 4 +- .../content/seealso/ContentForSeeAlsoTest.kt | 6 +- .../content/signatures/ContentForSignaturesTest.kt | 4 +- .../SkippingParenthesisForConstructorsTest.kt | 6 +- plugins/base/src/test/kotlin/enums/EnumsTest.kt | 20 +- .../src/test/kotlin/expect/AbstractExpectTest.kt | 6 +- .../test/kotlin/filter/DeprecationFilterTest.kt | 22 +-- .../test/kotlin/filter/EmptyPackagesFilterTest.kt | 11 +- .../src/test/kotlin/filter/VisibilityFilterTest.kt | 22 +-- plugins/base/src/test/kotlin/issues/IssuesTest.kt | 6 +- .../kotlin/linkableContent/LinkableContentTest.kt | 38 ++-- .../DefaultLocationProviderTest.kt | 6 +- plugins/base/src/test/kotlin/markdown/KDocTest.kt | 6 +- plugins/base/src/test/kotlin/markdown/LinkTest.kt | 10 +- .../base/src/test/kotlin/model/InheritorsTest.kt | 8 +- plugins/base/src/test/kotlin/model/PropertyTest.kt | 6 +- .../kotlin/multiplatform/BasicMultiplatformTest.kt | 10 +- .../test/kotlin/pageMerger/PageNodeMergerTest.kt | 10 +- .../test/kotlin/renderers/html/DivergentTest.kt | 8 +- .../renderers/html/SourceSetDependentHintTest.kt | 8 +- .../test/kotlin/renderers/html/defaultSourceSet.kt | 9 +- .../test/kotlin/resourceLinks/ResourceLinksTest.kt | 6 +- .../PageTransformerBuilderTest.kt | 12 +- .../ReportUndocumentedTransformerTest.kt | 136 ++++++------- .../DefaultPsiToDocumentableTranslatorTest.kt | 14 +- plugins/base/src/test/kotlin/utils/ModelUtils.kt | 4 +- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 6 +- .../javadoc/AbstractJavadocTemplateMapTest.kt | 5 +- .../javadoc/src/test/kotlin/javadoc/JavadocTest.kt | 4 +- .../kotlin/javadoc/location/JavadocLocationTest.kt | 6 +- .../src/test/kotlin/KotlinAsJavaPluginTest.kt | 13 +- runners/ant/build.gradle | 18 -- runners/ant/src/main/kotlin/ant/dokka.kt | 210 --------------------- runners/ant/src/main/resources/dokka-antlib.xml | 3 - runners/cli/build.gradle.kts | 3 +- runners/cli/src/main/kotlin/cli/main.kt | 57 +++--- runners/gradle-plugin/build.gradle.kts | 2 + .../dokka/gradle/ConfigurationExtractor.kt | 2 +- .../jetbrains/dokka/gradle/DokkaCollectorTask.kt | 8 +- .../dokka/gradle/DokkaSourceSetIDFactory.kt | 10 + .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 36 ++-- .../dokka/gradle/configurationImplementations.kt | 93 +++++++-- .../main/kotlin/org/jetbrains/dokka/gradle/main.kt | 4 +- .../gradle/KotlinDslDokkaTaskConfigurationTest.kt | 77 ++++++++ runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 14 +- .../src/main/kotlin/testApi/context/MockContext.kt | 3 +- .../testApi/testRunner/DokkaTestGenerator.kt | 3 +- .../main/kotlin/testApi/testRunner/TestRunner.kt | 19 +- 69 files changed, 567 insertions(+), 634 deletions(-) delete mode 100644 runners/ant/build.gradle delete mode 100644 runners/ant/src/main/kotlin/ant/dokka.kt delete mode 100644 runners/ant/src/main/resources/dokka-antlib.xml create mode 100644 runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaSourceSetIDFactory.kt (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index c94faa77..04f4afd4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ allprojects { val language_version: String by project tasks.withType(KotlinCompile::class).all { kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict -Xskip-metadata-version-check" + freeCompilerArgs += "-Xjsr305=strict -Xskip-metadata-version-check -Xopt-in=kotlin.RequiresOptIn." languageVersion = language_version apiVersion = language_version jvmTarget = "1.8" @@ -49,4 +49,4 @@ subprojects { } } -println("Publication version: $dokka_version") \ No newline at end of file +println("Publication version: $dokka_version") diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index bd632546..be3d6c9b 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -1,8 +1,6 @@ package org.jetbrains.dokka -import com.google.gson.Gson import org.jetbrains.dokka.DokkaConfiguration.PackageOptions -import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.DokkaLogger import java.util.function.BiConsumer @@ -80,7 +78,6 @@ class DokkaBootstrapImpl : DokkaBootstrap { } private lateinit var generator: DokkaGenerator - val gson = Gson() fun configure(logger: DokkaLogger, configuration: DokkaConfigurationImpl) = with(configuration) { @@ -113,7 +110,7 @@ class DokkaBootstrapImpl : DokkaBootstrap { override fun configure(logger: BiConsumer, serializedConfigurationJSON: String) = configure( DokkaProxyLogger(logger), - gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java) + DokkaConfigurationImpl(serializedConfigurationJSON) ) override fun generate() = generator.generate() diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index ce8d229a..ee1adf0b 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -68,7 +68,7 @@ class DokkaGenerator( fun createDocumentationModels( context: DokkaContext ) = context.configuration.sourceSets - .flatMap { passConfiguration -> translateSources(passConfiguration, context) } + .flatMap { sourceSet -> translateSources(sourceSet, context) } fun transformDocumentationModelBeforeMerge( modulesFromPlatforms: List, diff --git a/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt b/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt index 6825ce64..70b99f8d 100644 --- a/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka -import com.google.gson.Gson import org.jetbrains.dokka.DokkaBootstrapImpl.DokkaProxyLogger import org.jetbrains.dokka.utilities.DokkaLogger import java.util.function.BiConsumer @@ -15,11 +14,11 @@ class DokkaMultimoduleBootstrapImpl : DokkaBootstrap { override fun configure(logger: BiConsumer, serializedConfigurationJSON: String) = configure( DokkaProxyLogger(logger), - Gson().fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java) + DokkaConfigurationImpl(serializedConfigurationJSON) ) override fun generate() { generator.generateAllModulesPage() } -} \ No newline at end of file +} diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 463d2342..c531ab9a 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -1,6 +1,10 @@ +@file:Suppress("FunctionName") + package org.jetbrains.dokka +import com.google.gson.Gson import java.io.File +import java.io.Serializable import java.net.URL object DokkaDefaults { @@ -43,6 +47,23 @@ enum class Platform(val key: String) { } } +data class DokkaSourceSetID( + val moduleName: String, + val sourceSetName: String +) : Serializable { + override fun toString(): String { + return "$moduleName/$sourceSetName" + } +} + +fun DokkaConfigurationImpl(json: String): DokkaConfigurationImpl { + return Gson().fromJson(json, DokkaConfigurationImpl::class.java) +} + +fun DokkaConfiguration.toJson(): String { + return Gson().toJson(this) +} + interface DokkaConfiguration { val outputDir: String val format: String @@ -55,12 +76,12 @@ interface DokkaConfiguration { val pluginsConfiguration: Map interface DokkaSourceSet { - val moduleName: String + val sourceSetID: DokkaSourceSetID val displayName: String - val sourceSetID: String + val moduleDisplayName: String val classpath: List val sourceRoots: List - val dependentSourceSets: List + val dependentSourceSets: Set val samples: List val includes: List val includeNonPublic: Boolean diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index d3ac9df2..47bd7fe2 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import java.io.File import java.net.URL @@ -16,12 +17,12 @@ data class DokkaConfigurationImpl( ) : DokkaConfiguration data class DokkaSourceSetImpl( - override val moduleName: String, + override val moduleDisplayName: String, override val displayName: String, - override val sourceSetID: String, + override val sourceSetID: DokkaSourceSetID, override val classpath: List, override val sourceRoots: List, - override val dependentSourceSets: List, + override val dependentSourceSets: Set, override val samples: List, override val includes: List, override val includeNonPublic: Boolean, @@ -39,23 +40,23 @@ data class DokkaSourceSetImpl( override val noJdkLink: Boolean, override val suppressedFiles: List, override val analysisPlatform: Platform -) : DokkaConfiguration.DokkaSourceSet +) : DokkaSourceSet data class DokkaModuleDescriptionImpl( override val name: String, override val path: String, override val docFile: String -): DokkaConfiguration.DokkaModuleDescription +) : DokkaConfiguration.DokkaModuleDescription data class SourceRootImpl( override val path: String -): DokkaConfiguration.SourceRoot +) : DokkaConfiguration.SourceRoot data class SourceLinkDefinitionImpl( override val path: String, override val url: String, override val lineSuffix: String? -): DokkaConfiguration.SourceLinkDefinition { +) : DokkaConfiguration.SourceLinkDefinition { companion object { fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinitionImpl { val (path, urlAndLine) = srcLink.split('=') @@ -73,9 +74,10 @@ data class PackageOptionsImpl( override val reportUndocumented: Boolean?, override val skipDeprecated: Boolean, override val suppress: Boolean -): DokkaConfiguration.PackageOptions +) : DokkaConfiguration.PackageOptions -data class ExternalDocumentationLinkImpl(override val url: URL, - override val packageListUrl: URL +data class ExternalDocumentationLinkImpl( + override val url: URL, + override val packageListUrl: URL ) : DokkaConfiguration.ExternalDocumentationLink diff --git a/core/src/main/kotlin/plugability/DokkaPlugin.kt b/core/src/main/kotlin/plugability/DokkaPlugin.kt index fe472b12..7ead43b8 100644 --- a/core/src/main/kotlin/plugability/DokkaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaPlugin.kt @@ -82,4 +82,4 @@ inline fun configuratio } } } -} \ No newline at end of file +} diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt index 426ffdde..e723768c 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.analysis import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.model.SourceSetDependent import org.jetbrains.dokka.plugability.DokkaContext @@ -21,7 +22,7 @@ fun KotlinAnalysis(context: DokkaContext): KotlinAnalysis { interface KotlinAnalysis : SourceSetDependent { override fun get(key: DokkaSourceSet): EnvironmentAndFacade - operator fun get(sourceSetID: String): EnvironmentAndFacade + operator fun get(sourceSetID: DokkaSourceSetID): EnvironmentAndFacade } internal class KotlinAnalysisImpl( @@ -32,7 +33,7 @@ internal class KotlinAnalysisImpl( return environments[key] ?: throw IllegalStateException("Missing EnvironmentAndFacade for sourceSet $key") } - override fun get(sourceSetID: String): EnvironmentAndFacade { + override fun get(sourceSetID: DokkaSourceSetID): EnvironmentAndFacade { return environments.entries.first { (sourceSet, _) -> sourceSet.sourceSetID == sourceSetID }.value } } diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index de892bb1..f8fa3b2e 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -94,7 +94,7 @@ open class HtmlRenderer( group.sourceSets.forEach { button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" - attributes["data-filter"] = it.sourceSetID + attributes["data-filter"] = it.sourceSetID.toString() when (it.analysisPlatform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" @@ -168,10 +168,10 @@ open class HtmlRenderer( attributes["data-toggle-list"] = "data-toggle-list" contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { - attributes["data-filterable-current"] = pair.first.sourceSetID - attributes["data-filterable-set"] = pair.first.sourceSetID + attributes["data-filterable-current"] = pair.first.sourceSetID.toString() + attributes["data-filterable-set"] = pair.first.sourceSetID.toString() if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.sourceSetID + attributes["data-toggle"] = pair.first.sourceSetID.toString() when ( pair.first.analysisPlatform.key ) { @@ -180,7 +180,7 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - attributes["data-toggle"] = pair.first.sourceSetID + attributes["data-toggle"] = pair.first.sourceSetID.toString() text(pair.first.displayName) } } @@ -212,7 +212,7 @@ open class HtmlRenderer( }.map { it to createHTML(prettyPrint = false).div(classes = "content sourceset-depenent-content") { if (counter++ == 0) attributes["data-active"] = "" - attributes["data-togglable"] = it.sourceSetID + attributes["data-togglable"] = it.sourceSetID.toString() unsafe { +html } @@ -249,10 +249,10 @@ open class HtmlRenderer( consumer.onTagContentUnsafe { +createHTML().div("divergent-group") { attributes["data-filterable-current"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetID + it.sourceSetID.toString() } attributes["data-filterable-set"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetID + it.sourceSetID.toString() } val divergentForPlatformDependent = groupedDivergent.map { (sourceSet, elements) -> @@ -353,10 +353,10 @@ open class HtmlRenderer( div(classes = "table-row") { if (!style.contains(MultimoduleTable)) { attributes["data-filterable-current"] = node.sourceSets.joinToString(" ") { - it.sourceSetID + it.sourceSetID.toString() } attributes["data-filterable-set"] = node.sourceSets.joinToString(" ") { - it.sourceSetID + it.sourceSetID.toString() } } @@ -728,4 +728,4 @@ private fun String.stripDiv() = drop(5).dropLast(6) // TODO: Find a way to do it private val PageNode.isNavigable: Boolean get() = this !is RendererSpecificPage || strategy != RenderingStrategy.DoNothing -fun PropertyContainer.extraHtmlAttributes() = allOfType() \ No newline at end of file +fun PropertyContainer.extraHtmlAttributes() = allOfType() diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt index f042eae3..2a242948 100644 --- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt +++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka.base.signatures -import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* @@ -142,4 +141,4 @@ interface JvmSignatureUtils { sealed class AtStrategy object All : AtStrategy() object OnlyOnce : AtStrategy() -object Never : AtStrategy() \ No newline at end of file +object Never : AtStrategy() diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt index c3cc4d38..ff05beed 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt @@ -9,11 +9,9 @@ import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet class DocumentableVisibilityFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { override fun invoke(modules: List) = modules.map { original -> - val passOptions = original.sourceSets.single() - val packageOptions = passOptions.perPackageOptions - original.let { - DocumentableVisibilityFilter(packageOptions, passOptions).processModule(it) - } + val sourceSet = original.sourceSets.single() + val packageOptions = sourceSet.perPackageOptions + DocumentableVisibilityFilter(packageOptions, sourceSet).processModule(original) } private class DocumentableVisibilityFilter( @@ -45,7 +43,7 @@ class DocumentableVisibilityFilterTransformer(val context: DokkaContext) : PreMe private fun filterPackages(packages: List): Pair> { var packagesListChanged = false - val filteredPackages = packages.mapNotNull { + val filteredPackages = packages.map { var modified = false val functions = filterFunctions(it.functions).let { (listModified, list) -> modified = modified || listModified @@ -326,4 +324,4 @@ class DocumentableVisibilityFilterTransformer(val context: DokkaContext) : PreMe return Pair(classlikesListChanged, filteredClasslikes) } } -} \ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt index 3fd0081a..61abfbd7 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt @@ -14,9 +14,9 @@ class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocume } private class EmptyPackagesFilter( - val passOptions: DokkaConfiguration.DokkaSourceSet + val sourceSet: DokkaConfiguration.DokkaSourceSet ) { - fun DPackage.shouldBeSkipped() = passOptions.skipEmptyPackages && + fun DPackage.shouldBeSkipped() = sourceSet.skipEmptyPackages && functions.isEmpty() && properties.isEmpty() && classlikes.isEmpty() @@ -25,4 +25,4 @@ class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocume packages = module.packages.filter { !it.shouldBeSkipped() } ) } -} \ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index 1f718a7c..a0800da8 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -1,12 +1,10 @@ package org.jetbrains.dokka.base.transformers.documentables -import org.jetbrains.dokka.analysis.EnvironmentAndFacade import org.jetbrains.dokka.analysis.KotlinAnalysis import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.base.parsers.MarkdownParser -import org.jetbrains.dokka.model.SourceSetDependent import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer import org.jetbrains.kotlin.name.FqName @@ -24,7 +22,7 @@ internal class ModuleAndPackageDocumentationTransformer( val modulesAndPackagesDocumentation = context.configuration.sourceSets .map { - Pair(it.moduleName, it) to + Pair(it.moduleDisplayName, it) to it.includes.map { Paths.get(it) } .also { it.forEach { diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt index b39715a7..41dea1a2 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt @@ -67,7 +67,7 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { analysis: Map ): ContentNode { val facade = analysis[platform]?.facade - ?: return this.also { context.logger.warn("Cannot resolve facade for platform ${platform.moduleName}") } + ?: return this.also { context.logger.warn("Cannot resolve facade for platform ${platform.moduleDisplayName}") } val psiElement = fqNameToPsiElement(facade, fqName) ?: return this.also { context.logger.warn("Cannot find PsiElement corresponding to $fqName") } val imports = @@ -147,4 +147,4 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { style = styles + ContentStyle.RunnableSample + TextStyle.Monospace, extra = extra ) -} \ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 9cdd251c..b0374014 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -23,7 +23,6 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotated import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies import org.jetbrains.kotlin.idea.kdoc.findKDoc -import org.jetbrains.kotlin.idea.kdoc.isBoringBuiltinClass import org.jetbrains.kotlin.load.kotlin.toSourceElement import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.psi.* @@ -36,7 +35,6 @@ import org.jetbrains.kotlin.resolve.constants.KClassValue.Value.NormalClass import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass import org.jetbrains.kotlin.resolve.descriptorUtil.getAllSuperclassesWithoutAny import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces -import org.jetbrains.kotlin.resolve.jvm.isInlineClassThatRequiresMangling import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.resolve.source.KotlinSourceElement @@ -71,7 +69,7 @@ class DefaultDescriptorToDocumentableTranslator( DRIWithPlatformInfo(DRI.topLevel, emptyMap()) ) } - }.let { DModule(sourceSet.moduleName, it, emptyMap(), null, setOf(sourceSet)) } + }.let { DModule(sourceSet.moduleDisplayName, it, emptyMap(), null, setOf(sourceSet)) } } } diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 76f8319d..5a55e3ec 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -68,7 +68,7 @@ class DefaultPsiToDocumentableTranslator( context.logger ) return DModule( - sourceSet.moduleName, + sourceSet.moduleDisplayName, psiFiles.mapNotNull { it.safeAs() }.groupBy { it.packageName }.map { (packageName, psiFiles) -> val dri = DRI(packageName = packageName) DPackage( diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index 1f4c7d93..559a2dbf 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -5,19 +5,19 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.Nullable import org.jetbrains.dokka.links.TypeConstructor import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.pages.* -import org.jetbrains.dokka.pages.dfs -import org.junit.jupiter.api.Assertions.assertEquals +import org.jetbrains.dokka.pages.ClasslikePageNode +import org.jetbrains.dokka.pages.ContentPage +import org.jetbrains.dokka.pages.MemberPageNode import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest - +import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test class DRITest : AbstractCoreTest() { @Test fun issue634() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -52,8 +52,8 @@ class DRITest : AbstractCoreTest() { @Test fun issue634WithImmediateNullableSelf() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -82,8 +82,8 @@ class DRITest : AbstractCoreTest() { @Test fun issue634WithGenericNullableReceiver() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -112,8 +112,8 @@ class DRITest : AbstractCoreTest() { @Test fun issue642WithStarAndAny() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { analysisPlatform = "js" sourceRoots = listOf("src/") } @@ -171,8 +171,8 @@ class DRITest : AbstractCoreTest() { @Test fun driForGenericClass(){ val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -201,8 +201,8 @@ class DRITest : AbstractCoreTest() { @Test fun driForGenericFunction(){ val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") classpath = listOfNotNull(jvmStdlibPath) } @@ -243,8 +243,8 @@ class DRITest : AbstractCoreTest() { @Test fun driForFunctionNestedInsideInnerClass() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") classpath = listOfNotNull(jvmStdlibPath) } @@ -280,8 +280,8 @@ class DRITest : AbstractCoreTest() { @Test fun driForGenericExtensionFunction(){ val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } diff --git a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt index 5cc17bf3..bceb79ae 100644 --- a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt +++ b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt @@ -11,8 +11,8 @@ class DokkaBasicTests : AbstractCoreTest() { @Test fun basic1() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } } @@ -39,4 +39,4 @@ class DokkaBasicTests : AbstractCoreTest() { private fun ModulePageNode.getClasslikeToMemberMap() = this.parentMap.filterValues { it is ClasslikePageNode }.entries.groupBy({ it.value }) { it.key } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt b/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt index d548b75b..9d2c5825 100644 --- a/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt +++ b/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt @@ -14,8 +14,8 @@ class FailOnWarningTest : AbstractCoreTest() { fun `throws exception if one or more warnings were emitted`() { val configuration = dokkaConfiguration { failOnWarning = true - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin") } } @@ -39,8 +39,8 @@ class FailOnWarningTest : AbstractCoreTest() { fun `throws exception if one or more error were emitted`() { val configuration = dokkaConfiguration { failOnWarning = true - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin") } } @@ -66,8 +66,8 @@ class FailOnWarningTest : AbstractCoreTest() { val configuration = dokkaConfiguration { failOnWarning = true - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin") } } @@ -88,8 +88,8 @@ class FailOnWarningTest : AbstractCoreTest() { fun `does not throw if disabled`() { val configuration = dokkaConfiguration { failOnWarning = false - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin") } } @@ -115,4 +115,4 @@ private class ZeroErrorOrWarningCountDokkaLogger( ) : DokkaLogger by logger { override var warningsCount: Int = 0 override var errorsCount: Int = 0 -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 7add4119..bf78b847 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -14,8 +14,8 @@ class ContentForAnnotationsTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" } @@ -218,4 +218,4 @@ class ContentForAnnotationsTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt index 99ec25c5..69de1bcd 100644 --- a/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/DepredatedAndSinceKotlinTest.kt @@ -3,19 +3,17 @@ package content.annotations import matchers.content.* import org.jetbrains.dokka.pages.ContentPage -import org.jetbrains.dokka.pages.PackagePageNode import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest import org.junit.jupiter.api.Test import utils.ParamAttributes import utils.bareSignature -import utils.propertySignature class DepredatedAndSinceKotlinTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" } @@ -102,4 +100,4 @@ class DepredatedAndSinceKotlinTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt index f6e80891..a9689bc5 100644 --- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt +++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt @@ -17,8 +17,8 @@ import utils.* class ContentForParamsTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" } diff --git a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt index 696c3032..24970660 100644 --- a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt +++ b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt @@ -11,8 +11,8 @@ import utils.unnamedTag class ContentForSeeAlsoTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" } @@ -456,4 +456,4 @@ class ContentForSeeAlsoTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt index 6cb8b0f4..cabe822d 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt @@ -14,8 +14,8 @@ import utils.typealiasSignature class ContentForSignaturesTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" includeNonPublic = true diff --git a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt index d203025b..c2fbd26f 100644 --- a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt @@ -8,8 +8,8 @@ import utils.functionSignature class ConstructorsSignaturesTest : AbstractCoreTest() { private val testConfiguration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" } @@ -190,4 +190,4 @@ class ConstructorsSignaturesTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt index be910b5c..6a973f8e 100644 --- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt @@ -14,8 +14,8 @@ class EnumsTest : AbstractCoreTest() { @Test fun basicEnum() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -45,8 +45,8 @@ class EnumsTest : AbstractCoreTest() { @Test fun enumWithCompanion() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -90,8 +90,8 @@ class EnumsTest : AbstractCoreTest() { @Test fun enumWithConstructor() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -136,8 +136,8 @@ class EnumsTest : AbstractCoreTest() { @Test fun enumWithMethods() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -179,8 +179,8 @@ class EnumsTest : AbstractCoreTest() { @Test fun enumWithAnnotationsOnEntries(){ val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } diff --git a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt index 3b69a54e..4dfdc410 100644 --- a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt @@ -15,8 +15,8 @@ abstract class AbstractExpectTest( protected fun generateOutput(path: Path, outFormat: String): Path? { val config = dokkaConfiguration { format = outFormat - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf(path.toAbsolutePath().asString()) } } @@ -101,4 +101,4 @@ abstract class AbstractExpectTest( ret?.let { Files.list(it).forEach { f -> f.copyRecursively(out.resolve(f.fileName)) } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt index c15e53e8..c8b9f2d4 100644 --- a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt @@ -9,8 +9,8 @@ class DeprecationFilterTest : AbstractCoreTest() { @Test fun `function with false global skipDeprecated`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { skipDeprecated = false sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -39,8 +39,8 @@ class DeprecationFilterTest : AbstractCoreTest() { @Test fun `deprecated function with false global skipDeprecated`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { skipDeprecated = false sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -69,8 +69,8 @@ class DeprecationFilterTest : AbstractCoreTest() { @Test fun `deprecated function with true global skipDeprecated`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") skipDeprecated = true } @@ -99,8 +99,8 @@ class DeprecationFilterTest : AbstractCoreTest() { @Test fun `deprecated function with false global true package skipDeprecated`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") skipDeprecated = false perPackageOptions = mutableListOf( @@ -136,8 +136,8 @@ class DeprecationFilterTest : AbstractCoreTest() { @Test fun `deprecated function with true global false package skipDeprecated`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") skipDeprecated = true perPackageOptions = mutableListOf( @@ -170,4 +170,4 @@ class DeprecationFilterTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt b/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt index 7d96541b..e5b9e9c2 100644 --- a/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt @@ -1,6 +1,5 @@ package filter -import org.jetbrains.dokka.PackageOptionsImpl import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -9,8 +8,8 @@ class EmptyPackagesFilterTest : AbstractCoreTest() { @Test fun `empty package with false skipEmptyPackages`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { skipEmptyPackages = false sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -37,8 +36,8 @@ class EmptyPackagesFilterTest : AbstractCoreTest() { @Test fun `empty package with true skipEmptyPackages`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { skipEmptyPackages = true sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -61,4 +60,4 @@ class EmptyPackagesFilterTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt index 5e8e33dc..192de449 100644 --- a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt @@ -9,8 +9,8 @@ class VisibilityFilterTest : AbstractCoreTest() { @Test fun `public function with false global includeNonPublic`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { includeNonPublic = false sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -39,8 +39,8 @@ class VisibilityFilterTest : AbstractCoreTest() { @Test fun `private function with false global includeNonPublic`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { includeNonPublic = false sourceRoots = listOf("src/main/kotlin/basic/Test.kt") } @@ -69,8 +69,8 @@ class VisibilityFilterTest : AbstractCoreTest() { @Test fun `private function with true global includeNonPublic`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") includeNonPublic = true } @@ -99,8 +99,8 @@ class VisibilityFilterTest : AbstractCoreTest() { @Test fun `private function with false global true package includeNonPublic`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") includeNonPublic = false perPackageOptions = mutableListOf( @@ -136,8 +136,8 @@ class VisibilityFilterTest : AbstractCoreTest() { @Test fun `private function with true global false package includeNonPublic`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/basic/Test.kt") includeNonPublic = true perPackageOptions = mutableListOf( @@ -170,4 +170,4 @@ class VisibilityFilterTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/issues/IssuesTest.kt b/plugins/base/src/test/kotlin/issues/IssuesTest.kt index f67229b7..7b065349 100644 --- a/plugins/base/src/test/kotlin/issues/IssuesTest.kt +++ b/plugins/base/src/test/kotlin/issues/IssuesTest.kt @@ -34,8 +34,8 @@ class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues" |} """, configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") classpath = listOfNotNull(jvmStdlibPath) } @@ -70,4 +70,4 @@ class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues" // } // } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt index 191df066..2775fcf4 100644 --- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt +++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt @@ -23,23 +23,23 @@ class LinkableContentTest : AbstractCoreTest() { val includesDir = getTestDataDir("linkable/includes").toAbsolutePath() val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { moduleName = "example" analysisPlatform = "js" sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { Paths.get("$testDataDir/$it/kotlin").toString() } - sourceSetID = "js" + name = "js" includes = listOf(Paths.get("$includesDir/include2.md").toString()) } - pass { + sourceSet { moduleName = "example" analysisPlatform = "jvm" sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { Paths.get("$testDataDir/$it/kotlin").toString() } - sourceSetID = "jvm" + name = "jvm" includes = listOf(Paths.get("$includesDir/include1.md").toString()) } } @@ -62,8 +62,8 @@ class LinkableContentTest : AbstractCoreTest() { val testDataDir = getTestDataDir("linkable/sources").toAbsolutePath() val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { moduleName = "example" analysisPlatform = "js" sourceRoots = listOf("$testDataDir/jsMain/kotlin") @@ -74,9 +74,9 @@ class LinkableContentTest : AbstractCoreTest() { lineSuffix = "#L" ) ) - sourceSetID = "js" + name = "js" } - pass { + sourceSet { moduleName = "example" analysisPlatform = "jvm" sourceRoots = listOf("$testDataDir/jvmMain/kotlin") @@ -87,7 +87,7 @@ class LinkableContentTest : AbstractCoreTest() { lineSuffix = "#L" ) ) - sourceSetID = "jvm" + name = "jvm" } } } @@ -127,19 +127,19 @@ class LinkableContentTest : AbstractCoreTest() { val testDataDir = getTestDataDir("linkable/samples").toAbsolutePath() val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { moduleName = "example" analysisPlatform = "js" sourceRoots = listOf("$testDataDir/jsMain/kotlin") - sourceSetID = "js" + name = "js" samples = listOf("$testDataDir/jsMain/resources/Samples.kt") } - pass { + sourceSet { moduleName = "example" analysisPlatform = "jvm" sourceRoots = listOf("$testDataDir/jvmMain/kotlin") - sourceSetID = "jvm" + name = "jvm" samples = listOf("$testDataDir/jvmMain/resources/Samples.kt") } } @@ -196,11 +196,11 @@ class LinkableContentTest : AbstractCoreTest() { | """.trimIndent(), dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = "jvm" - sourceSetID = "js" + name = "js" } } } @@ -222,4 +222,4 @@ class LinkableContentTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt index 1bc3ea29..a219fb04 100644 --- a/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt @@ -10,8 +10,8 @@ class DefaultLocationProviderTest: AbstractCoreTest() { @Test fun `#644 same directory for module and package`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -38,4 +38,4 @@ class DefaultLocationProviderTest: AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index 218f7244..f5b29322 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -9,8 +9,8 @@ import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest abstract class KDocTest : AbstractCoreTest() { private val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/example/Test.kt") } } @@ -44,4 +44,4 @@ abstract class KDocTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/markdown/LinkTest.kt b/plugins/base/src/test/kotlin/markdown/LinkTest.kt index ddcef5db..8e4e588e 100644 --- a/plugins/base/src/test/kotlin/markdown/LinkTest.kt +++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt @@ -13,8 +13,8 @@ class LinkTest : AbstractCoreTest() { @Test fun linkToClassLoader() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/parser") } } @@ -46,8 +46,8 @@ class LinkTest : AbstractCoreTest() { @Test fun returnTypeShouldHaveLinkToOuterClassFromInner() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin") } } @@ -75,4 +75,4 @@ class LinkTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index f5517abb..503cf50c 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -44,12 +44,12 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", @Test fun multiplatform() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("common/src/", "jvm/src/") analysisPlatform = "jvm" } - pass { + sourceSet { sourceRoots = listOf("common/src/", "js/src/") analysisPlatform = "js" } @@ -92,4 +92,4 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index e384b920..af952b43 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -169,8 +169,8 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro |@Strictfp var property = "test" """, configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") classpath = listOfNotNull(jvmStdlibPath) } @@ -262,4 +262,4 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro // } // //} -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt index 5facd194..b3ac7b07 100644 --- a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt +++ b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt @@ -11,8 +11,8 @@ class BasicMultiplatformTest : AbstractCoreTest() { val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("$testDataDir/jvmMain/") } } @@ -28,8 +28,8 @@ class BasicMultiplatformTest : AbstractCoreTest() { @Test fun inlineTestExample() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/multiplatform/Test.kt") } } @@ -51,4 +51,4 @@ class BasicMultiplatformTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt index 6ef38aa9..935b9377 100644 --- a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt +++ b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt @@ -39,8 +39,8 @@ class PageNodeMergerTest : AbstractCoreTest() { fun sameNameStrategyTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/pageMerger/Test.kt") } } @@ -82,8 +82,8 @@ class PageNodeMergerTest : AbstractCoreTest() { val strList: MutableList = mutableListOf() val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/pageMerger/Test.kt") } } @@ -123,4 +123,4 @@ class PageNodeMergerTest : AbstractCoreTest() { fun PageNode.childrenRec(): List = listOf(this) + children.flatMap { it.childrenRec() } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt index 6ceb805b..d4778a8e 100644 --- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt @@ -12,14 +12,14 @@ class DivergentTest : RenderingOnlyTestBase() { private val js = defaultSourceSet.copy( "root", "JS", - "js", + defaultSourceSet.sourceSetID.copy(sourceSetName = "js"), analysisPlatform = Platform.js, sourceRoots = listOf(SourceRootImpl("pl1")) ) private val jvm = defaultSourceSet.copy( "root", "JVM", - "jvm", + defaultSourceSet.sourceSetID.copy(sourceSetName = "jvm"), analysisPlatform = Platform.jvm, sourceRoots = listOf(SourceRootImpl("pl1")) @@ -27,7 +27,7 @@ class DivergentTest : RenderingOnlyTestBase() { private val native = defaultSourceSet.copy( "root", "NATIVE", - "native", + defaultSourceSet.sourceSetID.copy(sourceSetName = "native"), analysisPlatform = Platform.native, sourceRoots = listOf(SourceRootImpl("pl1")) ) @@ -344,4 +344,4 @@ class DivergentTest : RenderingOnlyTestBase() { Div(Div("b-", Span()), Div(Div(Div(("b")))), "ab+") ) } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt index c868cfd5..ea1ea9ae 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt @@ -15,21 +15,21 @@ class SourceSetDependentHintTest : RenderingOnlyTestBase() { private val pl1 = defaultSourceSet.copy( "root", "pl1", - "pl1", + defaultSourceSet.sourceSetID.copy(sourceSetName = "pl1"), analysisPlatform = Platform.js, sourceRoots = listOf(SourceRootImpl("pl1")) ) private val pl2 = defaultSourceSet.copy( "root", "pl2", - "pl2", + defaultSourceSet.sourceSetID.copy(sourceSetName = "pl2"), analysisPlatform = Platform.jvm, sourceRoots = listOf(SourceRootImpl("pl1")) ) private val pl3 = defaultSourceSet.copy( "root", "pl3", - "pl3", + defaultSourceSet.sourceSetID.copy(sourceSetName = "pl3"), analysisPlatform = Platform.native, sourceRoots = listOf(SourceRootImpl("pl1")) ) @@ -135,4 +135,4 @@ class SourceSetDependentHintTest : RenderingOnlyTestBase() { HtmlRenderer(context).render(page) renderedContent.match(Div(Div(Div("a")), Div(Div("b")))) } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt b/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt index 771cabaa..a9be1cfd 100644 --- a/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt +++ b/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt @@ -1,15 +1,16 @@ package renderers.html +import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.DokkaSourceSetImpl import org.jetbrains.dokka.Platform internal val defaultSourceSet = DokkaSourceSetImpl( - moduleName = "DEFAULT", + moduleDisplayName = "DEFAULT", displayName = "DEFAULT", - sourceSetID = "DEFAULT", + sourceSetID = DokkaSourceSetID("DEFAULT", "DEFAULT"), classpath = emptyList(), sourceRoots = emptyList(), - dependentSourceSets = emptyList(), + dependentSourceSets = emptySet(), samples = emptyList(), includes = emptyList(), includeNonPublic = false, @@ -27,4 +28,4 @@ internal val defaultSourceSet = DokkaSourceSetImpl( noJdkLink = false, suppressedFiles = emptyList(), analysisPlatform = Platform.DEFAULT -) \ No newline at end of file +) diff --git a/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt b/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt index be87813b..4f8a834b 100644 --- a/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt +++ b/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt @@ -26,8 +26,8 @@ class ResourceLinksTest : AbstractCoreTest() { @Test fun resourceLinksTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/test/Test.kt") } } @@ -68,4 +68,4 @@ class ResourceLinksTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt index e66490c1..d8e057da 100644 --- a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt +++ b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt @@ -21,8 +21,8 @@ class PageTransformerBuilderTest : AbstractCoreTest() { @Test fun scannerTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/transformerBuilder/Test.kt") } } @@ -58,8 +58,8 @@ class PageTransformerBuilderTest : AbstractCoreTest() { @Test fun mapperTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/transformerBuilder/Test.kt") } } @@ -98,8 +98,8 @@ class PageTransformerBuilderTest : AbstractCoreTest() { @Test fun structureTransformerTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/kotlin/transformerBuilder/Test.kt") } } diff --git a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt index 523813fc..72948372 100644 --- a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt +++ b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt @@ -12,8 +12,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented class gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -39,8 +39,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented non-public class does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -65,8 +65,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented function gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -95,8 +95,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented property gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -125,8 +125,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented primary constructor does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -153,8 +153,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `data class component functions do not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin") } @@ -183,8 +183,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented secondary constructor gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -213,8 +213,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented inherited function does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -246,8 +246,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `undocumented inherited property does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -279,8 +279,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `overridden function does not get reported when super is documented`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -315,8 +315,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `overridden property does not get reported when super is documented`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -349,10 +349,10 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { } @Test - fun `report disabled by pass configuration`() { + fun `report disabled by source set`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = false sourceRoots = listOf("src/main/kotlin/Test.kt") } @@ -377,8 +377,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `report enabled by package configuration`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { perPackageOptions += packageOptions( prefix = "sample", reportUndocumented = true, @@ -407,8 +407,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `report enabled by more specific package configuration`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { perPackageOptions += packageOptions( prefix = "sample", reportUndocumented = false, @@ -445,8 +445,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `report disabled by more specific package configuration`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { perPackageOptions += packageOptions( prefix = "sample", reportUndocumented = true, @@ -483,22 +483,22 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `multiplatform undocumented class gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + val commonMain = sourceSet { reportUndocumented = true analysisPlatform = Platform.common.toString() - sourceSetID = "commonMain" + name = "commonMain" displayName = "commonMain" sourceRoots = listOf("src/commonMain/kotlin") } - pass { + sourceSet { reportUndocumented = true analysisPlatform = Platform.jvm.toString() - sourceSetID = "jvmMain" + name = "jvmMain" displayName = "jvmMain" sourceRoots = listOf("src/jvmMain/kotlin") - dependentSourceSets = listOf("commonMain") + dependentSourceSets = setOf(commonMain.sourceSetID) } } } @@ -526,22 +526,22 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `multiplatform undocumented class does not get reported if expect is documented`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + val commonMain = sourceSet { reportUndocumented = true analysisPlatform = Platform.common.toString() - sourceSetID = "commonMain" + name = "commonMain" displayName = "commonMain" sourceRoots = listOf("src/commonMain/kotlin") } - pass { + sourceSet { reportUndocumented = true analysisPlatform = Platform.jvm.toString() - sourceSetID = "jvmMain" + name = "jvmMain" displayName = "jvmMain" sourceRoots = listOf("src/jvmMain/kotlin") - dependentSourceSets = listOf("commonMain") + dependentSourceSets = setOf(commonMain.sourceSetID) } } } @@ -568,31 +568,31 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `multiplatform undocumented function gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + val commonMain = sourceSet { reportUndocumented = true analysisPlatform = Platform.common.toString() - sourceSetID = "commonMain" + name = "commonMain" displayName = "commonMain" sourceRoots = listOf("src/commonMain/kotlin") } - pass { + sourceSet { reportUndocumented = true analysisPlatform = Platform.jvm.toString() - sourceSetID = "jvmMain" + name = "jvmMain" displayName = "jvmMain" sourceRoots = listOf("src/jvmMain/kotlin") - dependentSourceSets = listOf("commonMain") + dependentSourceSets = setOf(commonMain.sourceSetID) } - pass { + sourceSet { reportUndocumented = true analysisPlatform = Platform.native.toString() - sourceSetID = "macosMain" + name = "macosMain" displayName = "macosMain" sourceRoots = listOf("src/macosMain/kotlin") - dependentSourceSets = listOf("commonMain") + dependentSourceSets = setOf(commonMain.sourceSetID) } } } @@ -625,8 +625,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented class gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -652,8 +652,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented non-public class does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -677,8 +677,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented constructor does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -706,8 +706,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented method gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -736,8 +736,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented property gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -766,8 +766,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java undocumented inherited method gets reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -805,8 +805,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java documented inherited method does not get reported`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } @@ -842,8 +842,8 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() { @Test fun `java overridden function does not get reported when super is documented`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { reportUndocumented = true sourceRoots = listOf("src/main/java") } diff --git a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt index 5f8a7864..95fbb3c6 100644 --- a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt +++ b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt @@ -12,8 +12,8 @@ class DefaultPsiToDocumentableTranslatorTest : AbstractCoreTest() { @Test fun `method overriding two documented classes picks closest class documentation`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/java") } } @@ -57,8 +57,8 @@ class DefaultPsiToDocumentableTranslatorTest : AbstractCoreTest() { @Test fun `method overriding class and interface picks class documentation`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/java") } } @@ -102,8 +102,8 @@ class DefaultPsiToDocumentableTranslatorTest : AbstractCoreTest() { @Test fun `method overriding two classes picks closest documented class documentation`() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/main/java") } } @@ -153,4 +153,4 @@ class DefaultPsiToDocumentableTranslatorTest : AbstractCoreTest() { ?.body.orEmpty() } -} \ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/utils/ModelUtils.kt b/plugins/base/src/test/kotlin/utils/ModelUtils.kt index 9697a843..87a9c802 100644 --- a/plugins/base/src/test/kotlin/utils/ModelUtils.kt +++ b/plugins/base/src/test/kotlin/utils/ModelUtils.kt @@ -16,8 +16,8 @@ abstract class AbstractModelTest(val path: String? = null, val pkg: String) : Mo block: DModule.() -> Unit ) { val testConfiguration = configuration ?: dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") analysisPlatform = platform } diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index b955d403..287ef74f 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -140,7 +140,7 @@ open class CommonmarkRenderer( platforms.joinToString( prefix = " [", postfix = "] $text " - ) { "${it.moduleName}/${it.sourceSetID}" }) + ) { "${it.moduleDisplayName}/${it.sourceSetID}" }) buildNewLine() } } @@ -157,7 +157,7 @@ open class CommonmarkRenderer( ) { if(node.dci.kind == ContentKind.Sample || node.dci.kind == ContentKind.Parameters){ node.sourceSets.forEach {sourcesetData -> - append("${sourcesetData.moduleName}/${sourcesetData.sourceSetID}") + append("${sourcesetData.moduleDisplayName}/${sourcesetData.sourceSetID}") buildNewLine() buildTable(node.copy(children = node.children.filter { it.sourceSets.contains(sourcesetData) }, dci = node.dci.copy(kind = ContentKind.Main)), pageContext, sourceSetRestriction) buildNewLine() @@ -286,4 +286,4 @@ class MarkdownLocationProvider( dokkaContext ) { override val extension = ".md" -} \ No newline at end of file +} diff --git a/plugins/javadoc/src/test/kotlin/javadoc/AbstractJavadocTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/AbstractJavadocTemplateMapTest.kt index 138208ae..4fa65c58 100644 --- a/plugins/javadoc/src/test/kotlin/javadoc/AbstractJavadocTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/javadoc/AbstractJavadocTemplateMapTest.kt @@ -15,8 +15,8 @@ import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest internal abstract class AbstractJavadocTemplateMapTest : AbstractCoreTest() { protected var config: DokkaConfigurationImpl = dokkaConfiguration { format = "javadoc" - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src") analysisPlatform = "jvm" } @@ -62,7 +62,6 @@ internal abstract class AbstractJavadocTemplateMapTest : AbstractCoreTest() { ) { testInline(query, configuration) { renderingStage = { rootPageNode, dokkaContext -> - // TODO NOW: Clarify preprocessors! val transformedRootPageNode = preprocessors.fold(rootPageNode) { acc, pageTransformer -> pageTransformer(acc) } diff --git a/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt index 905cb61b..31a33ad5 100644 --- a/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt +++ b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt @@ -10,8 +10,8 @@ class JavadocTest : AbstractCoreTest() { fun test() { val config = dokkaConfiguration { format = "javadoc" - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("jvmSrc/") analysisPlatform = "jvm" } diff --git a/plugins/javadoc/src/test/kotlin/javadoc/location/JavadocLocationTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/location/JavadocLocationTest.kt index cbaa3dd6..a47f0142 100644 --- a/plugins/javadoc/src/test/kotlin/javadoc/location/JavadocLocationTest.kt +++ b/plugins/javadoc/src/test/kotlin/javadoc/location/JavadocLocationTest.kt @@ -23,8 +23,8 @@ class JavadocTest : AbstractCoreTest() { val config = dokkaConfiguration { format = "javadoc" - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("jvmSrc/") externalDocumentationLinks = listOf( externalLink("https://docs.oracle.com/javase/8/docs/api/"), @@ -60,4 +60,4 @@ class JavadocTest : AbstractCoreTest() { } } } -} \ No newline at end of file +} diff --git a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt index db87051b..96446201 100644 --- a/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt +++ b/plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt @@ -3,7 +3,6 @@ package kotlinAsJavaPlugin import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest import org.jetbrains.kotlin.utils.addToStdlib.cast -import org.jetbrains.kotlin.utils.addToStdlib.safeAs import org.junit.jupiter.api.Test class KotlinAsJavaPluginTest : AbstractCoreTest() { @@ -11,8 +10,8 @@ class KotlinAsJavaPluginTest : AbstractCoreTest() { @Test fun topLevelTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -49,8 +48,8 @@ class KotlinAsJavaPluginTest : AbstractCoreTest() { @Test fun topLevelWithClassTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } @@ -90,8 +89,8 @@ class KotlinAsJavaPluginTest : AbstractCoreTest() { @Test fun kotlinAndJavaTest() { val configuration = dokkaConfiguration { - passes { - pass { + sourceSets { + sourceSet { sourceRoots = listOf("src/") } } diff --git a/runners/ant/build.gradle b/runners/ant/build.gradle deleted file mode 100644 index 216420c6..00000000 --- a/runners/ant/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -apply plugin: 'kotlin' - -sourceCompatibility = 1.8 - -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict" - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -dependencies { - compile project(":core") - compileOnly group: 'org.apache.ant', name: 'ant', version: ant_version -} - diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt deleted file mode 100644 index d275ed82..00000000 --- a/runners/ant/src/main/kotlin/ant/dokka.kt +++ /dev/null @@ -1,210 +0,0 @@ -package org.jetbrains.dokka.ant - -import org.apache.tools.ant.BuildException -import org.apache.tools.ant.Project -import org.apache.tools.ant.Task -import org.apache.tools.ant.types.Path -import org.apache.tools.ant.types.Reference -import org.jetbrains.dokka.* -import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink -import org.jetbrains.dokka.utilities.DokkaConsoleLogger -import org.jetbrains.dokka.utilities.DokkaLogger -import java.io.File - -class AntLogger(val task: Task): DokkaLogger { - override var warningsCount: Int = 0 - override var errorsCount: Int = 0 - override fun debug(message: String) = task.log(message, Project.MSG_DEBUG) - override fun info(message: String) = task.log(message, Project.MSG_VERBOSE) - override fun progress(message: String) = task.log(message, Project.MSG_INFO) - override fun warn(message: String) = task.log(message, Project.MSG_WARN).also { warningsCount++ } - override fun error(message: String) = task.log(message, Project.MSG_ERR).also { errorsCount++ } - override fun report() { - if (warningsCount > 0 || errorsCount > 0) { - task.log("Generation completed with $warningsCount warning" + - (if(warningsCount == 1) "" else "s") + - " and $errorsCount error" + - if(errorsCount == 1) "" else "s" - ) - } else { - task.log("generation completed successfully") - } - } -} - -class AntSourceLinkDefinition(var path: String? = null, var url: String? = null, var lineSuffix: String? = null) - -class AntSourceRoot(var path: String? = null) { - fun toSourceRoot(): SourceRootImpl? = path?.let { path -> - SourceRootImpl(path) - } -} - -class TextProperty(var value: String = "") - -class AntPassConfig(task: Task) : DokkaConfiguration.PassConfiguration { - override var moduleName: String = "" - override val classpath: List - get() = buildClassPath.list().toList() - - override val sourceRoots: List - get() = sourcePath.list().map { SourceRootImpl(it) } + antSourceRoots.mapNotNull { it.toSourceRoot() } - - override val samples: List - get() = samplesPath.list().toList() - override val includes: List - get() = includesPath.list().toList() - override var includeNonPublic: Boolean = false - override var includeRootPackage: Boolean = true - override var reportUndocumented: Boolean = false - override var skipEmptyPackages: Boolean = true - override var skipDeprecated: Boolean = false - override var jdkVersion: Int = 8 - override val sourceLinks: List - get() = antSourceLinkDefinition.map { - val path = it.path!! - val url = it.url!! - SourceLinkDefinitionImpl(File(path).canonicalFile.absolutePath, url, it.lineSuffix) - } - override val perPackageOptions: MutableList = mutableListOf() - override val externalDocumentationLinks: List - get() = buildExternalLinksBuilders.map { it.build() } + defaultExternalDocumentationLinks - - override var languageVersion: String? = null - override var apiVersion: String? = null - override var noStdlibLink: Boolean = false - override var noJdkLink: Boolean = false - override var suppressedFiles: MutableList = mutableListOf() - override var collectInheritedExtensionsFromLibraries: Boolean = false - override var analysisPlatform: Platform = Platform.DEFAULT - override var targets: List = listOf() - get() = buildTargets.filter { it.value != "" } - .map { it.value } - - override var sinceKotlin: String? = null - - private val samplesPath: Path by lazy { Path(task.project) } - private val includesPath: Path by lazy { Path(task.project) } - private val buildClassPath: Path by lazy { Path(task.project) } - val sourcePath: Path by lazy { Path(task.project) } - val antSourceRoots: MutableList = mutableListOf() - - private val buildTargets: MutableList = mutableListOf() - private val buildExternalLinksBuilders: MutableList = mutableListOf() - val antSourceLinkDefinition: MutableList = mutableListOf() - - private val defaultExternalDocumentationLinks: List - get() { - val links = mutableListOf() - if (!noJdkLink) - links += DokkaConfiguration.ExternalDocumentationLink.Builder("https://docs.oracle.com/javase/$jdkVersion/docs/api/").build() - - if (!noStdlibLink) - links += DokkaConfiguration.ExternalDocumentationLink.Builder("https://kotlinlang.org/api/latest/jvm/stdlib/").build() - return links - } - - - fun setSamples(ref: Path) { - samplesPath.append(ref) - } - - fun setSamplesRef(ref: Reference) { - samplesPath.createPath().refid = ref - } - - fun setInclude(ref: Path) { - includesPath.append(ref) - } - - fun setClasspath(classpath: Path) { - buildClassPath.append(classpath) - } - - fun createPackageOptions(): AntPackageOptions = AntPackageOptions().apply { perPackageOptions.add(this) } - - fun createSourceRoot(): AntSourceRoot = AntSourceRoot().apply { antSourceRoots.add(this) } - - fun createTarget(): TextProperty = TextProperty().apply { - buildTargets.add(this) - } - - fun setClasspathRef(ref: Reference) { - buildClassPath.createPath().refid = ref - } - - fun setSrc(src: Path) { - sourcePath.append(src) - } - - fun setSrcRef(ref: Reference) { - sourcePath.createPath().refid = ref - } - - fun createSourceLink(): AntSourceLinkDefinition { - val def = AntSourceLinkDefinition() - antSourceLinkDefinition.add(def) - return def - } - - fun createExternalDocumentationLink() = - ExternalDocumentationLink.Builder().apply { buildExternalLinksBuilders.add(this) } - -} - -class AntPackageOptions( - override var prefix: String = "", - override var includeNonPublic: Boolean = false, - override var reportUndocumented: Boolean = true, - override var skipDeprecated: Boolean = false, - override var suppress: Boolean = false) : DokkaConfiguration.PackageOptions - -class DokkaAntTask: Task(), DokkaConfiguration { - - override var format: String = "html" - override var generateIndexPages: Boolean = false - override var outputDir: String = "" - override var impliedPlatforms: List = listOf() - get() = buildImpliedPlatforms.map { it.value }.toList() - private val buildImpliedPlatforms: MutableList = mutableListOf() - - override var cacheRoot: String? = null - override val passesConfigurations: MutableList = mutableListOf() - override var pluginsClasspath: List = mutableListOf() - - fun createPassConfig() = AntPassConfig(this).apply { passesConfigurations.add(this) } - fun createImpliedPlatform(): TextProperty = TextProperty().apply { buildImpliedPlatforms.add(this) } - - - override fun execute() { - for (passConfig in passesConfigurations) { - if (passConfig.sourcePath.list().isEmpty() && passConfig.antSourceRoots.isEmpty()) { - throw BuildException("At least one source path needs to be specified") - } - - if (passConfig.moduleName == "") { - throw BuildException("Module name needs to be specified and not empty") - } - - for (sourceLink in passConfig.antSourceLinkDefinition) { - if (sourceLink.path == null) { - throw BuildException("'path' attribute of a element is required") - } - if (sourceLink.path!!.contains("\\")) { - throw BuildException("'dir' attribute of a - incorrect value, only Unix based path allowed") - } - - if (sourceLink.url == null) { - throw BuildException("'url' attribute of a element is required") - } - } - } - - if (outputDir == "") { - throw BuildException("Output directory needs to be specified and not empty") - } - - val generator = DokkaGenerator(this, AntLogger(this)) - generator.generate() - } -} \ No newline at end of file diff --git a/runners/ant/src/main/resources/dokka-antlib.xml b/runners/ant/src/main/resources/dokka-antlib.xml deleted file mode 100644 index 9c3373d5..00000000 --- a/runners/ant/src/main/resources/dokka-antlib.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/runners/cli/build.gradle.kts b/runners/cli/build.gradle.kts index 8c4955ca..bc09f2cd 100644 --- a/runners/cli/build.gradle.kts +++ b/runners/cli/build.gradle.kts @@ -10,7 +10,6 @@ repositories { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-cli-jvm:0.2.1") - implementation("com.google.code.gson:gson:2.8.5") implementation(project(":core")) implementation(kotlin("stdlib")) } @@ -36,4 +35,4 @@ publishing { } } -configureBintrayPublication("dokkaCli") \ No newline at end of file +configureBintrayPublication("dokkaCli") diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index b0fb45b2..5e5cd6b2 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka -import com.google.gson.Gson import kotlinx.cli.* import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet.* @@ -34,7 +33,7 @@ class GlobalArguments(args: Array) : DokkaConfiguration { override val sourceSets by parser.option( ArgTypeArgument, description = "Single dokka source set", - fullName = "pass" + fullName = "sourceSet" ).multiple() override val pluginsConfiguration by parser.option( @@ -60,7 +59,7 @@ class GlobalArguments(args: Array) : DokkaConfiguration { val globalPackageOptions by parser.option( ArgType.String, - description = "List of package passConfiguration in format \"prefix,-deprecated,-privateApi,+warnUndocumented,+suppress;...\" " + description = "List of package source sets in format \"prefix,-deprecated,-privateApi,+warnUndocumented,+suppress;...\" " ).delimiter(";") val globalLinks by parser.option( @@ -73,9 +72,9 @@ class GlobalArguments(args: Array) : DokkaConfiguration { description = "Mapping between a source directory and a Web site for browsing the code (allows many paths separated by the semicolon `;`)" ).delimiter(";") - val helpPass by parser.option( - ArgTypeHelpPass, - description = "Prints help for single -pass" + val helpSourceSet by parser.option( + ArgTypeHelpSourceSet, + description = "Prints help for single -sourceSet" ) override val modules: List = emptyList() @@ -94,8 +93,8 @@ class GlobalArguments(args: Array) : DokkaConfiguration { globalSrcLink.forEach { if (it.isNotEmpty() && it.contains("=")) - sourceSets.all { pass -> - pass.sourceLinks.cast>() + sourceSets.all { sourceSet -> + sourceSet.sourceLinks.cast>() .add(SourceLinkDefinitionImpl.parseSourceLinkDefinition(it)) } else { @@ -112,9 +111,9 @@ class GlobalArguments(args: Array) : DokkaConfiguration { } } -fun passArguments(args: Array): DokkaConfiguration.DokkaSourceSet { +private fun parseSourceSet(args: Array): DokkaConfiguration.DokkaSourceSet { - val parser = ArgParser("passConfiguration", prefixStyle = ArgParser.OptionPrefixStyle.JVM) + val parser = ArgParser("sourceSet", prefixStyle = ArgParser.OptionPrefixStyle.JVM) val moduleName by parser.option( ArgType.String, @@ -122,16 +121,21 @@ fun passArguments(args: Array): DokkaConfiguration.DokkaSourceSet { fullName = "module" ).required() - val displayName by parser.option( + val moduleDisplayName by parser.option( ArgType.String, - description = "Name of the source set" - ).default("JVM") + description = "Name of the documentation module" + ) - val sourceSetID by parser.option( + val name by parser.option( ArgType.String, - description = "ID of the source set" + description = "Name of the source set" ).default("main") + val displayName by parser.option( + ArgType.String, + description = "Displayed name of the source set" + ).default("JVM") + val classpath by parser.option( ArgType.String, description = "Classpath for symbol resolution (allows many paths separated by the semicolon `;`)" @@ -213,7 +217,7 @@ fun passArguments(args: Array): DokkaConfiguration.DokkaSourceSet { val perPackageOptions by parser.option( ArgType.String, - description = "List of package passConfiguration in format \"prefix,-deprecated,-privateApi,+warnUndocumented,+suppress;...\" " + description = "List of package source set configuration in format \"prefix,-deprecated,-privateApi,+warnUndocumented,+suppress;...\" " ).delimiter(";") val externalDocumentationLinks by parser.option( @@ -230,12 +234,14 @@ fun passArguments(args: Array): DokkaConfiguration.DokkaSourceSet { parser.parse(args) return object : DokkaConfiguration.DokkaSourceSet { - override val moduleName = moduleName + override val moduleDisplayName = moduleDisplayName ?: moduleName override val displayName = displayName - override val sourceSetID = sourceSetID + override val sourceSetID = DokkaSourceSetID(moduleName, name) override val classpath = classpath override val sourceRoots = sourceRoots.map { SourceRootImpl(it.toAbsolutePath()) } - override val dependentSourceSets: List = dependentSourceSets + override val dependentSourceSets: Set = dependentSourceSets + .map { dependentSourceSetName -> DokkaSourceSetID(moduleName, dependentSourceSetName) } + .toSet() override val samples = samples.map { it.toAbsolutePath() } override val includes = includes.map { it.toAbsolutePath() } override val includeNonPublic = includeNonPublic @@ -294,15 +300,15 @@ object ArgTypeSourceLinkDefinition : ArgType(true) { override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.DokkaSourceSet = - passArguments(value.split(" ").filter { it.isNotBlank() }.toTypedArray()) + parseSourceSet(value.split(" ").filter { it.isNotBlank() }.toTypedArray()) override val description: kotlin.String get() = "" } // Workaround for printing nested parsers help -object ArgTypeHelpPass : ArgType(false) { - override fun convert(value: kotlin.String, name: kotlin.String): Any = Any().also { passArguments(arrayOf("-h")) } +object ArgTypeHelpSourceSet : ArgType(false) { + override fun convert(value: kotlin.String, name: kotlin.String): Any = Any().also { parseSourceSet(arrayOf("-h")) } override val description: kotlin.String get() = "" @@ -345,11 +351,10 @@ fun parseLinks(links: List): List { fun main(args: Array) { val globalArguments = GlobalArguments(args) val configuration = if (globalArguments.json != null) - Gson().fromJson( - Paths.get(globalArguments.json).toFile().readText(), - DokkaConfigurationImpl::class.java + DokkaConfigurationImpl( + Paths.get(checkNotNull(globalArguments.json)).toFile().readText() ) else globalArguments DokkaGenerator(configuration, DokkaConsoleLogger).generate() -} \ No newline at end of file +} diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 71d7e72f..2c25a707 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -19,6 +19,8 @@ dependencies { compileOnly(gradleKotlinDsl()) testImplementation(gradleApi()) testImplementation(kotlin("test-junit")) + testImplementation("org.jetbrains.kotlin:kotlin-gradle-plugin") + constraints { val kotlin_version: String by project compileOnly("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}") { diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt index 3bd0b6ab..c9693467 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt @@ -169,4 +169,4 @@ class ConfigurationExtractor(private val project: Project) { val dependentSourceSets: List, val platform: String ) : Serializable -} \ No newline at end of file +} diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt index ead0f90a..823206e3 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt @@ -19,7 +19,7 @@ open class DokkaCollectorTask : DefaultTask() { @TaskAction fun collect() { - val passesConfigurations = getProjects(project).filter { it.name in modules }.flatMap { + val sourceSets = getProjects(project).filter { it.name in modules }.flatMap { val tasks = try { it.tasks.withType(DokkaTask::class.java) } catch (e: UnknownTaskException) { @@ -30,11 +30,11 @@ open class DokkaCollectorTask : DefaultTask() { val initial = GradleDokkaConfigurationImpl().apply { outputDir = outputDirectory - cacheRoot = passesConfigurations.first().cacheRoot - format = passesConfigurations.first().format + cacheRoot = sourceSets.first().cacheRoot + format = sourceSets.first().format } - configuration = passesConfigurations.fold(initial) { acc, it: GradleDokkaConfigurationImpl -> + configuration = sourceSets.fold(initial) { acc, it: GradleDokkaConfigurationImpl -> if(acc.format != it.format || acc.cacheRoot != it.cacheRoot) throw IllegalStateException("Dokka task configurations differ on core arguments (format, cacheRoot)") acc.sourceSets = acc.sourceSets + it.sourceSets diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaSourceSetIDFactory.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaSourceSetIDFactory.kt new file mode 100644 index 00000000..3fadb4fd --- /dev/null +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaSourceSetIDFactory.kt @@ -0,0 +1,10 @@ +@file:Suppress("FunctionName") + +package org.jetbrains.dokka.gradle + +import org.gradle.api.Project +import org.jetbrains.dokka.DokkaSourceSetID + +internal fun DokkaSourceSetID(project: Project, sourceSetName: String): DokkaSourceSetID { + return DokkaSourceSetID(moduleName = project.path, sourceSetName = sourceSetName) +} diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index e27357c9..aac7e2a0 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -7,11 +7,9 @@ import org.gradle.api.file.FileCollection import org.gradle.api.internal.plugins.DslObject import org.gradle.api.plugins.JavaBasePlugin import org.gradle.api.tasks.* -import org.jetbrains.dokka.DokkaBootstrap +import org.jetbrains.dokka.* import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink.Builder import org.jetbrains.dokka.DokkaConfiguration.SourceRoot -import org.jetbrains.dokka.DokkaException -import org.jetbrains.dokka.Platform import org.jetbrains.dokka.ReflectDsl import org.jetbrains.dokka.ReflectDsl.isNotInstance import org.jetbrains.dokka.gradle.ConfigurationExtractor.PlatformData @@ -183,10 +181,7 @@ open class DokkaTask : DefaultTask(), Configurable { val defaultModulesConfiguration = configuredDokkaSourceSets .map { configureDefault(it, globalConfig) }.takeIf { it.isNotEmpty() } ?: listOf( - configureDefault( - configureDokkaSourceSet(GradleDokkaSourceSet("main")), - null - ) + configureDefault(configureDokkaSourceSet(GradleDokkaSourceSet("main", project)), null) ).takeIf { project.isNotMultiplatformProject() } ?: emptyList() if (defaultModulesConfiguration.isEmpty()) { @@ -288,28 +283,25 @@ open class DokkaTask : DefaultTask(), Configurable { protected fun mergeUserConfigurationAndPlatformData( userConfig: GradleDokkaSourceSet, autoConfig: PlatformData - ) = - userConfig.copy().apply { - sourceRoots.addAll(userConfig.sourceRoots.union(autoConfig.sourceRoots.toSourceRoots()).distinct()) - dependentSourceSets.addAll(userConfig.dependentSourceSets.union(autoConfig.dependentSourceSets).distinct()) - classpath = userConfig.classpath.union(autoConfig.classpath.map { it.absolutePath }).distinct() - if (userConfig.platform == null && autoConfig.platform != "") - platform = autoConfig.platform - } + ) = userConfig.copy().apply { + sourceRoots.addAll(userConfig.sourceRoots.union(autoConfig.sourceRoots.toSourceRoots()).distinct()) + dependentSourceSets.addAll(userConfig.dependentSourceSets) + dependentSourceSets.addAll(autoConfig.dependentSourceSets.map { DokkaSourceSetID(project, it) }) + classpath = userConfig.classpath.union(autoConfig.classpath.map { it.absolutePath }).distinct() + if (userConfig.platform == null && autoConfig.platform != "") + platform = autoConfig.platform + } protected fun configureDefault( config: GradleDokkaSourceSet, globalConfig: GradleDokkaSourceSet? ): GradleDokkaSourceSet { - if (config.moduleName.isBlank()) { - config.moduleName = project.name + if (config.moduleDisplayName.isBlank()) { + config.moduleDisplayName = project.name } - if (config.sourceSetID.isBlank()) { - config.sourceSetID = config.moduleName + "/" + config.name - } - config.dependentSourceSets = config.dependentSourceSets.map { config.moduleName + "/" + it }.toMutableList() + if (config.displayName.isBlank()) { - config.displayName = config.sourceSetID.substringBeforeLast("Main", config.platform.toString()) + config.displayName = config.name.substringBeforeLast("Main", config.platform.toString()) } config.classpath = (config.classpath as List).map { it.toString() }.distinct() // Workaround for Groovy's GStringImpl diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt index a28416d6..7b2d05a6 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt @@ -1,13 +1,19 @@ +@file:Suppress("FunctionName") + package org.jetbrains.dokka.gradle +import com.android.build.gradle.api.AndroidSourceSet import groovy.lang.Closure import org.gradle.api.Action +import org.gradle.api.Project import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional import org.gradle.util.ConfigureUtil import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.DokkaConfiguration.* import org.jetbrains.dokka.DokkaDefaults +import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform import java.io.File import java.io.Serializable @@ -15,6 +21,8 @@ import java.net.URL import java.util.concurrent.Callable import kotlin.reflect.KMutableProperty import kotlin.reflect.full.memberProperties +import org.gradle.api.tasks.SourceSet as GradleSourceSet +import org.jetbrains.kotlin.gradle.model.SourceSet as KotlinSourceSet class GradleSourceRootImpl : SourceRoot, Serializable { override var path: String = "" @@ -25,64 +33,113 @@ class GradleSourceRootImpl : SourceRoot, Serializable { override fun toString(): String = path } -open class GradleDokkaSourceSet(@Transient val name: String = "") : DokkaSourceSet { +open class GradleDokkaSourceSet constructor( + @Transient val name: String, + @Transient internal val project: Project +) : DokkaSourceSet { + @Input @Optional override var classpath: List = emptyList() + @Input - override var moduleName: String = "" + override var moduleDisplayName: String = "" + @Input override var displayName: String = "" - @Input - override var sourceSetID: String = "" + + @get:Internal + override val sourceSetID: DokkaSourceSetID = DokkaSourceSetID(project, name) + @Input override var sourceRoots: MutableList = mutableListOf() + @Input - override var dependentSourceSets: MutableList = mutableListOf() + override var dependentSourceSets: MutableSet = mutableSetOf() + @Input override var samples: List = emptyList() + @Input override var includes: List = emptyList() + @Input override var includeNonPublic: Boolean = DokkaDefaults.includeNonPublic + @Input override var includeRootPackage: Boolean = DokkaDefaults.includeRootPackage + @Input override var reportUndocumented: Boolean = DokkaDefaults.reportUndocumented + @Input override var skipEmptyPackages: Boolean = DokkaDefaults.skipEmptyPackages + @Input override var skipDeprecated: Boolean = DokkaDefaults.skipDeprecated + @Input override var jdkVersion: Int = DokkaDefaults.jdkVersion + @Input override var sourceLinks: MutableList = mutableListOf() + @Input override var perPackageOptions: MutableList = mutableListOf() + @Input override var externalDocumentationLinks: MutableList = mutableListOf() + @Input @Optional override var languageVersion: String? = null + @Input @Optional override var apiVersion: String? = null + @Input override var noStdlibLink: Boolean = DokkaDefaults.noStdlibLink + @Input override var noJdkLink: Boolean = DokkaDefaults.noJdkLink + @Input var noAndroidSdkLink: Boolean = false + @Input override var suppressedFiles: List = emptyList() + @Input override var analysisPlatform: Platform = DokkaDefaults.analysisPlatform + @Input @Optional var platform: String? = null + @Transient var collectKotlinTasks: (() -> List?)? = null + fun DokkaSourceSetID(sourceSetName: String): DokkaSourceSetID { + return DokkaSourceSetID(project, sourceSetName) + } + + fun dependsOn(sourceSet: GradleSourceSet) { + dependsOn(DokkaSourceSetID(sourceSet.name)) + } + + fun dependsOn(sourceSet: DokkaSourceSet) { + dependsOn(sourceSet.sourceSetID) + } + + fun dependsOn(sourceSetName: String) { + dependsOn(DokkaSourceSetID(sourceSetName)) + } + + fun dependsOn(sourceSetID: DokkaSourceSetID) { + dependentSourceSets.add(sourceSetID) + } + fun kotlinTasks(taskSupplier: Callable>) { collectKotlinTasks = { taskSupplier.call() } } @@ -136,6 +193,18 @@ open class GradleDokkaSourceSet(@Transient val name: String = "") : DokkaSourceS } } +fun GradleDokkaSourceSet.dependsOn(sourceSet: KotlinSourceSet) { + dependsOn(DokkaSourceSetID(sourceSet.name)) +} + +fun GradleDokkaSourceSet.dependsOn(sourceSet: org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet) { + dependsOn(DokkaSourceSetID(sourceSet.name)) +} + +fun GradleDokkaSourceSet.dependsOn(sourceSet: AndroidSourceSet) { + dependsOn(DokkaSourceSetID(sourceSet.name)) +} + class GradleSourceLinkDefinitionImpl : SourceLinkDefinition, Serializable { override var path: String = "" override var url: String = "" @@ -174,16 +243,16 @@ class GradlePackageOptionsImpl : PackageOptions, Serializable { } internal fun GradleDokkaSourceSet.copy(): GradleDokkaSourceSet { - val newObj = GradleDokkaSourceSet(this.name) + val newObj = GradleDokkaSourceSet(this.name, this.project) this::class.memberProperties.forEach { field -> if (field is KMutableProperty<*>) { - val value = field.getter.call(this) - if (value is Collection<*>) { - field.setter.call(newObj, value.toMutableList()) - } else { - field.setter.call(newObj, field.getter.call(this)) + when (val value = field.getter.call(this)) { + is List<*> -> field.setter.call(newObj, value.toMutableList()) + is Set<*> -> field.setter.call(newObj, value.toMutableSet()) + else -> field.setter.call(newObj, field.getter.call(this)) } + } } return newObj -} \ No newline at end of file +} diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt index 92d63a40..a92f5475 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt @@ -53,7 +53,9 @@ open class DokkaPlugin : Plugin { project.tasks.create(DOKKA_TASK_NAME, taskClass) } project.tasks.withType(taskClass) { task -> - task.dokkaSourceSets = project.container(GradleDokkaSourceSet::class.java) + task.dokkaSourceSets = project.container(GradleDokkaSourceSet::class.java) { name -> + GradleDokkaSourceSet(name, project) + } task.dokkaRuntime = runtimeConfiguration task.pluginsClasspathConfiguration = pluginsConfiguration task.outputDirectory = File(project.buildDir, DOKKA_TASK_NAME).absolutePath diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt index 0b80f4a2..da6daeea 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt @@ -1,6 +1,9 @@ package org.jetbrains.dokka.gradle +import org.gradle.api.plugins.JavaPluginExtension import org.gradle.testfixtures.ProjectBuilder +import org.jetbrains.dokka.DokkaSourceSetID +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension import kotlin.test.Test import kotlin.test.assertEquals @@ -16,4 +19,78 @@ class KotlinDslDokkaTaskConfigurationTest { assertEquals("test", dokkaTask.outputFormat) } } + + @Test + fun `sourceSet dependsOn by String`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + + project.dokka { + dokkaSourceSets.run { + val commonMain = create("commonMain") + val jvmMain = create("jvmMain") { + it.dependsOn("commonMain") + } + + assertEquals( + 0, commonMain.dependentSourceSets.size, + "Expected no dependent source set in commonMain" + ) + + assertEquals( + 1, jvmMain.dependentSourceSets.size, + "Expected only one dependent source set in jvmMain" + ) + + assertEquals( + commonMain.sourceSetID, jvmMain.dependentSourceSets.single(), + "Expected jvmMain to depend on commonMain" + ) + + assertEquals( + DokkaSourceSetID(project.path, "commonMain"), commonMain.sourceSetID + ) + } + } + } + + @Test + fun `sourceSet dependsOn by DokkaSourceSet`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + + project.dokka { + dokkaSourceSets.run { + val commonMain = create("commonMain") + val jvmMain = create("jvmMain") { + it.dependsOn(commonMain) + } + + assertEquals( + commonMain.sourceSetID, jvmMain.dependentSourceSets.single() + ) + } + } + } + + @Test + fun `sourceSet dependsOn by KotlinSourceSet`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + project.plugins.apply("org.jetbrains.kotlin.jvm") + + val kotlin = project.extensions.getByName("kotlin") as KotlinJvmProjectExtension + + project.dokka { + dokkaSourceSets.run { + val special = create("special") { + it.dependsOn(kotlin.sourceSets.getByName("main")) + } + + assertEquals( + DokkaSourceSetID(project, "main"), special.dependentSourceSets.single() + ) + } + } + } } diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 4c10568c..8160ab87 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -90,9 +90,6 @@ abstract class AbstractDokkaMojo : AbstractMojo() { @Parameter var sourceRoots: List = emptyList() - @Parameter - var dependentSourceSets: List = emptyList() - @Parameter var samples: List = emptyList() @@ -108,6 +105,9 @@ abstract class AbstractDokkaMojo : AbstractMojo() { @Parameter(required = true, defaultValue = "\${project.artifactId}") var moduleName: String = "" + @Parameter + var moduleDisplayName: String = "" + @Parameter(required = false, defaultValue = "false") var skip: Boolean = false @@ -201,12 +201,12 @@ abstract class AbstractDokkaMojo : AbstractMojo() { } val sourceSet = DokkaSourceSetImpl( - moduleName = moduleName, + moduleDisplayName = moduleDisplayName.takeIf(String::isNotBlank) ?: moduleName, displayName = displayName, - sourceSetID = sourceSetName, + sourceSetID = DokkaSourceSetID(moduleName, sourceSetName), classpath = classpath, sourceRoots = sourceDirectories.map { SourceRootImpl(it) }, - dependentSourceSets = dependentSourceSets, + dependentSourceSets = emptySet(), samples = samples, includes = includes, includeNonPublic = includeNonPublic, @@ -246,7 +246,7 @@ abstract class AbstractDokkaMojo : AbstractMojo() { offlineMode = offlineMode, cacheRoot = cacheRoot, sourceSets = listOf(sourceSet).also { - if (sourceSet.moduleName.isEmpty()) logger.warn("Not specified module name. It can result in unexpected behaviour while including documentation for module") + if (sourceSet.moduleDisplayName.isEmpty()) logger.warn("Not specified module name. It can result in unexpected behaviour while including documentation for module") }, pluginsClasspath = getArtifactByAether("org.jetbrains.dokka", "dokka-base", dokkaVersion) + dokkaPlugins.map { getArtifactByAether(it.groupId, it.artifactId, it.version) }.flatten(), diff --git a/testApi/src/main/kotlin/testApi/context/MockContext.kt b/testApi/src/main/kotlin/testApi/context/MockContext.kt index 07aedf28..97347695 100644 --- a/testApi/src/main/kotlin/testApi/context/MockContext.kt +++ b/testApi/src/main/kotlin/testApi/context/MockContext.kt @@ -1,7 +1,6 @@ package org.jetbrains.dokka.testApi.context import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.ExtensionPoint @@ -45,4 +44,4 @@ class MockContext( private fun DokkaPlugin.injectContext(context: DokkaContext) { (DokkaPlugin::class.memberProperties.single { it.name == "context" } as KMutableProperty<*>) .setter.call(this, context) -} \ No newline at end of file +} diff --git a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt index ec2be689..d3127263 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt @@ -1,7 +1,6 @@ package org.jetbrains.dokka.testApi.testRunner import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaGenerator import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger @@ -43,4 +42,4 @@ internal class DokkaTestGenerator( dokkaGenerator.reportAfterRendering(context) } -} \ No newline at end of file +} diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 057045a8..381fb2af 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -174,25 +174,26 @@ abstract class AbstractCoreTest { failOnWarning = failOnWarning ) - fun passes(block: Passes.() -> Unit) { - sourceSets.addAll(Passes().apply(block)) + fun sourceSets(block: SourceSetsBuilder.() -> Unit) { + sourceSets.addAll(SourceSetsBuilder().apply(block)) } } @DokkaConfigurationDsl - protected class Passes : ArrayList() { - fun pass(block: DokkaSourceSetBuilder.() -> Unit) = - add(DokkaSourceSetBuilder().apply(block).build()) + protected class SourceSetsBuilder : ArrayList() { + fun sourceSet(block: DokkaSourceSetBuilder.() -> Unit): DokkaSourceSet = + DokkaSourceSetBuilder().apply(block).build().apply(::add) } @DokkaConfigurationDsl protected class DokkaSourceSetBuilder( var moduleName: String = "root", - var sourceSetID: String = "main", + var moduleDisplayName: String? = null, + var name: String = "main", var displayName: String = "JVM", var classpath: List = emptyList(), var sourceRoots: List = emptyList(), - var dependentSourceSets: List = emptyList(), + var dependentSourceSets: Set = emptySet(), var samples: List = emptyList(), var includes: List = emptyList(), var includeNonPublic: Boolean = false, @@ -212,9 +213,9 @@ abstract class AbstractCoreTest { var sourceLinks: List = emptyList() ) { fun build() = DokkaSourceSetImpl( - moduleName = moduleName, + moduleDisplayName = moduleDisplayName ?: moduleName, displayName = displayName, - sourceSetID = sourceSetID, + sourceSetID = DokkaSourceSetID(moduleName, name), classpath = classpath, sourceRoots = sourceRoots.map { SourceRootImpl(it) }, dependentSourceSets = dependentSourceSets, -- cgit From ecf4dc53e73b23d66c711b306187fe884c76b0ed Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 6 Jul 2020 13:44:23 +0200 Subject: Dokka Gradle Plugin: Configure bintray publication for gradle plugin marker --- runners/gradle-plugin/build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 2c25a707..6b0e894c 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -56,7 +56,6 @@ publishing { } } -configureBintrayPublication("dokkaGradlePlugin") gradlePlugin { plugins { @@ -84,3 +83,5 @@ pluginBundle { artifactId = "dokka-gradle-plugin" } } + +configureBintrayPublication("dokkaGradlePlugin", "dokkaGradlePluginPluginMarkerMaven") -- cgit From 6c1403cd8ffab5e13f12a2744846a70b31710b09 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 7 Jul 2020 14:47:50 +0200 Subject: Annotate all properties on DokkaTask and DokkaMultimoduleTask to support the `validatePlugins` task --- runners/gradle-plugin/build.gradle.kts | 3 --- .../org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt | 10 ++++++++-- .../main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 14 ++++++++++---- .../jetbrains/dokka/gradle/configurationImplementations.kt | 5 +++-- 4 files changed, 21 insertions(+), 11 deletions(-) (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 6b0e894c..77fbe4a7 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -34,9 +34,6 @@ val sourceJar by tasks.registering(Jar::class) { from(sourceSets["main"].allSource) } -// TODO: https://github.com/Kotlin/dokka/issues/1052 -tasks.getByName("validatePlugins").enabled = false - val gradlePluginImplementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin" publishing { diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt index 2ef85de2..803c91c0 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt @@ -5,6 +5,7 @@ import org.gradle.api.DefaultTask import org.gradle.api.artifacts.Configuration import org.gradle.api.tasks.Classpath import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.jetbrains.dokka.DokkaBootstrap import org.jetbrains.dokka.plugability.Configurable @@ -22,11 +23,15 @@ open class DokkaMultimoduleTask : DefaultTask(), Configurable { @Input var outputDirectory: String = "" - @Classpath + @get:Classpath lateinit var pluginsConfig: Configuration + internal set - var dokkaRuntime: Configuration? = null + @get:Classpath + lateinit var dokkaRuntime: Configuration + internal set + @Input override val pluginsConfiguration: Map = mutableMapOf() @TaskAction @@ -64,6 +69,7 @@ open class DokkaMultimoduleTask : DefaultTask(), Configurable { } } + @Internal internal fun getConfiguration(): GradleDokkaConfigurationImpl = GradleDokkaConfigurationImpl().apply { outputDir = project.file(outputDirectory).absolutePath diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index aac7e2a0..d4ade2d9 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -50,7 +50,9 @@ open class DokkaTask : DefaultTask(), Configurable { @Input var outputDirectory: String = "" - var dokkaRuntime: Configuration? = null + @get:Classpath + lateinit var dokkaRuntime: Configuration + internal set @Input var subProjects: List = emptyList() @@ -62,9 +64,11 @@ open class DokkaTask : DefaultTask(), Configurable { @Input var cacheRoot: String? = null - @Classpath + @get:Classpath lateinit var pluginsClasspathConfiguration: Configuration + internal set + @get:Internal internal var config: GradleDokkaConfigurationImpl? = null var dokkaSourceSets: NamedDomainObjectContainer @@ -94,7 +98,7 @@ open class DokkaTask : DefaultTask(), Configurable { private fun loadCore() { if (ClassloaderContainer.coreClassLoader == null) { - val jars = dokkaRuntime!!.resolve() + val jars = dokkaRuntime.resolve() ClassloaderContainer.coreClassLoader = URLClassLoader( jars.map { it.toURI().toURL() }.toTypedArray(), ClassLoader.getSystemClassLoader().parent @@ -176,6 +180,7 @@ open class DokkaTask : DefaultTask(), Configurable { } } + @Internal internal fun getConfigurationOrNull(): GradleDokkaConfigurationImpl? { val globalConfig = dokkaSourceSets.toList().find { it.name.toLowerCase() == GLOBAL_CONFIGURATION_NAME } val defaultModulesConfiguration = configuredDokkaSourceSets @@ -200,6 +205,7 @@ open class DokkaTask : DefaultTask(), Configurable { } } + @Internal internal fun getConfigurationOrThrow(): GradleDokkaConfigurationImpl { return getConfigurationOrNull() ?: throw DokkaException( """ @@ -218,7 +224,7 @@ open class DokkaTask : DefaultTask(), Configurable { ) } - + @get:Internal protected val configuredDokkaSourceSets: List get() = dokkaSourceSets .filterNot { it.name.toLowerCase() == GLOBAL_CONFIGURATION_NAME } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt index 7b2d05a6..49819f9a 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt @@ -34,8 +34,8 @@ class GradleSourceRootImpl : SourceRoot, Serializable { } open class GradleDokkaSourceSet constructor( - @Transient val name: String, - @Transient internal val project: Project + @Transient @get:Input val name: String, + @Transient @get:Internal internal val project: Project ) : DokkaSourceSet { @Input @@ -117,6 +117,7 @@ open class GradleDokkaSourceSet constructor( @Optional var platform: String? = null + @Internal @Transient var collectKotlinTasks: (() -> List?)? = null -- cgit From 1b8030d4b8d4b83e35c91632694fb32fcb58a02d Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 8 Jul 2020 17:09:41 +0200 Subject: Implement PublicationValidation --- build.gradle.kts | 6 +- .../main/kotlin/org/jetbrains/BintrayPublishing.kt | 4 +- .../src/main/kotlin/org/jetbrains/DokkaVersion.kt | 3 + .../kotlin/org/jetbrains/ValidatePublications.kt | 79 ++++++++++++++++++++++ plugins/gfm/build.gradle.kts | 4 ++ plugins/javadoc/build.gradle.kts | 1 - plugins/jekyll/build.gradle.kts | 6 +- plugins/mathjax/build.gradle.kts | 6 +- runners/gradle-plugin/build.gradle.kts | 2 +- 9 files changed, 104 insertions(+), 7 deletions(-) create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/ValidatePublications.kt (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index ee17ba75..7cc0394f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.ValidatePublications import org.jetbrains.configureDokkaVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -45,8 +46,6 @@ subprojects { } } -println("Publication version: $dokka_version") - // Workaround for https://github.com/bintray/gradle-bintray-plugin/issues/267 // Manually disable bintray tasks added to the root project tasks.whenTaskAdded { @@ -54,3 +53,6 @@ tasks.whenTaskAdded { enabled = false } } + +println("Publication version: $dokka_version") +tasks.register("validatePublications") diff --git a/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt b/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt index c3d21d88..4180c445 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt @@ -10,7 +10,8 @@ fun Project.configureBintrayPublication(vararg publications: String) { extensions.configure("bintray") { user = System.getenv("BINTRAY_USER") key = System.getenv("BINTRAY_KEY") - + dryRun = System.getenv("BINTRAY_DRY_RUN") == "true" || + project.properties["bintray_dry_run"] == "true" pkg = PackageConfig().apply { repo = dokka_publication_channel name = "dokka" @@ -25,3 +26,4 @@ fun Project.configureBintrayPublication(vararg publications: String) { setPublications(*publications) } } + diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt index d5fd3e78..2a5c21a7 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt @@ -21,3 +21,6 @@ private fun dokkaVersionFromBase(baseVersion: String): String { } return "$baseVersion-$buildNumber" } + +val Project.dokkaVersion: String + get() = configureDokkaVersion() diff --git a/buildSrc/src/main/kotlin/org/jetbrains/ValidatePublications.kt b/buildSrc/src/main/kotlin/org/jetbrains/ValidatePublications.kt new file mode 100644 index 00000000..84c48b96 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/ValidatePublications.kt @@ -0,0 +1,79 @@ +package org.jetbrains + +import com.jfrog.bintray.gradle.BintrayExtension +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.Project +import org.gradle.api.artifacts.ProjectDependency +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.tasks.TaskAction +import org.gradle.kotlin.dsl.findByType +import org.gradle.kotlin.dsl.provideDelegate + +open class ValidatePublications : DefaultTask() { + class MissingBintrayPublicationException(project: Project, publication: MavenPublication) : GradleException( + "Project ${project.path} has publication ${publication.name} that is not configured for bintray publication" + ) + + class UnpublishedProjectDependencyException( + project: Project, dependencyProject: Project + ) : GradleException( + "Published project ${project.path} cannot depend on unpublished projed ${dependencyProject.path}" + ) + + + @TaskAction + fun validatePublicationConfiguration() { + @Suppress("LocalVariableName") + project.subprojects.forEach { subProject -> + val publishing = subProject.extensions.findByType() ?: return@forEach + publishing.publications + .filterIsInstance() + .filter { it.version == project.dokkaVersion } + .forEach { publication -> + checkPublicationIsConfiguredForBintray(subProject, publication) + checkProjectDependenciesArePublished(subProject) + } + } + } + + private fun checkPublicationIsConfiguredForBintray(project: Project, publication: MavenPublication) { + val bintrayExtension = project.extensions.findByType() + ?: throw MissingBintrayPublicationException(project, publication) + + val isPublicationConfiguredForBintray = bintrayExtension.publications.orEmpty() + .any { publicationName -> publicationName == publication.name } + + if (!isPublicationConfiguredForBintray) { + throw MissingBintrayPublicationException(project, publication) + } + } + + private fun checkProjectDependenciesArePublished(project: Project) { + (project.configurations.findByName("implementation")?.allDependencies.orEmpty() + + project.configurations.findByName("api")?.allDependencies.orEmpty()) + .filterIsInstance() + .forEach { projectDependency -> + val publishing = projectDependency.dependencyProject.extensions.findByType() + ?: throw UnpublishedProjectDependencyException( + project = project, dependencyProject = projectDependency.dependencyProject + ) + + val isPublished = publishing.publications.filterIsInstance() + .filter { it.version == project.dokkaVersion } + .any() + + if (!isPublished) { + throw UnpublishedProjectDependencyException(project, projectDependency.dependencyProject) + } + } + } + + init { + group = "verification" + project.tasks.named("check") { + dependsOn(this@ValidatePublications) + } + } +} diff --git a/plugins/gfm/build.gradle.kts b/plugins/gfm/build.gradle.kts index 2addd9c9..16b318fb 100644 --- a/plugins/gfm/build.gradle.kts +++ b/plugins/gfm/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.configureBintrayPublication + publishing { publications { register("gfmPlugin") { @@ -7,6 +9,8 @@ publishing { } } +configureBintrayPublication("gfmPlugin") + dependencies { compileOnly(project(":plugins:base")) testImplementation(project(":plugins:base")) diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 4c5c22b0..ebf79f8f 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.configureBintrayPublication -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile publishing { publications { diff --git a/plugins/jekyll/build.gradle.kts b/plugins/jekyll/build.gradle.kts index a5c10fa0..b47633db 100644 --- a/plugins/jekyll/build.gradle.kts +++ b/plugins/jekyll/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.configureBintrayPublication + publishing { publications { register("jekyllPlugin") { @@ -7,7 +9,9 @@ publishing { } } +configureBintrayPublication("jekyllPlugin") + dependencies { compileOnly(project(":plugins:base")) implementation(project(":plugins:gfm")) -} \ No newline at end of file +} diff --git a/plugins/mathjax/build.gradle.kts b/plugins/mathjax/build.gradle.kts index 0e9a16d0..67f4822f 100644 --- a/plugins/mathjax/build.gradle.kts +++ b/plugins/mathjax/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.configureBintrayPublication + publishing { publications { register("mathjaxPlugin") { @@ -5,4 +7,6 @@ publishing { from(components["java"]) } } -} \ No newline at end of file +} + +configureBintrayPublication("mathjaxPlugin") diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 77fbe4a7..a8345652 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -81,4 +81,4 @@ pluginBundle { } } -configureBintrayPublication("dokkaGradlePlugin", "dokkaGradlePluginPluginMarkerMaven") +configureBintrayPublication("dokkaGradlePlugin", "pluginMaven", "dokkaGradlePluginPluginMarkerMaven") -- cgit From 8ec106388209543434f990fe3af6fb02a7caceb4 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 13 Jul 2020 09:50:18 +0200 Subject: Implement DokkaTasksTest --- runners/gradle-plugin/build.gradle.kts | 1 + .../jetbrains/dokka/gradle/DokkaCollectorTask.kt | 2 +- .../kotlin/org/jetbrains/dokka/gradle/utils.kt | 9 ---- .../org/jetbrains/dokka/gradle/DokkaTasksTest.kt | 52 ++++++++++++++++++++++ .../gradle/KotlinDslDokkaTaskConfigurationTest.kt | 1 - 5 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index a8345652..5762fa88 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { compileOnly(gradleApi()) compileOnly(gradleKotlinDsl()) testImplementation(gradleApi()) + testImplementation(gradleKotlinDsl()) testImplementation(kotlin("test-junit")) testImplementation("org.jetbrains.kotlin:kotlin-gradle-plugin") diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt index dc94cc7f..27d25884 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt @@ -23,7 +23,7 @@ open class DokkaCollectorTask : DefaultTask() { @TaskAction fun collect() { - val configurations = project.allDescendentProjects().toList() + val configurations = project.subprojects .filter { subProject -> subProject.name in modules } .flatMap { subProject -> dokkaTaskNames.mapNotNull(subProject.tasks::findByName) } .filterIsInstance() diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt index 3a7bcd0d..b6c5cbd8 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt @@ -32,15 +32,6 @@ internal fun Project.isMultiplatformProject() = try { internal fun KotlinTarget.isAndroidTarget() = this.platformType == KotlinPlatformType.androidJvm -internal fun Project.allDescendentProjects(): Sequence { - return sequence { - yieldAll(subprojects) - subprojects.forEach { subproject -> - yieldAll(subproject.allDescendentProjects()) - } - } -} - internal fun NamedDomainObjectContainer.maybeCreate(name: String, configuration: T.() -> Unit): T { return findByName(name) ?: create(name, configuration) } diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt new file mode 100644 index 00000000..66283876 --- /dev/null +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt @@ -0,0 +1,52 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.kotlin.dsl.withType +import org.gradle.testfixtures.ProjectBuilder +import kotlin.test.Test +import kotlin.test.assertSame +import kotlin.test.assertTrue + +class DokkaTasksTest { + + @Test + fun `one task per format is registered`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + + assertTrue( + project.tasks.findByName("dokkaHtml") is DokkaTask, + "Expected DokkaTask: dokkaHtml" + ) + + assertTrue( + project.tasks.findByName("dokkaGfm") is DokkaTask, + "Expected DokkaTask: dokkaGfm" + ) + + assertTrue( + project.tasks.findByName("dokkaJekyll") is DokkaTask, + "Expected DokkaTask: dokkaJekyll" + ) + + assertTrue( + project.tasks.findByName("dokkaJavadoc") is DokkaTask, + "Expected DokkaTask: dokkaJavadoc" + ) + } + + @Test + fun `dokka plugin configurations extend dokkaPlugin`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + + val dokkaPluginsConfiguration = project.maybeCreateDokkaDefaultPluginConfiguration() + + project.tasks.withType().forEach { dokkaTask -> + assertSame( + dokkaTask.plugins.extendsFrom.single(), dokkaPluginsConfiguration, + "Expected dokka plugins configuration to extend default ${dokkaPluginsConfiguration.name} configuration" + ) + } + } + +} diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt index b4b54957..7b78fb55 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka.gradle -import org.gradle.api.plugins.JavaPluginExtension import org.gradle.testfixtures.ProjectBuilder import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension -- cgit From 7a8bdee752c25a9cd09f5859b76463bf44c747db Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Thu, 9 Jul 2020 12:30:52 +0200 Subject: PROPOSAL --- runners/gradle-plugin/build.gradle.kts | 44 ++++++++++------------------------ 1 file changed, 12 insertions(+), 32 deletions(-) (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 5762fa88..00e3602e 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.configureBintrayPublication +import org.jetbrains.dokkaVersion plugins { - id("com.gradle.plugin-publish") `java-gradle-plugin` } @@ -35,13 +35,20 @@ val sourceJar by tasks.registering(Jar::class) { from(sourceSets["main"].allSource) } -val gradlePluginImplementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin" +gradlePlugin { + plugins { + create("dokkaGradlePlugin") { + id = "org.jetbrains.dokka" + implementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin" + version = dokkaVersion + } + } +} publishing { publications { - register("dokkaGradlePlugin") { + maybeCreate("pluginMaven").apply { artifactId = "dokka-gradle-plugin" - from(components["java"]) artifact(sourceJar.get()) } @@ -55,31 +62,4 @@ publishing { } -gradlePlugin { - plugins { - create("dokkaGradlePlugin") { - id = "org.jetbrains.dokka" - implementationClass = gradlePluginImplementationClass - } - } -} - -pluginBundle { - website = "https://www.kotlinlang.org/" - vcsUrl = "https://github.com/kotlin/dokka.git" - description = "Dokka, the Kotlin documentation tool" - tags = listOf("dokka", "kotlin", "kdoc", "android") - - plugins { - getByName("dokkaGradlePlugin") { - displayName = "Dokka plugin" - } - } - - mavenCoordinates { - groupId = "org.jetbrains.dokka" - artifactId = "dokka-gradle-plugin" - } -} - -configureBintrayPublication("dokkaGradlePlugin", "pluginMaven", "dokkaGradlePluginPluginMarkerMaven") +configureBintrayPublication("dokkaGradlePluginPluginMarkerMaven", "pluginMaven") -- cgit From 7ff409fdf621932590dbf0118fff2c73dc76b951 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 14 Jul 2020 10:06:04 +0200 Subject: Adapt changes from "Simplify publishing configuration and enable sourcejars" --- build.gradle.kts | 2 + .../main/kotlin/org/jetbrains/BintrayPublishing.kt | 29 ----------- .../org/jetbrains/PublicationConfiguration.kt | 34 ------------- .../src/main/kotlin/org/jetbrains/publication.kt | 58 ++++++++++++++++++++++ core/build.gradle.kts | 6 ++- core/dependencies/build.gradle.kts | 8 ++- kotlin-analysis/build.gradle.kts | 6 ++- kotlin-analysis/dependencies/build.gradle.kts | 8 ++- plugins/base/build.gradle.kts | 6 ++- plugins/gfm/build.gradle.kts | 6 ++- plugins/javadoc/build.gradle.kts | 6 ++- plugins/jekyll/build.gradle.kts | 6 ++- plugins/kotlin-as-java/build.gradle.kts | 6 ++- plugins/mathjax/build.gradle.kts | 6 ++- runners/cli/build.gradle.kts | 8 ++- runners/gradle-plugin/build.gradle.kts | 4 +- runners/maven-plugin/build.gradle.kts | 11 ++-- testApi/build.gradle.kts | 6 ++- 18 files changed, 123 insertions(+), 93 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt delete mode 100644 buildSrc/src/main/kotlin/org/jetbrains/PublicationConfiguration.kt create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/publication.kt (limited to 'runners/gradle-plugin/build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 7cc0394f..c6335a31 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,6 +42,8 @@ subprojects { // Gradle metadata java { + @Suppress("UnstableApiUsage") + withSourcesJar() targetCompatibility = JavaVersion.VERSION_1_8 } } diff --git a/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt b/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt deleted file mode 100644 index 4180c445..00000000 --- a/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.jetbrains - -import com.jfrog.bintray.gradle.BintrayExtension -import org.gradle.api.Project -import org.gradle.kotlin.dsl.provideDelegate - -fun Project.configureBintrayPublication(vararg publications: String) { - val dokka_version: String by this - val dokka_publication_channel: String by this - extensions.configure("bintray") { - user = System.getenv("BINTRAY_USER") - key = System.getenv("BINTRAY_KEY") - dryRun = System.getenv("BINTRAY_DRY_RUN") == "true" || - project.properties["bintray_dry_run"] == "true" - pkg = PackageConfig().apply { - repo = dokka_publication_channel - name = "dokka" - userOrg = "kotlin" - desc = "Dokka, the Kotlin documentation tool" - vcsUrl = "https://github.com/kotlin/dokka.git" - setLicenses("Apache-2.0") - version = VersionConfig().apply { - name = dokka_version - } - } - setPublications(*publications) - } -} - diff --git a/buildSrc/src/main/kotlin/org/jetbrains/PublicationConfiguration.kt b/buildSrc/src/main/kotlin/org/jetbrains/PublicationConfiguration.kt deleted file mode 100644 index 5dbb8fb9..00000000 --- a/buildSrc/src/main/kotlin/org/jetbrains/PublicationConfiguration.kt +++ /dev/null @@ -1,34 +0,0 @@ -package org.jetbrains - -import com.github.jengelman.gradle.plugins.shadow.ShadowExtension -import org.gradle.api.Project -import org.gradle.api.plugins.JavaPlugin -import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.api.publish.PublishingExtension -import org.gradle.api.publish.maven.MavenPublication -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.get - -fun Project.configurePublication(artifactId: String, useShadow: Boolean = false) { - configure { - publications { - create("maven") { - this.artifactId = artifactId - if (useShadow) { - val shadow = extensions.getByType(ShadowExtension::class.java) - shadow.component(this) - } else { - from(components["java"]) - } - } - } - } - configureBintrayPublication("maven") - plugins.all { - if (this is JavaPlugin) { - val extension = extensions.getByType(JavaPluginExtension::class.java) - @Suppress("UnstableApiUsage") extension.withSourcesJar() - } - } -} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/publication.kt b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt new file mode 100644 index 00000000..47fb23f2 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt @@ -0,0 +1,58 @@ +package org.jetbrains + +import com.github.jengelman.gradle.plugins.shadow.ShadowExtension +import com.jfrog.bintray.gradle.BintrayExtension +import org.gradle.api.Project +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.kotlin.dsl.* + +class DokkaPublicationBuilder { + enum class Component { + Java, Shadow + } + var artifactId: String? = null + var component: Component = Component.Java +} + +fun Project.registerDokkaArtifactPublication(publicationName: String, configure: DokkaPublicationBuilder.() -> Unit) { + configure { + publications { + register(publicationName) { + val builder = DokkaPublicationBuilder().apply(configure) + this.artifactId = builder.artifactId + when (builder.component) { + DokkaPublicationBuilder.Component.Java -> from(components["java"]) + DokkaPublicationBuilder.Component.Shadow -> + extensions.getByType(ShadowExtension::class.java).component(this) + } + } + } + } + + configureBintrayPublication(publicationName) +} + +fun Project.configureBintrayPublication(vararg publications: String) { + val dokka_version: String by this + val dokka_publication_channel: String by this + extensions.configure("bintray") { + user = System.getenv("BINTRAY_USER") + key = System.getenv("BINTRAY_KEY") + dryRun = System.getenv("BINTRAY_DRY_RUN") == "true" || + project.properties["bintray_dry_run"] == "true" + pkg = PackageConfig().apply { + repo = dokka_publication_channel + name = "dokka" + userOrg = "kotlin" + desc = "Dokka, the Kotlin documentation tool" + vcsUrl = "https://github.com/kotlin/dokka.git" + setLicenses("Apache-2.0") + version = VersionConfig().apply { + name = dokka_version + } + } + setPublications(*publications) + } +} + diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 030db5c6..b52d3729 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication plugins { `maven-publish` @@ -29,4 +29,6 @@ tasks { } } -configurePublication("dokka-core") +registerDokkaArtifactPublication("dokkaCore") { + artifactId = "dokka-core" +} diff --git a/core/dependencies/build.gradle.kts b/core/dependencies/build.gradle.kts index 082861b6..a074958d 100644 --- a/core/dependencies/build.gradle.kts +++ b/core/dependencies/build.gradle.kts @@ -1,4 +1,5 @@ -import org.jetbrains.configurePublication +import org.jetbrains.DokkaPublicationBuilder.Component.Shadow +import org.jetbrains.registerDokkaArtifactPublication plugins { id("com.github.johnrengelman.shadow") @@ -28,4 +29,7 @@ tasks { } } -configurePublication("dokka-core-dependencies", useShadow = true) +registerDokkaArtifactPublication("dokkaCoreDependencies") { + artifactId = "dokka-core-dependencies" + component = Shadow +} diff --git a/kotlin-analysis/build.gradle.kts b/kotlin-analysis/build.gradle.kts index 5acc1f06..f87811e1 100644 --- a/kotlin-analysis/build.gradle.kts +++ b/kotlin-analysis/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication plugins { id("com.github.johnrengelman.shadow") @@ -15,4 +15,6 @@ dependencies { api(project(":kotlin-analysis:dependencies", configuration = "shadow")) } -configurePublication("dokka-analysis") +registerDokkaArtifactPublication("dokkaAnalysis") { + artifactId = "dokka-analysis" +} diff --git a/kotlin-analysis/dependencies/build.gradle.kts b/kotlin-analysis/dependencies/build.gradle.kts index 1fd13630..4aba6614 100644 --- a/kotlin-analysis/dependencies/build.gradle.kts +++ b/kotlin-analysis/dependencies/build.gradle.kts @@ -1,4 +1,5 @@ -import org.jetbrains.configurePublication +import org.jetbrains.DokkaPublicationBuilder.Component.Shadow +import org.jetbrains.registerDokkaArtifactPublication plugins { id("com.github.johnrengelman.shadow") @@ -53,4 +54,7 @@ tasks { } } -configurePublication("kotlin-analysis-dependencies", useShadow = true) +registerDokkaArtifactPublication("kotlinAnalysisDependencies"){ + artifactId = "kotlin-analysis-dependencies" + component = Shadow +} diff --git a/plugins/base/build.gradle.kts b/plugins/base/build.gradle.kts index 61e2ef01..0fc7f55c 100644 --- a/plugins/base/build.gradle.kts +++ b/plugins/base/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication plugins { id("com.jfrog.bintray") @@ -30,4 +30,6 @@ tasks { } } -configurePublication("dokka-base") +registerDokkaArtifactPublication("dokkaBase") { + artifactId = "dokka-base" +} diff --git a/plugins/gfm/build.gradle.kts b/plugins/gfm/build.gradle.kts index 73958046..3f69043d 100644 --- a/plugins/gfm/build.gradle.kts +++ b/plugins/gfm/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication dependencies { implementation(project(":plugins:base")) @@ -6,4 +6,6 @@ dependencies { testImplementation(project(":plugins:base:test-utils")) } -configurePublication("gfm-plugin") +registerDokkaArtifactPublication("gfmPlugin") { + artifactId = "gfm-plugin" +} diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 5846ee62..5e2e5600 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication dependencies { implementation("com.soywiz.korlibs.korte:korte-jvm:1.10.3") @@ -10,4 +10,6 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") } -configurePublication("javadoc-plugin") +registerDokkaArtifactPublication("javadocPlugin") { + artifactId = "javadoc-plugin" +} diff --git a/plugins/jekyll/build.gradle.kts b/plugins/jekyll/build.gradle.kts index 0d1e38d6..64cf9800 100644 --- a/plugins/jekyll/build.gradle.kts +++ b/plugins/jekyll/build.gradle.kts @@ -1,8 +1,10 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication dependencies { implementation(project(":plugins:base")) implementation(project(":plugins:gfm")) } -configurePublication("jekyll-plugin") +registerDokkaArtifactPublication("jekyllPlugin") { + artifactId = "jekyll-plugin" +} diff --git a/plugins/kotlin-as-java/build.gradle.kts b/plugins/kotlin-as-java/build.gradle.kts index 27e90f84..eda6114f 100644 --- a/plugins/kotlin-as-java/build.gradle.kts +++ b/plugins/kotlin-as-java/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication dependencies { implementation(project(":plugins:base")) @@ -7,4 +7,6 @@ dependencies { testImplementation(project(":test-tools")) } -configurePublication("kotlin-as-java-plugin") +registerDokkaArtifactPublication("kotlinAsJavaPlugin") { + artifactId = "kotlin-as-java-plugin" +} diff --git a/plugins/mathjax/build.gradle.kts b/plugins/mathjax/build.gradle.kts index ea4cdff0..142e7dc4 100644 --- a/plugins/mathjax/build.gradle.kts +++ b/plugins/mathjax/build.gradle.kts @@ -1,3 +1,5 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication -configurePublication("mathjax-plugin") +registerDokkaArtifactPublication("mathjaxPlugin") { + artifactId = "mathjax-plugin" +} diff --git a/runners/cli/build.gradle.kts b/runners/cli/build.gradle.kts index 19a49346..4ad34192 100644 --- a/runners/cli/build.gradle.kts +++ b/runners/cli/build.gradle.kts @@ -1,4 +1,5 @@ -import org.jetbrains.configurePublication +import org.jetbrains.DokkaPublicationBuilder.Component.Shadow +import org.jetbrains.registerDokkaArtifactPublication plugins { id("com.github.johnrengelman.shadow") @@ -26,5 +27,8 @@ tasks { } } -configurePublication("dokka-cli", useShadow = true) +registerDokkaArtifactPublication("dokkaCli"){ + artifactId = "dokka-cli" + component = Shadow +} diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 00e3602e..0222f5e0 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -47,15 +47,13 @@ gradlePlugin { publishing { publications { - maybeCreate("pluginMaven").apply { + register("pluginMaven") { artifactId = "dokka-gradle-plugin" - artifact(sourceJar.get()) } register("dokkaGradlePluginForIntegrationTests") { artifactId = "dokka-gradle-plugin" from(components["java"]) - artifact(sourceJar.get()) version = "for-integration-tests-SNAPSHOT" } } diff --git a/runners/maven-plugin/build.gradle.kts b/runners/maven-plugin/build.gradle.kts index 83d9f5af..fbd2b48a 100644 --- a/runners/maven-plugin/build.gradle.kts +++ b/runners/maven-plugin/build.gradle.kts @@ -1,6 +1,6 @@ import org.jetbrains.CrossPlatformExec import org.jetbrains.SetupMaven -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication val setupMaven by tasks.register("setupMaven") @@ -45,7 +45,10 @@ val generatePom by tasks.registering(Copy::class) { line.replace("dokka_version", "$dokka_version") } filter { line -> - line.replace("maven-plugin-plugin", "${setupMaven.mavenPluginToolsVersion}") + line.replace( + "maven-plugin-plugin", + "${setupMaven.mavenPluginToolsVersion}" + ) } } } @@ -90,4 +93,6 @@ tasks.named("jar") { } } -configurePublication("dokka-maven-plugin") +registerDokkaArtifactPublication("dokkaMavenPlugin") { + artifactId = "dokka-maven-plugin" +} diff --git a/testApi/build.gradle.kts b/testApi/build.gradle.kts index 1576dd99..fc882f44 100644 --- a/testApi/build.gradle.kts +++ b/testApi/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.configurePublication +import org.jetbrains.registerDokkaArtifactPublication plugins { `maven-publish` @@ -13,4 +13,6 @@ dependencies { implementation(kotlin("reflect")) } -configurePublication("dokka-test-api") +registerDokkaArtifactPublication("dokkaTestApi") { + artifactId = "dokka-test-api" +} -- cgit