aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-14 16:02:42 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-14 17:51:11 +0200
commit3f8c99cf04893da8fc3c353cba0133dc54e5febe (patch)
tree95f5b541ad583f85da5130ca01dbff45ec889e6c /plugins/base/src
parentf655b97cffd875a33618f4326e0a890d3e73ce24 (diff)
downloaddokka-3f8c99cf04893da8fc3c353cba0133dc54e5febe.tar.gz
dokka-3f8c99cf04893da8fc3c353cba0133dc54e5febe.tar.bz2
dokka-3f8c99cf04893da8fc3c353cba0133dc54e5febe.zip
Use java.net.URL consistently across Gradle Plugin API surface
Diffstat (limited to 'plugins/base/src')
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt9
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt5
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
index c8ef7cbc..da2859d9 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
@@ -90,10 +90,10 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
private fun ContentNode.addTable(table: ContentGroup): ContentNode =
when (this) {
is ContentGroup -> {
- if(hasTabbedContent()){
+ if (hasTabbedContent()) {
copy(
children = children.map {
- if(it.hasStyle(ContentStyle.TabbedContent) && it is ContentGroup){
+ if (it.hasStyle(ContentStyle.TabbedContent) && it is ContentGroup) {
it.copy(children = it.children + table)
} else {
it
@@ -123,7 +123,10 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
data class SourceLink(val path: String, val url: String, val lineSuffix: String?, val sourceSetData: DokkaSourceSet) {
constructor(sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, sourceSetData: DokkaSourceSet) : this(
- sourceLinkDefinition.localDirectory, sourceLinkDefinition.remoteUrl, sourceLinkDefinition.remoteLineSuffix, sourceSetData
+ sourceLinkDefinition.localDirectory,
+ sourceLinkDefinition.remoteUrl.toExternalForm(),
+ sourceLinkDefinition.remoteLineSuffix,
+ sourceSetData
)
}
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 40c87b75..f93678a4 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
+import java.net.URL
import java.nio.file.Paths
class LinkableContentTest : AbstractCoreTest() {
@@ -70,7 +71,7 @@ class LinkableContentTest : AbstractCoreTest() {
sourceLinks = listOf(
SourceLinkDefinitionImpl(
localDirectory = "jsMain/kotlin",
- remoteUrl = "https://github.com/user/repo/tree/master/src/jsMain/kotlin",
+ remoteUrl = URL("https://github.com/user/repo/tree/master/src/jsMain/kotlin"),
remoteLineSuffix = "#L"
)
)
@@ -83,7 +84,7 @@ class LinkableContentTest : AbstractCoreTest() {
sourceLinks = listOf(
SourceLinkDefinitionImpl(
localDirectory = "jvmMain/kotlin",
- remoteUrl = "https://github.com/user/repo/tree/master/src/jvmMain/kotlin",
+ remoteUrl = URL("https://github.com/user/repo/tree/master/src/jvmMain/kotlin"),
remoteLineSuffix = "#L"
)
)