aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin
diff options
context:
space:
mode:
authorilya-g <ilya.gorbunov@jetbrains.com>2023-01-13 23:17:54 +0100
committerGitHub <noreply@github.com>2023-01-13 23:17:54 +0100
commitac932d43649a9b79780b0961f579e964f33d285e (patch)
tree522e752ad9ee358d71e3fb49ec49c4ce39b63073 /runners/gradle-plugin/src/main/kotlin
parent303c937a7c33fa9df5c28079c423ee071e87e410 (diff)
downloaddokka-ac932d43649a9b79780b0961f579e964f33d285e.tar.gz
dokka-ac932d43649a9b79780b0961f579e964f33d285e.tar.bz2
dokka-ac932d43649a9b79780b0961f579e964f33d285e.zip
Avoid snapshotting sourceLink.localDirectory input (#2807)
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceLinkBuilder.kt17
1 files changed, 15 insertions, 2 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 4a0c1333..b307796d 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
@@ -2,6 +2,7 @@ package org.jetbrains.dokka.gradle
import org.gradle.api.Project
import org.gradle.api.provider.Property
+import org.gradle.api.provider.Provider
import org.gradle.api.tasks.*
import org.jetbrains.dokka.DokkaConfigurationBuilder
import org.jetbrains.dokka.SourceLinkDefinitionImpl
@@ -30,15 +31,27 @@ class GradleSourceLinkBuilder(
/**
* Path to the local source directory. The path must be relative to the root of current project.
*
+ * This path is used to find relative paths of the source files from which the documentation is built.
+ * These relative paths are then combined with the base url of a source code hosting service specified with
+ * the [remoteUrl] property to create source links for each declaration.
+ *
* Example:
*
* ```kotlin
* projectDir.resolve("src")
* ```
*/
- @InputDirectory
- @PathSensitive(PathSensitivity.RELATIVE)
+ @Internal // changing contents of the directory should not invalidate the task
val localDirectory: Property<File?> = project.objects.safeProperty()
+
+ /**
+ * The relative path to [localDirectory] from the project directory. Declared as an input to invalidate the task if that path changes.
+ * Should not be used anywhere directly.
+ */
+ @Suppress("unused")
+ @get:Input
+ internal val localDirectoryPath: Provider<String?> =
+ localDirectory.map { it.relativeToOrSelf(project.projectDir).invariantSeparatorsPath }
/**
* URL of source code hosting service that can be accessed by documentation readers,