diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-11 14:10:37 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-14 17:51:11 +0200 |
commit | 334619d42d3c26379429ea8cdab13b28c87c159e (patch) | |
tree | 928a933b0a914f62a8a45acbf6b3cb59ecf2f728 /runners/gradle-plugin/src/main | |
parent | 33d962a55a559aa706649c29d9dd85d724cc37d9 (diff) | |
download | dokka-334619d42d3c26379429ea8cdab13b28c87c159e.tar.gz dokka-334619d42d3c26379429ea8cdab13b28c87c159e.tar.bz2 dokka-334619d42d3c26379429ea8cdab13b28c87c159e.zip |
Refine and test `GradleSourceLinkBuilder` and SourceLinkDefinition API
Diffstat (limited to 'runners/gradle-plugin/src/main')
-rw-r--r-- | runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt index 54700fe9..89ecb5e7 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt @@ -7,27 +7,29 @@ import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional import org.jetbrains.dokka.DokkaConfigurationBuilder import org.jetbrains.dokka.SourceLinkDefinitionImpl +import java.io.File class GradleSourceLinkBuilder( @Transient @get:Internal internal val project: Project ) : DokkaConfigurationBuilder<SourceLinkDefinitionImpl> { + @Input - val path: Property<String> = project.objects.safeProperty<String>() - .safeConvention("") + val localDirectory: Property<File?> = project.objects.safeProperty() @Input - val url: Property<String> = project.objects.safeProperty<String>() + val remoteUrl: Property<String> = project.objects.safeProperty<String>() .safeConvention("") @Optional @Input - val lineSuffix: Property<String?> = project.objects.safeProperty() + val remoteLineSuffix: Property<String> = project.objects.safeProperty<String>() + .safeConvention("#L") override fun build(): SourceLinkDefinitionImpl { return SourceLinkDefinitionImpl( - path = path.getSafe(), - url = url.getSafe(), - lineSuffix = lineSuffix.getSafe() + localDirectory = localDirectory.getSafe()?.absolutePath ?: project.projectDir.absolutePath, + remoteUrl = remoteUrl.getSafe(), + remoteLineSuffix = remoteLineSuffix.getSafe() ) } } |