diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-05-28 21:12:50 +0200 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2020-06-12 14:15:24 +0200 |
commit | dd44b839eac1b7b647e97f2cc73dd96bd054713b (patch) | |
tree | 6ab5a393c2a7d926519626f5f45f5c8b8cd60505 /core/src/main/kotlin | |
parent | d7be30c841cb925fd0d6322ccdd9877169730b92 (diff) | |
download | dokka-dd44b839eac1b7b647e97f2cc73dd96bd054713b.tar.gz dokka-dd44b839eac1b7b647e97f2cc73dd96bd054713b.tar.bz2 dokka-dd44b839eac1b7b647e97f2cc73dd96bd054713b.zip |
Refactor of Annotations and ExtraModifiers to be platform depedent
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/model/aditionalExtras.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index fcf1efa6..b4355d4b 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -4,7 +4,7 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy -class AdditionalModifiers(val content: Set<ExtraModifiers>) : ExtraProperty<Documentable> { +class AdditionalModifiers(val content: SourceSetDependent<Set<ExtraModifiers>>) : ExtraProperty<Documentable> { companion object : ExtraProperty.Key<Documentable, AdditionalModifiers> { override fun mergeStrategyFor( left: AdditionalModifiers, @@ -19,6 +19,8 @@ class AdditionalModifiers(val content: Set<ExtraModifiers>) : ExtraProperty<Docu override val key: ExtraProperty.Key<Documentable, *> = AdditionalModifiers } +fun SourceSetDependent<Set<ExtraModifiers>>.toAdditionalModifiers() = AdditionalModifiers(this) + class Annotations(val content: SourceSetDependent<List<Annotation>>) : ExtraProperty<Documentable> { companion object : ExtraProperty.Key<Documentable, Annotations> { override fun mergeStrategyFor(left: Annotations, right: Annotations): MergeStrategy<Documentable> = @@ -37,6 +39,8 @@ class Annotations(val content: SourceSetDependent<List<Annotation>>) : ExtraProp } } +fun SourceSetDependent<List<Annotations.Annotation>>.toAnnotations() = Annotations(this) + sealed class AnnotationParameterValue data class AnnotationValue(val annotation: Annotations.Annotation) : AnnotationParameterValue() data class ArrayValue(val value: List<AnnotationParameterValue>) : AnnotationParameterValue() |