diff options
Diffstat (limited to 'runners')
9 files changed, 107 insertions, 85 deletions
diff --git a/runners/cli/src/main/kotlin/org/jetbrains/dokka/CliArgumentTypes.kt b/runners/cli/src/main/kotlin/org/jetbrains/dokka/CliArgumentTypes.kt index b889bdc6..1c6b0ba4 100644 --- a/runners/cli/src/main/kotlin/org/jetbrains/dokka/CliArgumentTypes.kt +++ b/runners/cli/src/main/kotlin/org/jetbrains/dokka/CliArgumentTypes.kt @@ -11,20 +11,23 @@ import java.io.File import java.nio.file.Paths -object ArgTypeFile : ArgType<File>(true) { +public object ArgTypeFile : ArgType<File>(true) { override fun convert(value: kotlin.String, name: kotlin.String): File = Paths.get(value).toRealPath().toFile() override val description: kotlin.String get() = "{ String that represents a directory / file path }" } -object ArgTypePlatform : ArgType<Platform>(true) { +public object ArgTypePlatform : ArgType<Platform>(true) { override fun convert(value: kotlin.String, name: kotlin.String): Platform = Platform.fromString(value) override val description: kotlin.String get() = "{ String that represents a Kotlin platform. Possible values: jvm/js/native/common/android }" } -object ArgTypeVisibility : ArgType<DokkaConfiguration.Visibility>(true) { - override fun convert(value: kotlin.String, name: kotlin.String) = DokkaConfiguration.Visibility.fromString(value) +public object ArgTypeVisibility : ArgType<DokkaConfiguration.Visibility>(true) { + override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.Visibility { + return DokkaConfiguration.Visibility.fromString(value) + } + override val description: kotlin.String get() = "{ String that represents a visibility modifier. Possible values: ${getPossibleVisibilityValues()}" @@ -32,7 +35,7 @@ object ArgTypeVisibility : ArgType<DokkaConfiguration.Visibility>(true) { DokkaConfiguration.Visibility.values().joinToString(separator = ", ") } -object ArgTypePlugin : ArgType<DokkaConfiguration.PluginConfiguration>(true) { +public object ArgTypePlugin : ArgType<DokkaConfiguration.PluginConfiguration>(true) { override fun convert( value: kotlin.String, name: kotlin.String @@ -52,7 +55,7 @@ object ArgTypePlugin : ArgType<DokkaConfiguration.PluginConfiguration>(true) { "Quotation marks (`\"`) inside json must be escaped. }" } -object ArgTypeSourceLinkDefinition : ArgType<DokkaConfiguration.SourceLinkDefinition>(true) { +public object ArgTypeSourceLinkDefinition : ArgType<DokkaConfiguration.SourceLinkDefinition>(true) { override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.SourceLinkDefinition { return if (value.isNotEmpty() && value.contains("=")) SourceLinkDefinitionImpl.parseSourceLinkDefinition(value) @@ -68,7 +71,7 @@ object ArgTypeSourceLinkDefinition : ArgType<DokkaConfiguration.SourceLinkDefini get() = "{ String that represent source links. Format: {srcPath}={remotePath#lineSuffix} }" } -data class ArgTypeArgument(val moduleName: CLIEntity<kotlin.String>) : +public data class ArgTypeArgument(val moduleName: CLIEntity<kotlin.String>) : ArgType<DokkaConfiguration.DokkaSourceSet>(true) { override fun convert(value: kotlin.String, name: kotlin.String): DokkaConfiguration.DokkaSourceSet = (if (moduleName.valueOrigin != ArgParser.ValueOrigin.UNSET && moduleName.valueOrigin != ArgParser.ValueOrigin.UNDEFINED) { @@ -84,7 +87,7 @@ data class ArgTypeArgument(val moduleName: CLIEntity<kotlin.String>) : } // Workaround for printing nested parsers help -data class ArgTypeHelpSourceSet(val moduleName: CLIEntity<kotlin.String>) : ArgType<Any>(false) { +public data class ArgTypeHelpSourceSet(val moduleName: CLIEntity<kotlin.String>) : ArgType<Any>(false) { override fun convert(value: kotlin.String, name: kotlin.String): Any = Any().also { parseSourceSet(moduleName.value, arrayOf("-h")) } diff --git a/runners/cli/src/main/kotlin/org/jetbrains/dokka/GlobalArguments.kt b/runners/cli/src/main/kotlin/org/jetbrains/dokka/GlobalArguments.kt index f8e04053..5c95f63f 100644 --- a/runners/cli/src/main/kotlin/org/jetbrains/dokka/GlobalArguments.kt +++ b/runners/cli/src/main/kotlin/org/jetbrains/dokka/GlobalArguments.kt @@ -11,11 +11,11 @@ import org.jetbrains.dokka.utilities.LoggingLevel import org.jetbrains.dokka.utilities.cast import java.io.File -class GlobalArguments(args: Array<String>) : DokkaConfiguration { +public class GlobalArguments(args: Array<String>) : DokkaConfiguration { - val parser = ArgParser("dokka-cli", prefixStyle = ArgParser.OptionPrefixStyle.JVM) + public val parser: ArgParser = ArgParser("dokka-cli", prefixStyle = ArgParser.OptionPrefixStyle.JVM) - val json: String? by parser.argument(ArgType.String, description = "JSON configuration file path").optional() + public val json: String? by parser.argument(ArgType.String, description = "JSON configuration file path").optional() private val _moduleName = parser.option( ArgType.String, @@ -25,50 +25,50 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { override val moduleName: String by _moduleName - override val moduleVersion by parser.option( + override val moduleVersion: String? by parser.option( ArgType.String, description = "Documented version", fullName = "moduleVersion" ) - override val outputDir by parser.option(ArgTypeFile, description = "Output directory path, ./dokka by default") + override val outputDir: File by parser.option(ArgTypeFile, description = "Output directory path, ./dokka by default") .default(DokkaDefaults.outputDir) - override val cacheRoot = null + override val cacheRoot: File? = null - override val sourceSets by parser.option( + override val sourceSets: List<DokkaConfiguration.DokkaSourceSet> by parser.option( ArgTypeArgument(_moduleName), description = "Configuration for a Dokka source set. Contains nested configuration.", fullName = "sourceSet" ).multiple() - override val pluginsConfiguration by parser.option( + override val pluginsConfiguration: List<DokkaConfiguration.PluginConfiguration> by parser.option( ArgTypePlugin, description = "Configuration for Dokka plugins. Accepts multiple values separated by `^^`." ).delimiter("^^") - override val pluginsClasspath by parser.option( + override val pluginsClasspath: List<File> by parser.option( ArgTypeFile, fullName = "pluginsClasspath", description = "List of jars with Dokka plugins and their dependencies. Accepts multiple paths separated by semicolons" ).delimiter(";") - override val offlineMode by parser.option( + override val offlineMode: Boolean by parser.option( ArgType.Boolean, description = "Whether to resolve remote files/links over network" ).default(DokkaDefaults.offlineMode) - override val failOnWarning by parser.option( + override val failOnWarning: Boolean by parser.option( ArgType.Boolean, description = "Whether to fail documentation generation if Dokka has emitted a warning or an error" ).default(DokkaDefaults.failOnWarning) - override val delayTemplateSubstitution by parser.option( + override val delayTemplateSubstitution: Boolean by parser.option( ArgType.Boolean, description = "Delay substitution of some elements. Used in incremental builds of multimodule projects" ).default(DokkaDefaults.delayTemplateSubstitution) - val noSuppressObviousFunctions: Boolean by parser.option( + public val noSuppressObviousFunctions: Boolean by parser.option( ArgType.Boolean, description = "Whether to suppress obvious functions such as inherited from `kotlin.Any` and `java.lang.Object`" ).default(!DokkaDefaults.suppressObviousFunctions) @@ -91,31 +91,31 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { override val finalizeCoroutines: Boolean = true - val globalPackageOptions by parser.option( + public val globalPackageOptions: List<String> by parser.option( ArgType.String, description = "Global list of package configurations in format " + "\"matchingRegexp,-deprecated,-privateApi,+warnUndocumented,+suppress;...\". " + "Accepts multiple values separated by semicolons. " ).delimiter(";") - val globalLinks by parser.option( + public val globalLinks: List<String> by parser.option( ArgType.String, description = "Global external documentation links in format {url}^{packageListUrl}. " + "Accepts multiple values separated by `^^`" ).delimiter("^^") - val globalSrcLink by parser.option( + public val globalSrcLink: List<String> by parser.option( ArgType.String, description = "Global mapping between a source directory and a Web service for browsing the code. " + "Accepts multiple paths separated by semicolons" ).delimiter(";") - val helpSourceSet by parser.option( + public val helpSourceSet: Any? by parser.option( ArgTypeHelpSourceSet(_moduleName), description = "Prints help for nested -sourceSet configuration" ) - val loggingLevel by parser.option( + public val loggingLevel: LoggingLevel by parser.option( ArgType.Choice(toVariant = { when (it.toUpperCase().trim()) { "DEBUG", "" -> LoggingLevel.DEBUG @@ -134,7 +134,7 @@ class GlobalArguments(args: Array<String>) : DokkaConfiguration { override val modules: List<DokkaConfiguration.DokkaModuleDescription> = emptyList() - val logger: DokkaLogger by lazy { + public val logger: DokkaLogger by lazy { DokkaConsoleLogger(loggingLevel) } diff --git a/runners/cli/src/main/kotlin/org/jetbrains/dokka/LinkMapper.kt b/runners/cli/src/main/kotlin/org/jetbrains/dokka/LinkMapper.kt index 7d22f6d9..dbfa8db1 100644 --- a/runners/cli/src/main/kotlin/org/jetbrains/dokka/LinkMapper.kt +++ b/runners/cli/src/main/kotlin/org/jetbrains/dokka/LinkMapper.kt @@ -9,7 +9,7 @@ import java.net.MalformedURLException import java.net.URL @OptIn(ExperimentalStdlibApi::class) // for buildList -fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList<DokkaConfiguration.ExternalDocumentationLink> = +public fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList<DokkaConfiguration.ExternalDocumentationLink> = buildList<DokkaConfiguration.ExternalDocumentationLink> { if (!config.noJdkLink) { add(DokkaConfiguration.ExternalDocumentationLink.jdk(config.jdkVersion)) @@ -21,7 +21,7 @@ fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList<DokkaCo }.toMutableList() -fun parseLinks(links: List<String>): List<DokkaConfiguration.ExternalDocumentationLink> { +public fun parseLinks(links: List<String>): List<DokkaConfiguration.ExternalDocumentationLink> { val (parsedLinks, parsedOfflineLinks) = links .map { it.split("^").map { it.trim() }.filter { it.isNotBlank() } } .filter { it.isNotEmpty() } diff --git a/runners/cli/src/main/kotlin/org/jetbrains/dokka/main.kt b/runners/cli/src/main/kotlin/org/jetbrains/dokka/main.kt index 4a2a27ca..e1949a93 100644 --- a/runners/cli/src/main/kotlin/org/jetbrains/dokka/main.kt +++ b/runners/cli/src/main/kotlin/org/jetbrains/dokka/main.kt @@ -8,13 +8,13 @@ import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink import org.jetbrains.dokka.utilities.* import java.nio.file.Paths -fun main(args: Array<String>) { +public fun main(args: Array<String>) { val globalArguments = GlobalArguments(args) val configuration = initializeConfiguration(globalArguments) DokkaGenerator(configuration, globalArguments.logger).generate() } -fun initializeConfiguration(globalArguments: GlobalArguments): DokkaConfiguration { +public fun initializeConfiguration(globalArguments: GlobalArguments): DokkaConfiguration { return if (globalArguments.json != null) { val jsonContent = Paths.get(checkNotNull(globalArguments.json)).toFile().readText() val globals = GlobalDokkaConfiguration(jsonContent) diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index ef30606a..ba95e7a7 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -28,7 +28,9 @@ import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink import java.io.File import java.net.URL -abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependency>) : AbstractMojo() { +public abstract class AbstractDokkaMojo( + private val defaultDokkaPlugins: List<Dependency> +) : AbstractMojo() { @Parameter(defaultValue = "\${project}", readonly = true, required = true) protected var mavenProject: MavenProject? = null @@ -47,10 +49,10 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc private var resolutionErrorHandler: ResolutionErrorHandler? = null @Parameter(defaultValue = "JVM") - var displayName: String = "JVM" + public var displayName: String = "JVM" @Parameter - var sourceSetName: String = "JVM" + public var sourceSetName: String = "JVM" /** * Source code roots to be analyzed and documented. @@ -59,14 +61,14 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `{project.compileSourceRoots}`. */ @Parameter(required = true, defaultValue = "\${project.compileSourceRoots}") - var sourceDirectories: List<String> = emptyList() + public var sourceDirectories: List<String> = emptyList() /** * List of directories or files that contain sample functions which are referenced via * [@sample](https://kotlinlang.org/docs/kotlin-doc.html#sample-identifier) KDoc tag. */ @Parameter - var samples: List<String> = emptyList() + public var samples: List<String> = emptyList() /** * List of Markdown files that contain @@ -95,7 +97,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * ``` */ @Parameter - var includes: List<String> = emptyList() + public var includes: List<String> = emptyList() /** * Classpath for analysis and interactive samples. @@ -106,14 +108,14 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `{project.compileClasspathElements}`. */ @Parameter(required = true, defaultValue = "\${project.compileClasspathElements}") - var classpath: List<String> = emptyList() + public var classpath: List<String> = emptyList() /** * Specifies the location of the project source code on the Web. If provided, Dokka generates * "source" links for each declaration. See [SourceLinkMapItem] for more details. */ @Parameter - var sourceLinks: List<SourceLinkMapItem> = emptyList() + public var sourceLinks: List<SourceLinkMapItem> = emptyList() /** * Display name used to refer to the project/module. Used for ToC, navigation, logging, etc. @@ -121,7 +123,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `{project.artifactId}`. */ @Parameter(required = true, defaultValue = "\${project.artifactId}") - var moduleName: String = "" + public var moduleName: String = "" /** * Whether to skip documentation generation. @@ -129,7 +131,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter(required = false, defaultValue = "false") - var skip: Boolean = false + public var skip: Boolean = false /** * JDK version to use when generating external documentation links for Java types. @@ -141,7 +143,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is JDK 8. */ @Parameter(required = false, defaultValue = "${DokkaDefaults.jdkVersion}") - var jdkVersion: Int = DokkaDefaults.jdkVersion + public var jdkVersion: Int = DokkaDefaults.jdkVersion /** * Whether to document declarations annotated with [Deprecated]. @@ -151,7 +153,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter - var skipDeprecated: Boolean = DokkaDefaults.skipDeprecated + public var skipDeprecated: Boolean = DokkaDefaults.skipDeprecated /** * Whether to skip packages that contain no visible declarations after @@ -163,7 +165,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `true`. */ @Parameter - var skipEmptyPackages: Boolean = DokkaDefaults.skipEmptyPackages + public var skipEmptyPackages: Boolean = DokkaDefaults.skipEmptyPackages /** * Whether to emit warnings about visible undocumented declarations, that is declarations without KDocs @@ -176,7 +178,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter - var reportUndocumented: Boolean = DokkaDefaults.reportUndocumented + public var reportUndocumented: Boolean = DokkaDefaults.reportUndocumented /** * Allows to customize documentation generation options on a per-package basis. @@ -184,7 +186,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * @see PackageOptions for details */ @Parameter - var perPackageOptions: List<PackageOptions> = emptyList() + public var perPackageOptions: List<PackageOptions> = emptyList() /** * Allows linking to Dokka/Javadoc documentation of the project's dependencies. @@ -192,7 +194,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * @see ExternalDocumentationLinkBuilder for details */ @Parameter - var externalDocumentationLinks: List<ExternalDocumentationLinkBuilder> = emptyList() + public var externalDocumentationLinks: List<ExternalDocumentationLinkBuilder> = emptyList() /** * Whether to generate external documentation links that lead to API reference @@ -201,7 +203,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`, meaning links will be generated. */ @Parameter(defaultValue = "${DokkaDefaults.noStdlibLink}") - var noStdlibLink: Boolean = DokkaDefaults.noStdlibLink + public var noStdlibLink: Boolean = DokkaDefaults.noStdlibLink /** * Whether to generate external documentation links to JDK's Javadocs @@ -212,7 +214,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`, meaning links will be generated. */ @Parameter(defaultValue = "${DokkaDefaults.noJdkLink}") - var noJdkLink: Boolean = DokkaDefaults.noJdkLink + public var noJdkLink: Boolean = DokkaDefaults.noJdkLink /** * Whether to resolve remote files/links over network. @@ -230,7 +232,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter(defaultValue = "${DokkaDefaults.offlineMode}") - var offlineMode: Boolean = DokkaDefaults.offlineMode + public var offlineMode: Boolean = DokkaDefaults.offlineMode /** * [Kotlin language version](https://kotlinlang.org/docs/compatibility-modes.html) @@ -240,7 +242,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * By default, the latest language version available to Dokka's embedded compiler will be used. */ @Parameter - var languageVersion: String? = null + public var languageVersion: String? = null /** * [Kotlin API version](https://kotlinlang.org/docs/compatibility-modes.html) @@ -250,14 +252,14 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * By default, it will be deduced from [languageVersion]. */ @Parameter - var apiVersion: String? = null + public var apiVersion: String? = null /** * Directories or individual files that should be suppressed, meaning declarations from them * will be not documented. */ @Parameter - var suppressedFiles: List<String> = emptyList() + public var suppressedFiles: List<String> = emptyList() /** * Set of visibility modifiers that should be documented. @@ -270,7 +272,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is [DokkaConfiguration.Visibility.PUBLIC]. */ @Parameter(property = "visibility") - var documentedVisibilities: Set<DokkaConfiguration.Visibility> = DokkaDefaults.documentedVisibilities + public var documentedVisibilities: Set<DokkaConfiguration.Visibility> = DokkaDefaults.documentedVisibilities // hack to set the default value for lists, didn't find any other safe way // maven seems to overwrite Kotlin's default initialization value, so it doesn't matter what you put there get() = field.ifEmpty { DokkaDefaults.documentedVisibilities } @@ -284,7 +286,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter - var failOnWarning: Boolean = DokkaDefaults.failOnWarning + public var failOnWarning: Boolean = DokkaDefaults.failOnWarning /** * Whether to suppress obvious functions. @@ -298,7 +300,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `true` */ @Parameter(defaultValue = "${DokkaDefaults.suppressObviousFunctions}") - var suppressObviousFunctions: Boolean = DokkaDefaults.suppressObviousFunctions + public var suppressObviousFunctions: Boolean = DokkaDefaults.suppressObviousFunctions /** * Whether to suppress inherited members that aren't explicitly overridden in a given class. @@ -310,7 +312,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * Default is `false`. */ @Parameter(defaultValue = "${DokkaDefaults.suppressInheritedMembers}") - var suppressInheritedMembers: Boolean = DokkaDefaults.suppressInheritedMembers + public var suppressInheritedMembers: Boolean = DokkaDefaults.suppressInheritedMembers /** * Dokka plugins to be using during documentation generation. @@ -328,20 +330,20 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc * ``` */ @Parameter - var dokkaPlugins: List<Dependency> = emptyList() + public var dokkaPlugins: List<Dependency> = emptyList() get() = field + defaultDokkaPlugins @Parameter - var cacheRoot: String? = null + public var cacheRoot: String? = null @Parameter - var platform: String = "" + public var platform: String = "" /** * Deprecated. Use [documentedVisibilities] instead. */ @Parameter - var includeNonPublic: Boolean = DokkaDefaults.includeNonPublic + public var includeNonPublic: Boolean = DokkaDefaults.includeNonPublic protected abstract fun getOutDir(): String @@ -493,7 +495,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true ) -class DokkaMojo : AbstractDokkaMojo(emptyList()) { +public class DokkaMojo : AbstractDokkaMojo(emptyList()) { /** * Directory to which documentation will be generated. @@ -501,9 +503,9 @@ class DokkaMojo : AbstractDokkaMojo(emptyList()) { * Default is `{project.basedir}/target/dokka`. */ @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokka") - var outputDir: String = "" + public var outputDir: String = "" - override fun getOutDir() = outputDir + override fun getOutDir(): String = outputDir } @Mojo( @@ -513,7 +515,7 @@ class DokkaMojo : AbstractDokkaMojo(emptyList()) { requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true ) -class DokkaJavadocMojo : AbstractDokkaMojo(listOf(javadocDependency)) { +public class DokkaJavadocMojo : AbstractDokkaMojo(listOf(javadocDependency)) { /** * Directory to which documentation will be generated. @@ -521,9 +523,9 @@ class DokkaJavadocMojo : AbstractDokkaMojo(listOf(javadocDependency)) { * Default is `{project.basedir}/target/dokkaJavadoc`. */ @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokkaJavadoc") - var outputDir: String = "" + public var outputDir: String = "" - override fun getOutDir() = outputDir + override fun getOutDir(): String = outputDir } @Mojo( @@ -533,7 +535,7 @@ class DokkaJavadocMojo : AbstractDokkaMojo(listOf(javadocDependency)) { requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true ) -class DokkaJavadocJarMojo : AbstractDokkaMojo(listOf(javadocDependency)) { +public class DokkaJavadocJarMojo : AbstractDokkaMojo(listOf(javadocDependency)) { /** * Directory to which documentation jar will be generated. @@ -541,7 +543,7 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo(listOf(javadocDependency)) { * Default is `{project.basedir}/target/dokkaJavadocJar`. */ @Parameter(required = true, defaultValue = "\${project.basedir}/target/dokkaJavadocJar") - var outputDir: String = "" + public var outputDir: String = "" /** * Specifies the directory where the generated jar file will be put. @@ -578,7 +580,7 @@ class DokkaJavadocJarMojo : AbstractDokkaMojo(listOf(javadocDependency)) { @Component(role = Archiver::class, hint = "jar") private var jarArchiver: JarArchiver? = null - override fun getOutDir() = outputDir + override fun getOutDir(): String = outputDir override fun execute() { super.execute() diff --git a/runners/maven-plugin/src/main/kotlin/ExternalDocumentationLinkBuilder.kt b/runners/maven-plugin/src/main/kotlin/ExternalDocumentationLinkBuilder.kt index e39b93c9..5eb4f269 100644 --- a/runners/maven-plugin/src/main/kotlin/ExternalDocumentationLinkBuilder.kt +++ b/runners/maven-plugin/src/main/kotlin/ExternalDocumentationLinkBuilder.kt @@ -6,6 +6,7 @@ package org.jetbrains.dokka.maven import org.apache.maven.plugins.annotations.Parameter import org.jetbrains.dokka.ExternalDocumentationLink +import org.jetbrains.dokka.ExternalDocumentationLinkImpl import java.net.URL /** @@ -30,7 +31,7 @@ import java.net.URL * </externalDocumentationLinks> * ``` */ -class ExternalDocumentationLinkBuilder { +public class ExternalDocumentationLinkBuilder { /** * Root URL of documentation to link with. **Must** contain a trailing slash. @@ -48,7 +49,7 @@ class ExternalDocumentationLinkBuilder { * ``` */ @Parameter(name = "url", required = true) - var url: URL? = null + public var url: URL? = null /** * Specifies the exact location of a `package-list` instead of relying on Dokka @@ -61,7 +62,7 @@ class ExternalDocumentationLinkBuilder { * ``` */ @Parameter(name = "packageListUrl", required = true) - var packageListUrl: URL? = null + public var packageListUrl: URL? = null - fun build() = ExternalDocumentationLink(url, packageListUrl) + public fun build(): ExternalDocumentationLinkImpl = ExternalDocumentationLink(url, packageListUrl) } diff --git a/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt b/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt index bf7997d3..1bc39d10 100644 --- a/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt +++ b/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt @@ -8,7 +8,9 @@ import org.apache.maven.plugin.logging.Log import org.jetbrains.dokka.utilities.DokkaLogger import java.util.concurrent.atomic.AtomicInteger -class MavenDokkaLogger(val log: Log) : DokkaLogger { +public class MavenDokkaLogger( + public val log: Log +) : DokkaLogger { private val warningsCounter = AtomicInteger() private val errorsCounter = AtomicInteger() @@ -20,9 +22,23 @@ class MavenDokkaLogger(val log: Log) : DokkaLogger { get() = errorsCounter.get() set(value) = errorsCounter.set(value) - override fun debug(message: String) = log.debug(message) - override fun info(message: String) = log.info(message) - override fun progress(message: String) = log.info(message) - override fun warn(message: String) = log.warn(message).also { warningsCounter.incrementAndGet() } - override fun error(message: String) = log.error(message).also { errorsCounter.incrementAndGet() } + override fun debug(message: String) { + log.debug(message) + } + + override fun info(message: String) { + log.info(message) + } + + override fun progress(message: String) { + log.info(message) + } + + override fun warn(message: String) { + this.log.warn(message).also { warningsCounter.incrementAndGet() } + } + + override fun error(message: String) { + log.error(message).also { errorsCounter.incrementAndGet() } + } } diff --git a/runners/maven-plugin/src/main/kotlin/PackageOptions.kt b/runners/maven-plugin/src/main/kotlin/PackageOptions.kt index 7b761dd2..875fb047 100644 --- a/runners/maven-plugin/src/main/kotlin/PackageOptions.kt +++ b/runners/maven-plugin/src/main/kotlin/PackageOptions.kt @@ -31,7 +31,7 @@ import org.jetbrains.dokka.DokkaDefaults * </configuration> * ``` */ -class PackageOptions : DokkaConfiguration.PackageOptions { +public class PackageOptions : DokkaConfiguration.PackageOptions { /** * Regular expression that is used to match the package. diff --git a/runners/maven-plugin/src/main/kotlin/SourceLinkMapItem.kt b/runners/maven-plugin/src/main/kotlin/SourceLinkMapItem.kt index 0d2ade3c..ee2354aa 100644 --- a/runners/maven-plugin/src/main/kotlin/SourceLinkMapItem.kt +++ b/runners/maven-plugin/src/main/kotlin/SourceLinkMapItem.kt @@ -23,7 +23,7 @@ import org.apache.maven.plugins.annotations.Parameter * </sourceLinks> * ``` */ -class SourceLinkMapItem { +public class SourceLinkMapItem { /** * Path to the local source directory. The path must be relative to the root of current project. @@ -35,7 +35,7 @@ class SourceLinkMapItem { * ``` */ @Parameter(name = "path", required = true) - var path: String = "" + public var path: String = "" /** * URL of source code hosting service that can be accessed by documentation readers, @@ -49,7 +49,7 @@ class SourceLinkMapItem { * ``` */ @Parameter(name = "url", required = true) - var url: String = "" + public var url: String = "" /** * Suffix used to append source code line number to the URL. This will help readers navigate @@ -65,5 +65,5 @@ class SourceLinkMapItem { * - Bitbucket: `#lines-` */ @Parameter(name = "lineSuffix") - var lineSuffix: String? = null + public var lineSuffix: String? = null } |