diff options
31 files changed, 169 insertions, 55 deletions
@@ -1,4 +1,3 @@ -.idea/ *.ipr *.iml @@ -37,6 +36,7 @@ hs_err_pid* .idea/vcs.xml .idea/shelf .idea/jsLibraryMappings.xml +.idea/modules.xml # Sensitive or high-churn files: .idea/dataSources.ids diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..ba49a93e --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,24 @@ +<component name="ProjectCodeStyleConfiguration"> + <code_scheme name="Project" version="173"> + <JetCodeStyleSettings> + <option name="CONTINUATION_INDENT_IN_PARAMETER_LISTS" value="false" /> + <option name="CONTINUATION_INDENT_IN_ARGUMENT_LISTS" value="false" /> + <option name="CONTINUATION_INDENT_FOR_EXPRESSION_BODIES" value="false" /> + <option name="CONTINUATION_INDENT_FOR_CHAINED_CALLS" value="false" /> + <option name="CONTINUATION_INDENT_IN_SUPERTYPE_LISTS" value="false" /> + <option name="CONTINUATION_INDENT_IN_IF_CONDITIONS" value="false" /> + <option name="WRAP_EXPRESSION_BODY_FUNCTIONS" value="1" /> + </JetCodeStyleSettings> + <codeStyleSettings language="kotlin"> + <option name="CALL_PARAMETERS_WRAP" value="5" /> + <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" /> + <option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" /> + <option name="METHOD_PARAMETERS_WRAP" value="5" /> + <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" /> + <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" /> + <option name="EXTENDS_LIST_WRAP" value="1" /> + <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> + <option name="ASSIGNMENT_WRAP" value="1" /> + </codeStyleSettings> + </code_scheme> +</component>
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..79ee123c --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ +<component name="ProjectCodeStyleConfiguration"> + <state> + <option name="USE_PER_PROJECT_SETTINGS" value="true" /> + </state> +</component>
\ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..fb727eec --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <wildcardResourcePatterns> + <entry name="!?*.java" /> + <entry name="!?*.form" /> + <entry name="!?*.class" /> + <entry name="!?*.groovy" /> + <entry name="!?*.scala" /> + <entry name="!?*.flex" /> + <entry name="!?*.kt" /> + <entry name="!?*.clj" /> + </wildcardResourcePatterns> + <annotationProcessing> + <profile name="Maven default annotation processors profile" enabled="true"> + <sourceOutputDir name="target/generated-sources/annotations" /> + <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> + <outputRelativeToContentRoot value="true" /> + <module name="dokka-maven-plugin" /> + </profile> + </annotationProcessing> + <bytecodeTargetLevel> + <module name="android-gradle-plugin_main" target="1.8" /> + <module name="android-gradle-plugin_test" target="1.8" /> + <module name="ant_main" target="1.8" /> + <module name="ant_test" target="1.8" /> + <module name="buildSrc_main" target="1.8" /> + <module name="buildSrc_test" target="1.8" /> + <module name="cli_main" target="1.8" /> + <module name="cli_test" target="1.8" /> + <module name="core_main" target="1.8" /> + <module name="core_test" target="1.8" /> + <module name="fatjar_main" target="1.8" /> + <module name="fatjar_test" target="1.8" /> + <module name="gradle-integration-tests_main" target="1.8" /> + <module name="gradle-integration-tests_test" target="1.8" /> + <module name="gradle-plugin_main" target="1.8" /> + <module name="gradle-plugin_test" target="1.8" /> + <module name="integration_main" target="1.8" /> + <module name="integration_test" target="1.8" /> + <module name="maven-plugin_main" target="1.8" /> + <module name="maven-plugin_test" target="1.8" /> + <module name="org.jetbrains.dokka.android-gradle-plugin.main" target="1.8" /> + <module name="org.jetbrains.dokka.android-gradle-plugin.test" target="1.8" /> + <module name="org.jetbrains.dokka.ant.main" target="1.8" /> + <module name="org.jetbrains.dokka.ant.test" target="1.8" /> + <module name="org.jetbrains.dokka.buildSrc.main" target="1.8" /> + <module name="org.jetbrains.dokka.buildSrc.test" target="1.8" /> + <module name="org.jetbrains.dokka.cli.main" target="1.8" /> + <module name="org.jetbrains.dokka.cli.test" target="1.8" /> + <module name="org.jetbrains.dokka.core.main" target="1.8" /> + <module name="org.jetbrains.dokka.core.test" target="1.8" /> + <module name="org.jetbrains.dokka.fatjar.main" target="1.8" /> + <module name="org.jetbrains.dokka.fatjar.test" target="1.8" /> + <module name="org.jetbrains.dokka.gradle-integration-tests.main" target="1.8" /> + <module name="org.jetbrains.dokka.gradle-integration-tests.test" target="1.8" /> + <module name="org.jetbrains.dokka.gradle-plugin.main" target="1.8" /> + <module name="org.jetbrains.dokka.gradle-plugin.test" target="1.8" /> + <module name="org.jetbrains.dokka.integration.main" target="1.8" /> + <module name="org.jetbrains.dokka.integration.test" target="1.8" /> + <module name="org.jetbrains.dokka.maven-plugin.main" target="1.8" /> + <module name="org.jetbrains.dokka.maven-plugin.test" target="1.8" /> + </bytecodeTargetLevel> + </component> +</project>
\ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..97626ba4 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding"> + <file url="PROJECT" charset="UTF-8" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 00000000..38d23597 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Kotlin2JsCompilerArguments"> + <option name="sourceMapEmbedSources" /> + <option name="sourceMapPrefix" /> + </component> + <component name="KotlinCommonCompilerArguments"> + <option name="apiVersion" value="1.1" /> + <option name="languageVersion" value="1.2" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..e208459b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/out" /> + </component> +</project>
\ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ +<component name="DependencyValidationManager"> + <state> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </state> +</component>
\ No newline at end of file diff --git a/core/src/main/kotlin/Analysis/CoreProjectFileIndex.kt b/core/src/main/kotlin/Analysis/CoreProjectFileIndex.kt index 319d85b1..f5fbf991 100644 --- a/core/src/main/kotlin/Analysis/CoreProjectFileIndex.kt +++ b/core/src/main/kotlin/Analysis/CoreProjectFileIndex.kt @@ -166,8 +166,7 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont private val sdk: Sdk = object : Sdk, RootProvider { override fun getFiles(rootType: OrderRootType): Array<out VirtualFile> = classpathRoots - .map { StandardFileSystems.local().findFileByPath(it.file.path) } - .filterNotNull() + .mapNotNull { StandardFileSystems.local().findFileByPath(it.file.path) } .toTypedArray() override fun addRootSetChangedListener(p0: RootProvider.RootSetChangedListener) { diff --git a/core/src/main/kotlin/Formats/FormatService.kt b/core/src/main/kotlin/Formats/FormatService.kt index 63f25008..8f4855e3 100644 --- a/core/src/main/kotlin/Formats/FormatService.kt +++ b/core/src/main/kotlin/Formats/FormatService.kt @@ -22,7 +22,7 @@ interface FormatService { } interface FormattedOutputBuilder { - /** Appends formatted content to [StringBuilder](to) using specified [location] */ + /** Appends formatted content */ fun appendNodes(nodes: Iterable<DocumentationNode>) } diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index e088b46d..82359454 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -229,9 +229,9 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, } when (content) { is ContentBlockSampleCode -> - appendSampleBlockCode(content.language, content.importsBlock::appendBlockCodeContent, { content.appendBlockCodeContent() }) + appendSampleBlockCode(content.language, content.importsBlock::appendBlockCodeContent) { content.appendBlockCodeContent() } is ContentBlockCode -> - appendBlockCode(content.language, { content.appendBlockCodeContent() }) + appendBlockCode(content.language) { content.appendBlockCodeContent() } } } is ContentHeading -> appendHeader(content.level) { appendContent(content.children) } diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index 98d56856..2eaf4af2 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -347,7 +347,7 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { } fun hasSuppressDocTag(element: Any?): Boolean { - val declaration = (element as? KtLightDeclaration<*, *>)?.kotlinOrigin as? KtDeclaration ?: return false + val declaration = (element as? KtLightDeclaration<*, *>)?.kotlinOrigin ?: return false return PsiTreeUtil.findChildrenOfType(declaration.docComment, KDocTag::class.java).any { it.knownTag == KDocKnownTag.SUPPRESS } } diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt index 66db46d7..25a974a3 100644 --- a/core/src/main/kotlin/Java/JavadocParser.kt +++ b/core/src/main/kotlin/Java/JavadocParser.kt @@ -192,7 +192,7 @@ class JavadocParser( return when { element.hasAttr("docref") -> { val docref = element.attr("docref") - ContentNodeLazyLink(docref, { -> refGraph.lookupOrWarn(docref, logger) }) + ContentNodeLazyLink(docref) { refGraph.lookupOrWarn(docref, logger)} } element.hasAttr("href") -> { val href = element.attr("href") @@ -235,7 +235,7 @@ class JavadocParser( val linkNode = ContentNodeLazyLink( (tag.valueElement ?: linkElement).text - ) { -> refGraph.lookupOrWarn(linkSignature!!, logger) } + ) { refGraph.lookupOrWarn(linkSignature!!, logger) } linkNode.append(text) linkNode } diff --git a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt index 32084eea..88494581 100644 --- a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt +++ b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt @@ -34,7 +34,7 @@ class DeclarationLinkResolver val signature = elementSignatureProvider.signature(symbol) val referencedAt = fromDescriptor.signatureWithSourceLocation() - return ContentNodeLazyLink(href) { -> + return ContentNodeLazyLink(href) { val target = refGraph.lookup(signature) if (target == null) { diff --git a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt index ddd8a32a..ce20aeec 100644 --- a/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt +++ b/core/src/main/kotlin/Kotlin/DescriptorDocumentationParser.kt @@ -74,7 +74,7 @@ class DescriptorDocumentationParser } val tree = parseMarkdown(kdocText) val linkMap = LinkMap.buildLinkMap(tree.node, kdocText) - val content = buildContent(tree, LinkResolver(linkMap, { href -> linkResolver.resolveContentLink(contextDescriptor, href) }), inline) + val content = buildContent(tree, LinkResolver(linkMap) { href -> linkResolver.resolveContentLink(contextDescriptor, href) }, inline) if (kdoc is KDocSection) { val tags = kdoc.getTags() tags.forEach { @@ -87,7 +87,7 @@ class DescriptorDocumentationParser val section = content.addSection(javadocSectionDisplayName(it.name), it.getSubjectName()) val sectionContent = it.getContent() val markdownNode = parseMarkdown(sectionContent) - buildInlineContentTo(markdownNode, section, LinkResolver(linkMap, { href -> linkResolver.resolveContentLink(contextDescriptor, href) })) + buildInlineContentTo(markdownNode, section, LinkResolver(linkMap) { href -> linkResolver.resolveContentLink(contextDescriptor, href) }) } } } @@ -129,7 +129,7 @@ class DescriptorDocumentationParser FqName.fromSegments(listOf("kotlin", "Any")), NoLookupLocation.FROM_IDE) anyClassDescriptors.forEach { val anyMethod = (it as ClassDescriptor).getMemberScope(listOf()) - .getDescriptorsFiltered(DescriptorKindFilter.FUNCTIONS, { it == descriptor.name }) + .getDescriptorsFiltered(DescriptorKindFilter.FUNCTIONS) { it == descriptor.name } .single() val kdoc = anyMethod.findKDoc() if (kdoc != null) { diff --git a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt index 6e58f766..ee9d8c51 100644 --- a/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/KotlinAsJavaDocumentationBuilder.kt @@ -42,8 +42,7 @@ class KotlinAsJavaDocumentationBuilder fun PsiClass.isVisibleInDocumentation(): Boolean { val origin: KtDeclaration = (this as KtLightElement<*, *>).kotlinOrigin as? KtDeclaration ?: return true - return origin.hasModifier(KtTokens.INTERNAL_KEYWORD) != true && - origin.hasModifier(KtTokens.PRIVATE_KEYWORD) != true + return !origin.hasModifier(KtTokens.INTERNAL_KEYWORD) && !origin.hasModifier(KtTokens.PRIVATE_KEYWORD) } } diff --git a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt index daa09cbf..7310610f 100644 --- a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt +++ b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt @@ -62,7 +62,7 @@ class KotlinLanguageService : CommonLanguageService() { } private fun List<DocumentationNode>.getReceiverKind(): ReceiverKind? { - val qNames = map { it.getReceiverQName() }.filterNotNull() + val qNames = mapNotNull { it.getReceiverQName() } if (qNames.size != size) return null diff --git a/core/src/main/kotlin/Languages/JavaLanguageService.kt b/core/src/main/kotlin/Languages/JavaLanguageService.kt index 59bedd02..ad66123b 100644 --- a/core/src/main/kotlin/Languages/JavaLanguageService.kt +++ b/core/src/main/kotlin/Languages/JavaLanguageService.kt @@ -84,7 +84,7 @@ class JavaLanguageService : LanguageService { return if (constraints.none()) node.name else { - node.name + " extends " + constraints.map { renderType(node) }.joinToString() + node.name + " extends " + constraints.joinToString { renderType(node) } } } @@ -97,7 +97,7 @@ class JavaLanguageService : LanguageService { val typeParameters = node.details(NodeKind.TypeParameter) if (typeParameters.any()) { append("<") - append(typeParameters.map { renderTypeParameter(it) }.joinToString()) + append(typeParameters.joinToString { renderTypeParameter(it) }) append("> ") } }.toString() @@ -142,9 +142,9 @@ class JavaLanguageService : LanguageService { val receiver = node.details(NodeKind.Receiver).singleOrNull() append("(") if (receiver != null) - (listOf(receiver) + node.details(NodeKind.Parameter)).map { renderParameter(it) }.joinTo(this) + (listOf(receiver) + node.details(NodeKind.Parameter)).joinTo(this) { renderParameter(it) } else - node.details(NodeKind.Parameter).map { renderParameter(it) }.joinTo(this) + node.details(NodeKind.Parameter).joinTo(this) { renderParameter(it) } append(")") }.toString() diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt index 8312b2e2..5530e1b4 100644 --- a/core/src/main/kotlin/Model/Content.kt +++ b/core/src/main/kotlin/Model/Content.kt @@ -171,10 +171,10 @@ class ContentSection(val tag: String, val subjectName: String?) : ContentBlock() } object ContentTags { - val Description = "Description" - val SeeAlso = "See Also" - val Return = "Return" - val Exceptions = "Exceptions" + const val Description = "Description" + const val SeeAlso = "See Also" + const val Return = "Return" + const val Exceptions = "Exceptions" } fun content(body: ContentBlock.() -> Unit): ContentBlock { diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 1ff14ff1..311b46e4 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -177,10 +177,10 @@ open class DocumentationNode(val name: String, fun inheritedCompanionObjectMembers(kind: NodeKind): List<DocumentationNode> = inheritedCompanionObjectMembers.filter { it.kind == kind } fun links(kind: NodeKind): List<DocumentationNode> = links.filter { it.kind == kind } - fun detail(kind: NodeKind): DocumentationNode = details.filter { it.kind == kind }.single() - fun detailOrNull(kind: NodeKind): DocumentationNode? = details.filter { it.kind == kind }.singleOrNull() - fun member(kind: NodeKind): DocumentationNode = members.filter { it.kind == kind }.single() - fun link(kind: NodeKind): DocumentationNode = links.filter { it.kind == kind }.single() + fun detail(kind: NodeKind): DocumentationNode = details.single { it.kind == kind } + fun detailOrNull(kind: NodeKind): DocumentationNode? = details.singleOrNull { it.kind == kind } + fun member(kind: NodeKind): DocumentationNode = members.single { it.kind == kind } + fun link(kind: NodeKind): DocumentationNode = links.single { it.kind == kind } fun references(kind: RefKind): List<DocumentationReference> = references.filter { it.kind == kind } diff --git a/core/src/main/kotlin/Model/PackageDocs.kt b/core/src/main/kotlin/Model/PackageDocs.kt index 5b628914..cf6cd808 100644 --- a/core/src/main/kotlin/Model/PackageDocs.kt +++ b/core/src/main/kotlin/Model/PackageDocs.kt @@ -41,7 +41,7 @@ class PackageDocs targetContent = findTargetContent(headingText.trimStart()) } } else { - buildContentTo(it, targetContent, LinkResolver(linkMap, { resolveContentLink(fileName, it, linkResolveContext) })) + buildContentTo(it, targetContent, LinkResolver(linkMap) { resolveContentLink(fileName, it, linkResolveContext) }) } } } else { @@ -118,7 +118,7 @@ class PackageDocs } private fun findOrCreatePackageContent(packageName: String) = - _packageContent.getOrPut(packageName) { -> MutableContent() } + _packageContent.getOrPut(packageName) { MutableContent() } private fun resolveContentLink(fileName: String, href: String, linkResolveContext: List<PackageFragmentDescriptor>): ContentBlock { if (linkResolver != null) { diff --git a/core/src/main/kotlin/Samples/DefaultSampleProcessingService.kt b/core/src/main/kotlin/Samples/DefaultSampleProcessingService.kt index f3f45c3f..da74495f 100644 --- a/core/src/main/kotlin/Samples/DefaultSampleProcessingService.kt +++ b/core/src/main/kotlin/Samples/DefaultSampleProcessingService.kt @@ -45,7 +45,7 @@ open class DefaultSampleProcessingService val text = processSampleBody(psiElement).trim { it == '\n' || it == '\r' }.trimEnd() val lines = text.split("\n") val indent = lines.filter(String::isNotBlank).map { it.takeWhile(Char::isWhitespace).count() }.min() ?: 0 - val finalText = lines.map { it.drop(indent) }.joinToString("\n") + val finalText = lines.joinToString("\n") { it.drop(indent) } return ContentBlockSampleCode(importsBlock = processImports(psiElement)).apply { append(ContentText(finalText)) } } @@ -81,9 +81,7 @@ open class DefaultSampleProcessingService for (part in parts) { // short name val symbolName = Name.identifier(part) - val partSymbol = currentScope.getContributedDescriptors(DescriptorKindFilter.ALL, { it == symbolName }) - .filter { it.name == symbolName } - .firstOrNull() + val partSymbol = currentScope.getContributedDescriptors(DescriptorKindFilter.ALL) { it == symbolName }.firstOrNull { it.name == symbolName } if (partSymbol == null) { symbol = null diff --git a/core/src/main/kotlin/Utilities/DokkaModules.kt b/core/src/main/kotlin/Utilities/DokkaModules.kt index c2e652b6..919ec30f 100644 --- a/core/src/main/kotlin/Utilities/DokkaModules.kt +++ b/core/src/main/kotlin/Utilities/DokkaModules.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.Utilities -import com.google.inject.* +import com.google.inject.Binder +import com.google.inject.Module +import com.google.inject.TypeLiteral import com.google.inject.binder.AnnotatedBindingBuilder import com.google.inject.name.Names import org.jetbrains.dokka.* diff --git a/core/src/main/kotlin/Utilities/ServiceLocator.kt b/core/src/main/kotlin/Utilities/ServiceLocator.kt index b2743c53..835cd34c 100644 --- a/core/src/main/kotlin/Utilities/ServiceLocator.kt +++ b/core/src/main/kotlin/Utilities/ServiceLocator.kt @@ -22,10 +22,7 @@ object ServiceLocator { descriptor: ServiceDescriptor ): T { val loadedClass = javaClass.classLoader.loadClass(descriptor.className) - val constructor = loadedClass.constructors - .filter { it.parameterTypes.isEmpty() } - .firstOrNull() - ?: throw ServiceLookupException("Class ${descriptor.className} has no corresponding constructor") + val constructor = loadedClass.constructors.firstOrNull { it.parameterTypes.isEmpty() } ?: throw ServiceLookupException("Class ${descriptor.className} has no corresponding constructor") val implementationRawType: Any = if (constructor.parameterTypes.isEmpty()) constructor.newInstance() else constructor.newInstance(constructor) diff --git a/core/src/main/kotlin/javadoc/docbase.kt b/core/src/main/kotlin/javadoc/docbase.kt index 62d0ee26..0bf72ccf 100644 --- a/core/src/main/kotlin/javadoc/docbase.kt +++ b/core/src/main/kotlin/javadoc/docbase.kt @@ -481,9 +481,7 @@ open class ClassDocumentationNodeAdapter(module: ModuleNodeAdapter, val classNod fun DocumentationNode.lookupSuperClasses(module: ModuleNodeAdapter) = details(NodeKind.Supertype) - .map { it.links.firstOrNull() } - .map { module.allTypes[it?.qualifiedName()] } - .filterNotNull() + .map { it.links.firstOrNull() }.mapNotNull { module.allTypes[it?.qualifiedName()] } fun List<DocumentationNode>.collectAllTypesRecursively(): Map<String, DocumentationNode> { val result = hashMapOf<String, DocumentationNode>() diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index 2277de78..4f9af761 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -6,7 +6,6 @@ import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.io.FileUtil import com.intellij.rt.execution.junit.FileComparisonFailure import org.jetbrains.dokka.* -import org.jetbrains.dokka.DokkaConfiguration.SourceLinkDefinition import org.jetbrains.dokka.Utilities.DokkaAnalysisModule import org.jetbrains.dokka.Utilities.DokkaRunModule import org.jetbrains.kotlin.cli.common.config.ContentRoot @@ -32,7 +31,7 @@ data class ModelConfig( val defaultPlatforms: List<String> = emptyList(), val noStdlibLink: Boolean = true, val collectInheritedExtensionsFromLibraries: Boolean = false, - val sourceLinks: List<SourceLinkDefinition> = emptyList() + val sourceLinks: List<DokkaConfiguration.SourceLinkDefinition> = emptyList() ) fun verifyModel( diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt index 64ada1d5..1c4dd258 100644 --- a/core/src/test/kotlin/javadoc/JavadocTest.kt +++ b/core/src/test/kotlin/javadoc/JavadocTest.kt @@ -149,8 +149,9 @@ class JavadocTest { .find { it.name() == "some" }!!.parameters().first() .type() assertEquals("kotlin.jvm.functions.Function1", methodParamType.qualifiedTypeName()) - assertEquals("? super A, C", methodParamType.asParameterizedType().typeArguments() - .map(Type::qualifiedTypeName).joinToString()) + assertEquals("? super A, C", + methodParamType.asParameterizedType().typeArguments().joinToString(transform = Type::qualifiedTypeName) + ) } } diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt index 06753342..d6ed610a 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt @@ -31,7 +31,7 @@ abstract class AbstractDokkaAndroidGradleTest : AbstractDokkaGradleTest() { acceptedLicenses.listFiles().forEach { licenseFile -> val target = sdkLicensesDir.resolve(licenseFile.name) if(!target.exists() || target.readText() != licenseFile.readText()) { - val overwrite = System.getProperty("android.licenses.overwrite", "false").toBoolean() + val overwrite = System.getProperty("android.licenses.overwrite", "false")!!.toBoolean() if (!target.exists() || overwrite) { licenseFile.copyTo(target, true) println("Accepted ${licenseFile.name}, by copying $licenseFile to $target") diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt index 255138a9..6bd5786f 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt @@ -7,15 +7,16 @@ import org.junit.Rule import org.junit.rules.TemporaryFolder import java.io.File import java.nio.file.Files +import java.nio.file.Path import java.nio.file.Paths -val testDataFolder = Paths.get("testData") +val testDataFolder: Path = Paths.get("testData") -val pluginClasspathData = Paths.get("build", "createClasspathManifest", "dokka-plugin-classpath.txt") -val androidPluginClasspathData = pluginClasspathData.resolveSibling("android-dokka-plugin-classpath.txt") +val pluginClasspathData: Path = Paths.get("build", "createClasspathManifest", "dokka-plugin-classpath.txt") +val androidPluginClasspathData: Path = pluginClasspathData.resolveSibling("android-dokka-plugin-classpath.txt") -val dokkaFatJarPathData = pluginClasspathData.resolveSibling("fatjar.txt") +val dokkaFatJarPathData: Path = pluginClasspathData.resolveSibling("fatjar.txt") val androidLocalProperties = testDataFolder.resolve("android.local.properties").let { if (Files.exists(it)) it else null } diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt index 2a4ce712..9bc52273 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt @@ -2,8 +2,6 @@ package org.jetbrains.dokka.gradle import org.gradle.testkit.runner.TaskOutcome import org.junit.Test -import java.nio.file.Path -import java.nio.file.Paths import kotlin.test.assertEquals class AndroidLibDependsOnJavaLibTest: AbstractDokkaAndroidGradleTest() { diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 4dcc49ba..5e45af9a 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -284,11 +284,11 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo() { val javadocJar = File(jarOutputDirectory, jarFileName) val archiver = MavenArchiver() - archiver.setArchiver(jarArchiver) + archiver.archiver = jarArchiver archiver.setOutputFile(javadocJar) archiver.archiver.addDirectory(File(outputDir), arrayOf("**/**"), arrayOf()) - archive.setAddMavenDescriptor(false) + archive.isAddMavenDescriptor = false archiver.createArchive(session, project, archive) return javadocJar |