All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.dokka.javadoc.validity.MultiplatformConfiguredChecker.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/*
 * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package org.jetbrains.dokka.javadoc.validity

import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.validity.PreGenerationChecker
import org.jetbrains.dokka.validity.PreGenerationCheckerOutput

public class MultiplatformConfiguredChecker(
    public val context: DokkaContext
) : PreGenerationChecker {

    override fun invoke(): PreGenerationCheckerOutput {
        val isSinglePlatform = context.configuration.sourceSets.all { sourceSet ->
            val platform = sourceSet.analysisPlatform
            (platform == Platform.jvm || platform == Platform.common)
        }
        return PreGenerationCheckerOutput(isSinglePlatform, listOfNotNull(errorMessage.takeUnless { isSinglePlatform }))
    }

    public companion object {
        public const val errorMessage: String =
            "Dokka Javadoc plugin currently does not support generating documentation for multiplatform project. Please, adjust your configuration"
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy