aboutsummaryrefslogtreecommitdiff
path: root/runners
diff options
context:
space:
mode:
Diffstat (limited to 'runners')
-rw-r--r--runners/ant/src/main/kotlin/ant/dokka.kt4
-rw-r--r--runners/gradle-plugin/src/main/kotlin/main.kt4
-rw-r--r--runners/maven-plugin/src/main/kotlin/DokkaMojo.kt7
3 files changed, 14 insertions, 1 deletions
diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt
index 79583a1f..b23328e0 100644
--- a/runners/ant/src/main/kotlin/ant/dokka.kt
+++ b/runners/ant/src/main/kotlin/ant/dokka.kt
@@ -111,6 +111,10 @@ class DokkaAntTask: Task() {
}
val sourceLinks = antSourceLinks.map {
val path = it.path ?: throw BuildException("'path' attribute of a <sourceLink> element is required")
+ if (path.contains("\\")) {
+ throw BuildException("'dir' attribute of a <sourceLink> - incorrect value, only Unix based path allowed.")
+ }
+
val url = it.url ?: throw BuildException("'url' attribute of a <sourceLink> element is required")
SourceLinkDefinitionImpl(File(path).canonicalFile.absolutePath, url, it.lineSuffix)
}
diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt
index c0b74695..f4adc1c3 100644
--- a/runners/gradle-plugin/src/main/kotlin/main.kt
+++ b/runners/gradle-plugin/src/main/kotlin/main.kt
@@ -448,7 +448,9 @@ open class LinkMapping : Serializable, DokkaConfiguration.SourceLinkDefinition {
var dir: String
get() = path
set(value) {
- path = value
+ if (value.contains("\\"))
+ throw java.lang.IllegalArgumentException("Incorrect dir property, only Unix based path allowed.")
+ else path = value
}
override var path: String = ""
diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
index 41521388..324703a0 100644
--- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
+++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
@@ -4,6 +4,7 @@ import org.apache.maven.archiver.MavenArchiveConfiguration
import org.apache.maven.archiver.MavenArchiver
import org.apache.maven.execution.MavenSession
import org.apache.maven.plugin.AbstractMojo
+import org.apache.maven.plugin.MojoExecutionException
import org.apache.maven.plugins.annotations.*
import org.apache.maven.project.MavenProject
import org.apache.maven.project.MavenProjectHelper
@@ -125,6 +126,12 @@ abstract class AbstractDokkaMojo : AbstractMojo() {
return
}
+ sourceLinks.forEach {
+ if (it.dir.contains("\\")) {
+ throw MojoExecutionException("Incorrect dir property, only Unix based path allowed.")
+ }
+ }
+
val gen = DokkaGenerator(
MavenDokkaLogger(log),
classpath,