Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Aug 18, 2023
1 parent 61e0309 commit 565be8f
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() {
}
sourceSet {
sourceRoots = listOf("src/main/kotlin/basic/TestJS.kt")
analysisPlatform = "jvm"
analysisPlatform = "js"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class DescriptorSuperPropertiesTest : BaseAbstractTest() {
}
}

// protected is publicAPI
// incorrect test https://github.com/Kotlin/dokka/issues/3128
@Test
fun `kotlin inheriting java should not append anything since field is public api`() {
val configuration = dokkaConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ class ObviousAndInheritedFunctionsDocumentableFilterTest : BaseAbstractTest() {
}
}

@JavaCode
@ParameterizedTest
@MethodSource(value = ["nonSuppressingObviousConfiguration", "nonSuppressingInheritedConfiguration"])
@JavaCode
fun `should not suppress toString, equals and hashcode if custom config is provided in Java`(nonSuppressingConfiguration: DokkaConfigurationImpl) {
testInline(
"""
Expand Down
2 changes: 2 additions & 0 deletions plugins/base/src/test/kotlin/utils/TagsAnnotations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ annotation class OnlyDescriptorsMPP(val reason: String = "")

/**
* For test containing .java code
* These tests are disabled in K2 due to Standlone prototype. https://github.com/Kotlin/dokka/issues/3114
*/
@Target(
AnnotationTarget.CLASS,
Expand All @@ -55,6 +56,7 @@ annotation class JavaCode

/**
* For test using JDK
* These tests are disabled in K2 due to Standlone prototype. https://github.com/Kotlin/dokka/issues/3114
*/
@Target(
AnnotationTarget.CLASS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ internal class DefaultPsiToDocumentableTranslator : AsyncSourceToDocumentableTra
val projectProvider = context.plugin<JavaAnalysisPlugin>().querySingle { projectProvider }
val project = projectProvider.getProject(sourceSet, context)

val sourceRoots = sourceSet.sourceRoots.filter { directory -> directory.isDirectory || directory.extension == "java" }
val sourceRootsExtractor = context.plugin<JavaAnalysisPlugin>().querySingle { sourceRootsExtractor }
val sourceRoots = sourceRootsExtractor.extract(sourceSet, context)

val localFileSystem = VirtualFileManager.getInstance().getFileSystem("file")

Expand Down
4 changes: 0 additions & 4 deletions subprojects/analysis-kotlin-symbols/ide/api/ide.api

This file was deleted.

13 changes: 0 additions & 13 deletions subprojects/analysis-kotlin-symbols/ide/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions subprojects/analysis-kotlin-symbols/plugin/api/plugin.api
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ public final class org/jetbrains/dokka/analysis/kotlin/symbols/plugin/SymbolsAna
public final fun getSymbolToDocumentableTranslator ()Lorg/jetbrains/dokka/plugability/Extension;
}

public final class org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinAnalysisSourceRootsExtractor : org/jetbrains/dokka/analysis/java/SourceRootsExtractor {
public fun <init> ()V
public fun extract (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;Lorg/jetbrains/dokka/plugability/DokkaContext;)Ljava/util/List;
}

public class org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinSampleProvider : org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider {
public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V
public fun close ()V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.jetbrains.dokka.analysis.kotlin.symbols.kdoc.java.KotlinInheritDocTag
import org.jetbrains.dokka.analysis.kotlin.symbols.kdoc.java.DescriptorKotlinDocCommentCreator
import org.jetbrains.dokka.analysis.kotlin.symbols.kdoc.java.KotlinDocCommentParser
import org.jetbrains.dokka.analysis.kotlin.symbols.kdoc.moduledocs.ModuleAndPackageDocumentationReader
import org.jetbrains.dokka.analysis.kotlin.symbols.services.KotlinAnalysisSourceRootsExtractor
import org.jetbrains.dokka.analysis.kotlin.symbols.services.*
import org.jetbrains.dokka.analysis.kotlin.symbols.services.KotlinDocumentableSourceLanguageParser
import org.jetbrains.dokka.analysis.kotlin.symbols.services.SymbolExternalDocumentablesProvider
Expand Down Expand Up @@ -116,6 +117,10 @@ class SymbolsAnalysisPlugin : DokkaPlugin() {
plugin<InternalKotlinAnalysisPlugin>().sampleProviderFactory providing ::KotlinSampleProviderFactory
}

internal val sourceRootsExtractor by extending {
javaAnalysisPlugin.sourceRootsExtractor providing { KotlinAnalysisSourceRootsExtractor() }
}

@OptIn(DokkaPluginApiPreview::class)
override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement = PluginApiPreviewAcknowledgement
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.jetbrains.dokka.analysis.kotlin.symbols.services

import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.analysis.java.SourceRootsExtractor
import org.jetbrains.dokka.plugability.DokkaContext
import java.io.File

class KotlinAnalysisSourceRootsExtractor : SourceRootsExtractor {
override fun extract(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext): List<File> {
return sourceSet.sourceRoots.filter { directory -> directory.isDirectory || directory.extension == "java" }
}
}

0 comments on commit 565be8f

Please sign in to comment.